Skip to content

Commit 6955561

Browse files
committed
better option categories
1 parent 979f49a commit 6955561

File tree

1 file changed

+142
-102
lines changed

1 file changed

+142
-102
lines changed

SharedProject/Options/AppOptionsPage.cs

Lines changed: 142 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@ namespace FineCodeCoverage.Options
99
{
1010
internal class AppOptionsPage : DialogPage, IAppOptions
1111
{
12-
private const string runCategory = "Run";
13-
private const string environmentCategory = "Environment";
14-
private const string excludeIncludeCategory = "Exclude / Include";
15-
private const string coverletCategory = "Coverlet";
16-
private const string openCoverCategory = "OpenCover";
17-
private const string outputCategory = "Output";
18-
private const string reportCategory = "Report";
19-
private const string uiCategory = "UI";
20-
private const string msExcludeIncludeCategory = "Ms Exclude / Include";
12+
private const string oldRunCategory = "Run ( Coverlet / OpenCover )";
13+
private const string commonRunCategory = "Run ( Common )";
14+
private const string commonEnvironmentCategory = "Environment ( Common )";
15+
private const string coverletExcludeIncludeCategory = "Exclude / Include ( Coverlet )";
16+
private const string oldExcludeIncludeCategory = "Exclude / Include ( Coverlet / OpenCover )";
17+
private const string commonExcludeIncludeCategory = "Exclude / Include ( Common )";
18+
private const string msExcludeIncludeCategory = "Exclude / Include ( Microsoft )";
19+
private const string coverletToolCategory = "Tool ( Coverlet )";
20+
private const string openCoverToolCategory = "Tool ( OpenCover )";
21+
private const string oldOutputCategory = "Output ( Coverlet / OpenCover )";
22+
private const string commonOutputCategory = "Output ( Common )";
23+
private const string commonReportCategory = "Report ( Common )";
24+
private const string openCoverReportCategory = "Report ( OpenCover )";
25+
private const string commonUiCategory = "UI ( Common )";
26+
2127
private static readonly Lazy<IAppOptionsStorageProvider> lazyAppOptionsStorageProvider = new Lazy<IAppOptionsStorageProvider>(GetAppOptionsStorageProvider);
2228

2329
private static IAppOptionsStorageProvider GetAppOptionsStorageProvider()
@@ -35,15 +41,47 @@ private static IAppOptionsStorageProvider GetAppOptionsStorageProvider()
3541
return appOptionsStorageProvider;
3642
}
3743

38-
[Category(runCategory)]
39-
[Description("Specifies whether or not coverage output is enabled!")]
44+
#region run
45+
#region common run category
46+
[Category(commonRunCategory)]
47+
[Description("Specifies whether or not coverage output is enabled")]
4048
public bool Enabled { get; set; }
4149

42-
[Category(runCategory)]
50+
[Category(commonRunCategory)]
4351
[Description("Specifies whether or not the ms code coverage is used (BETA). No, IfInRunSettings, Yes")]
4452
public RunMsCodeCoverage RunMsCodeCoverage { get; set; }
4553

46-
[Category(excludeIncludeCategory)]
54+
[Description("Specify false to prevent coverage when tests fail. Cannot be used in conjunction with RunInParallel")]
55+
[Category(commonRunCategory)]
56+
public bool RunWhenTestsFail { get; set; }
57+
58+
[Description("Specify a value to only run coverage based upon the number of executing tests. Cannot be used in conjunction with RunInParallel")]
59+
[Category(commonRunCategory)]
60+
public int RunWhenTestsExceed { get; set; }
61+
#endregion
62+
63+
#region old run
64+
[Description("Specify true to not wait for tests to finish before running OpenCover / Coverlet coverage")]
65+
[Category(oldRunCategory)]
66+
public bool RunInParallel { get; set; }
67+
#endregion
68+
#endregion
69+
70+
#region exclude / include
71+
#region common exclude include
72+
[Category(commonExcludeIncludeCategory)]
73+
[Description("Set to true to add all referenced projects to Include.")]
74+
public bool IncludeReferencedProjects { get; set; }
75+
76+
[Category(commonExcludeIncludeCategory)]
77+
[Description(
78+
@"Specifies whether to report code coverage of the test assembly
79+
")]
80+
public bool IncludeTestAssembly { get; set; }
81+
#endregion
82+
83+
#region old exclude include
84+
[Category(oldExcludeIncludeCategory)]
4785
[Description(
4886
@"Filter expressions to exclude specific modules and types (multiple)
4987
@@ -60,7 +98,7 @@ private static IAppOptionsStorageProvider GetAppOptionsStorageProvider()
6098
")]
6199
public string[] Exclude { get; set; }
62100

63-
[Category(excludeIncludeCategory)]
101+
[Category(oldExcludeIncludeCategory)]
64102
[Description(
65103
@"Filter expressions to include specific modules and types (multiple)
66104
@@ -77,24 +115,14 @@ private static IAppOptionsStorageProvider GetAppOptionsStorageProvider()
77115
")]
78116
public string[] Include { get; set; }
79117

80-
[Category(excludeIncludeCategory)]
81-
[Description("Set to true to add all referenced projects to Include.")]
82-
public bool IncludeReferencedProjects { get; set; }
83-
84-
[Category(excludeIncludeCategory)]
118+
[Category(oldExcludeIncludeCategory)]
85119
[Description(
86120
@"Glob patterns specifying source files to exclude (multiple)
87121
Use file path or directory path with globbing (e.g. **/Migrations/*)
88122
")]
89123
public string[] ExcludeByFile { get; set; }
90124

91-
[Category(excludeIncludeCategory)]
92-
[Description(
93-
@"Specifies whether to report code coverage of the test assembly
94-
")]
95-
public bool IncludeTestAssembly { get; set; }
96-
97-
[Category(excludeIncludeCategory)]
125+
[Category(oldExcludeIncludeCategory)]
98126
[Description(
99127
@"Attributes to exclude from code coverage (multiple)
100128
@@ -104,83 +132,9 @@ You can also ignore additional attributes by adding to this list (short name or
104132
[MyCustomExcludeFromCodeCoverage] => Any custom attribute that you may define
105133
")]
106134
public string[] ExcludeByAttribute { get; set; }
135+
#endregion
107136

108-
[Description("Specify true to not wait for tests to finish before running coverage")]
109-
[Category(runCategory)]
110-
public bool RunInParallel { get; set; }
111-
112-
[Description("Specify false to prevent coverage when tests fail. Cannot be used in conjunction with RunInParallel")]
113-
[Category(runCategory)]
114-
public bool RunWhenTestsFail { get; set; }
115-
116-
[Description("Specify a value to only run coverage based upon the number of executing tests. Cannot be used in conjunction with RunInParallel")]
117-
[Category(runCategory)]
118-
public int RunWhenTestsExceed { get; set; }
119-
120-
[Description("Folder to which copy tools subfolder. Must alredy exist. Requires restart of VS.")]
121-
[Category(environmentCategory)]
122-
public string ToolsDirectory { get; set; }
123-
124-
[Description("Specify false for global and project options to be used for coverlet data collector configuration elements when not specified in runsettings")]
125-
[Category(coverletCategory)]
126-
public bool RunSettingsOnly { get; set; }
127-
128-
[Description("Specify true to use your own dotnet tools global install of coverlet console.")]
129-
[Category(coverletCategory)]
130-
public bool CoverletConsoleGlobal { get; set; }
131-
132-
[Description("Specify true to use your own dotnet tools local install of coverlet console.")]
133-
[Category(coverletCategory)]
134-
public bool CoverletConsoleLocal { get; set; }
135-
136-
[Description("Specify path to coverlet console exe if you need functionality that the FCC version does not provide.")]
137-
[Category(coverletCategory)]
138-
public string CoverletConsoleCustomPath { get; set; }
139-
140-
[Description("Specify path to directory containing coverlet collector files if you need functionality that the FCC version does not provide.")]
141-
[Category(coverletCategory)]
142-
public string CoverletCollectorDirectoryPath { get; set; }
143-
144-
[Description("Specify path to open cover exe if you need functionality that the FCC version does not provide.")]
145-
[Category(openCoverCategory)]
146-
public string OpenCoverCustomPath { get; set; }
147-
148-
[Description("To have fcc output visible in a sub folder of your solution provide this name")]
149-
[Category(outputCategory)]
150-
public string FCCSolutionOutputDirectoryName { get; set; }
151-
152-
[Description("If your tests are dependent upon their path set this to true.")]
153-
[Category(outputCategory)]
154-
public bool AdjacentBuildOutput { get; set; }
155-
156-
[Category(reportCategory)]
157-
[Description("When cyclomatic complexity exceeds this value for a method then the method will be present in the risk hotspots tab.")]
158-
public int ThresholdForCyclomaticComplexity { get; set; }
159-
160-
[Category(reportCategory)]
161-
[Description("When npath complexity exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only")]
162-
public int ThresholdForNPathComplexity { get; set; }
163-
164-
[Category(reportCategory)]
165-
[Description("When crap score exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only")]
166-
public int ThresholdForCrapScore { get; set; }
167-
168-
[Category(uiCategory)]
169-
[Description("Use Environment / Fonts and Colors for editor Coverage colouring")]
170-
public bool CoverageColoursFromFontsAndColours { get; set; }
171-
172-
[Category(reportCategory)]
173-
[Description("Set to true for coverage table to have a sticky thead.")]
174-
public bool StickyCoverageTable { get; set; }
175-
176-
[Category(reportCategory)]
177-
[Description("Set to false to show classes in report in short form.")]
178-
public bool NamespacedClasses { get; set; }
179-
180-
[Category(reportCategory)]
181-
[Description("Set to true to hide classes, namespaces and assemblies that are fully covered.")]
182-
public bool HideFullyCovered { get; set; }
183-
137+
#region ms exclude include
184138
[Category(msExcludeIncludeCategory)]
185139
[Description("Multiple regexes that match assemblies specified by assembly name or file path - for exclusion")]
186140
public string[] ModulePathsExclude { get; set; }
@@ -228,6 +182,92 @@ You can also ignore additional attributes by adding to this list (short name or
228182
[Category(msExcludeIncludeCategory)]
229183
[Description("Multiple regexes that match procedures, functions, or methods by fully qualified name, including the parameter list. - for inclusion")]
230184
public string[] FunctionsInclude { get; set; }
185+
#endregion
186+
187+
#region coverlet only
188+
[Description("Specify false for global and project options to be used for coverlet data collector configuration elements when not specified in runsettings")]
189+
[Category(coverletExcludeIncludeCategory)]
190+
public bool RunSettingsOnly { get; set; }
191+
#endregion
192+
#endregion
193+
194+
#region output
195+
#region common output
196+
[Description("To have fcc output visible in a sub folder of your solution provide this name")]
197+
[Category(commonOutputCategory)]
198+
public string FCCSolutionOutputDirectoryName { get; set; }
199+
#endregion
200+
201+
#region old output
202+
[Description("If your tests are dependent upon their path set this to true. OpenCover / Coverlet")]
203+
[Category(oldOutputCategory)]
204+
public bool AdjacentBuildOutput { get; set; }
205+
#endregion
206+
#endregion
207+
208+
#region common environment
209+
[Description("Folder to which copy tools subfolder. Must alredy exist. Requires restart of VS.")]
210+
[Category(commonEnvironmentCategory)]
211+
public string ToolsDirectory { get; set; }
212+
#endregion
213+
214+
#region common ui
215+
[Category(commonUiCategory)]
216+
[Description("Use Environment / Fonts and Colors for editor Coverage colouring")]
217+
public bool CoverageColoursFromFontsAndColours { get; set; }
218+
#endregion
219+
220+
#region common report category
221+
[Category(commonReportCategory)]
222+
[Description("When cyclomatic complexity exceeds this value for a method then the method will be present in the risk hotspots tab.")]
223+
public int ThresholdForCyclomaticComplexity { get; set; }
224+
225+
[Category(commonReportCategory)]
226+
[Description("Set to true for coverage table to have a sticky thead.")]
227+
public bool StickyCoverageTable { get; set; }
228+
229+
[Category(commonReportCategory)]
230+
[Description("Set to false to show classes in report in short form.")]
231+
public bool NamespacedClasses { get; set; }
232+
233+
[Category(commonReportCategory)]
234+
[Description("Set to true to hide classes, namespaces and assemblies that are fully covered.")]
235+
public bool HideFullyCovered { get; set; }
236+
#endregion
237+
238+
#region OpenCover report category
239+
[Category(openCoverReportCategory)]
240+
[Description("When npath complexity exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only")]
241+
public int ThresholdForNPathComplexity { get; set; }
242+
243+
[Category(openCoverReportCategory)]
244+
[Description("When crap score exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only")]
245+
public int ThresholdForCrapScore { get; set; }
246+
#endregion
247+
248+
#region coverlet tool only
249+
[Description("Specify true to use your own dotnet tools global install of coverlet console.")]
250+
[Category(coverletToolCategory)]
251+
public bool CoverletConsoleGlobal { get; set; }
252+
253+
[Description("Specify true to use your own dotnet tools local install of coverlet console.")]
254+
[Category(coverletToolCategory)]
255+
public bool CoverletConsoleLocal { get; set; }
256+
257+
[Description("Specify path to coverlet console exe if you need functionality that the FCC version does not provide.")]
258+
[Category(coverletToolCategory)]
259+
public string CoverletConsoleCustomPath { get; set; }
260+
261+
[Description("Specify path to directory containing coverlet collector files if you need functionality that the FCC version does not provide.")]
262+
[Category(coverletToolCategory)]
263+
public string CoverletCollectorDirectoryPath { get; set; }
264+
#endregion
265+
266+
#region open cover tool only
267+
[Description("Specify path to open cover exe if you need functionality that the FCC version does not provide.")]
268+
[Category(openCoverToolCategory)]
269+
public string OpenCoverCustomPath { get; set; }
270+
#endregion
231271

232272
public override void SaveSettingsToStorage()
233273
{

0 commit comments

Comments
 (0)