@@ -68,10 +68,11 @@ public string Report(CoverageResult result)
68
68
69
69
var methLineCoverage = summary . CalculateLineCoverage ( meth . Value . Lines ) ;
70
70
var methBranchCoverage = summary . CalculateBranchCoverage ( meth . Value . Branches ) ;
71
+ var methCyclomaticComplexity = summary . CalculateCyclomaticComplexity ( meth . Value . Branches ) ;
71
72
72
73
XElement method = new XElement ( "Method" ) ;
73
74
74
- method . Add ( new XAttribute ( "cyclomaticComplexity" , "0" ) ) ;
75
+ method . Add ( new XAttribute ( "cyclomaticComplexity" , methCyclomaticComplexity . ToString ( ) ) ) ;
75
76
method . Add ( new XAttribute ( "nPathComplexity" , "0" ) ) ;
76
77
method . Add ( new XAttribute ( "sequenceCoverage" , methLineCoverage . Percent . ToString ( ) ) ) ;
77
78
method . Add ( new XAttribute ( "branchCoverage" , methBranchCoverage . Percent . ToString ( ) ) ) ;
@@ -156,8 +157,8 @@ public string Report(CoverageResult result)
156
157
methodSummary . Add ( new XAttribute ( "visitedBranchPoints" , methBranchCoverage . Covered . ToString ( ) ) ) ;
157
158
methodSummary . Add ( new XAttribute ( "sequenceCoverage" , methLineCoverage . Percent . ToString ( ) ) ) ;
158
159
methodSummary . Add ( new XAttribute ( "branchCoverage" , methBranchCoverage . Percent . ToString ( ) ) ) ;
159
- methodSummary . Add ( new XAttribute ( "maxCyclomaticComplexity" , "0" ) ) ;
160
- methodSummary . Add ( new XAttribute ( "minCyclomaticComplexity" , "0" ) ) ;
160
+ methodSummary . Add ( new XAttribute ( "maxCyclomaticComplexity" , methCyclomaticComplexity . ToString ( ) ) ) ;
161
+ methodSummary . Add ( new XAttribute ( "minCyclomaticComplexity" , methCyclomaticComplexity . ToString ( ) ) ) ;
161
162
methodSummary . Add ( new XAttribute ( "visitedClasses" , "0" ) ) ;
162
163
methodSummary . Add ( new XAttribute ( "numClasses" , "0" ) ) ;
163
164
methodSummary . Add ( new XAttribute ( "visitedMethods" , methodVisited ? "1" : "0" ) ) ;
@@ -181,15 +182,17 @@ public string Report(CoverageResult result)
181
182
var classLineCoverage = summary . CalculateLineCoverage ( cls . Value ) ;
182
183
var classBranchCoverage = summary . CalculateBranchCoverage ( cls . Value ) ;
183
184
var classMethodCoverage = summary . CalculateMethodCoverage ( cls . Value ) ;
185
+ var classMaxCyclomaticComplexity = summary . CalculateMaxCyclomaticComplexity ( cls . Value ) ;
186
+ var classMinCyclomaticComplexity = summary . CalculateMinCyclomaticComplexity ( cls . Value ) ;
184
187
185
188
classSummary . Add ( new XAttribute ( "numSequencePoints" , classLineCoverage . Total . ToString ( ) ) ) ;
186
189
classSummary . Add ( new XAttribute ( "visitedSequencePoints" , classLineCoverage . Covered . ToString ( ) ) ) ;
187
190
classSummary . Add ( new XAttribute ( "numBranchPoints" , classBranchCoverage . Total . ToString ( ) ) ) ;
188
191
classSummary . Add ( new XAttribute ( "visitedBranchPoints" , classBranchCoverage . Covered . ToString ( ) ) ) ;
189
192
classSummary . Add ( new XAttribute ( "sequenceCoverage" , classLineCoverage . Percent . ToString ( ) ) ) ;
190
193
classSummary . Add ( new XAttribute ( "branchCoverage" , classBranchCoverage . Percent . ToString ( ) ) ) ;
191
- classSummary . Add ( new XAttribute ( "maxCyclomaticComplexity" , "0" ) ) ;
192
- classSummary . Add ( new XAttribute ( "minCyclomaticComplexity" , "0" ) ) ;
194
+ classSummary . Add ( new XAttribute ( "maxCyclomaticComplexity" , classMaxCyclomaticComplexity . ToString ( ) ) ) ;
195
+ classSummary . Add ( new XAttribute ( "minCyclomaticComplexity" , classMinCyclomaticComplexity . ToString ( ) ) ) ;
193
196
classSummary . Add ( new XAttribute ( "visitedClasses" , classVisited ? "1" : "0" ) ) ;
194
197
classSummary . Add ( new XAttribute ( "numClasses" , "1" ) ) ;
195
198
classSummary . Add ( new XAttribute ( "visitedMethods" , classMethodCoverage . Covered . ToString ( ) ) ) ;
@@ -210,15 +213,17 @@ public string Report(CoverageResult result)
210
213
211
214
var moduleLineCoverage = summary . CalculateLineCoverage ( result . Modules ) ;
212
215
var moduleBranchCoverage = summary . CalculateLineCoverage ( result . Modules ) ;
216
+ var moduleMaxCyclomaticComplexity = summary . CalculateMaxCyclomaticComplexity ( result . Modules ) ;
217
+ var moduleMinCyclomaticComplexity = summary . CalculateMinCyclomaticComplexity ( result . Modules ) ;
213
218
214
219
coverageSummary . Add ( new XAttribute ( "numSequencePoints" , moduleLineCoverage . Total . ToString ( ) ) ) ;
215
220
coverageSummary . Add ( new XAttribute ( "visitedSequencePoints" , moduleLineCoverage . Covered . ToString ( ) ) ) ;
216
221
coverageSummary . Add ( new XAttribute ( "numBranchPoints" , moduleBranchCoverage . Total . ToString ( ) ) ) ;
217
222
coverageSummary . Add ( new XAttribute ( "visitedBranchPoints" , moduleBranchCoverage . Covered . ToString ( ) ) ) ;
218
223
coverageSummary . Add ( new XAttribute ( "sequenceCoverage" , moduleLineCoverage . Percent . ToString ( ) ) ) ;
219
224
coverageSummary . Add ( new XAttribute ( "branchCoverage" , moduleBranchCoverage . Percent . ToString ( ) ) ) ;
220
- coverageSummary . Add ( new XAttribute ( "maxCyclomaticComplexity" , "0" ) ) ;
221
- coverageSummary . Add ( new XAttribute ( "minCyclomaticComplexity" , "0" ) ) ;
225
+ coverageSummary . Add ( new XAttribute ( "maxCyclomaticComplexity" , moduleMaxCyclomaticComplexity . ToString ( ) ) ) ;
226
+ coverageSummary . Add ( new XAttribute ( "minCyclomaticComplexity" , moduleMinCyclomaticComplexity . ToString ( ) ) ) ;
222
227
coverageSummary . Add ( new XAttribute ( "visitedClasses" , visitedClasses . ToString ( ) ) ) ;
223
228
coverageSummary . Add ( new XAttribute ( "numClasses" , numClasses . ToString ( ) ) ) ;
224
229
coverageSummary . Add ( new XAttribute ( "visitedMethods" , visitedMethods . ToString ( ) ) ) ;
0 commit comments