Skip to content

Commit 51c2ecf

Browse files
committed
correct report threshold command line
1 parent d1833f6 commit 51c2ecf

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

FineCodeCoverage/Core/ReportGenerator/ReportGeneratorUtil.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,22 @@ async Task<bool> run(string outputReportType, string inputReports)
9191
{
9292
reportTypeSettings.Add($@"""-reports:{inputReports}""");
9393
reportTypeSettings.Add($@"""-reporttypes:Cobertura""");
94-
var options = appOptionsProvider.Get();
95-
var cyclomaticThreshold = options.ThresholdForCyclomaticComplexity;
96-
var crapScoreThreshold = options.ThresholdForCrapScore;
97-
var nPathThreshold = options.ThresholdForNPathComplexity;
9894
99-
reportTypeSettings.Add($@"""-riskHotspotsAnalysisThresholds:metricThresholdForCyclomaticComplexity={cyclomaticThreshold}""");
100-
reportTypeSettings.Add($@"""-riskHotspotsAnalysisThresholds:metricThresholdForCrapScore={crapScoreThreshold}""");
101-
reportTypeSettings.Add($@"""-riskHotspotsAnalysisThresholds:metricThresholdForNPathComplexity={nPathThreshold}""");
102-
10395
}
10496
else if (outputReportType.Equals("HtmlInline_AzurePipelines", StringComparison.OrdinalIgnoreCase))
10597
{
10698
reportTypeSettings.Add($@"""-reports:{inputReports}""");
10799
reportTypeSettings.Add($@"""-plugins:{typeof(FccLightReportBuilder).Assembly.Location}""");
108100
reportTypeSettings.Add($@"""-reporttypes:{(darkMode ? FccDarkReportBuilder.REPORT_TYPE : FccLightReportBuilder.REPORT_TYPE)}""");
101+
var options = appOptionsProvider.Get();
102+
var cyclomaticThreshold = options.ThresholdForCyclomaticComplexity;
103+
var crapScoreThreshold = options.ThresholdForCrapScore;
104+
var nPathThreshold = options.ThresholdForNPathComplexity;
105+
106+
reportTypeSettings.Add($@"""riskHotspotsAnalysisThresholds:metricThresholdForCyclomaticComplexity={cyclomaticThreshold}""");
107+
reportTypeSettings.Add($@"""riskHotspotsAnalysisThresholds:metricThresholdForCrapScore={crapScoreThreshold}""");
108+
reportTypeSettings.Add($@"""riskHotspotsAnalysisThresholds:metricThresholdForNPathComplexity={nPathThreshold}""");
109+
109110
}
110111
else
111112
{

FineCodeCoverage/Options/AppOptions.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,15 @@ You can also ignore additional attributes by adding to this list (short name or
140140

141141
[Category(reportCategory)]
142142
[Description("When cyclomatic complexity exceeds this value for a method then the method will be present in the risk hotspots tab.")]
143-
public int ThresholdForCyclomaticComplexity { get; set; } = 30
143+
public int ThresholdForCyclomaticComplexity { get; set; } = 30;
144+
144145
[Category(reportCategory)]
145146
[Description("When npath complexity exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only")]
146-
public int ThresholdForNPathComplexity { get; set; } = 200
147+
public int ThresholdForNPathComplexity { get; set; } = 200;
148+
147149
[Category(reportCategory)]
148150
[Description("When crap score exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only")]
149-
public int ThresholdForCrapScore { get; set; } = 15
151+
public int ThresholdForCrapScore { get; set; } = 15;
150152

151153
[SuppressMessage("Usage", "VSTHRD010:Invoke single-threaded types on Main thread")]
152154
public override void SaveSettingsToStorage()

0 commit comments

Comments
 (0)