@@ -27,7 +27,7 @@ public string Report(CoverageResult result)
27
27
coverage . Add ( new XAttribute ( "line-rate" , ( summary . CalculateLineCoverage ( result . Modules ) . Percent / 100 ) . ToString ( CultureInfo . InvariantCulture ) ) ) ;
28
28
coverage . Add ( new XAttribute ( "branch-rate" , ( summary . CalculateBranchCoverage ( result . Modules ) . Percent / 100 ) . ToString ( CultureInfo . InvariantCulture ) ) ) ;
29
29
coverage . Add ( new XAttribute ( "version" , "1.9" ) ) ;
30
- coverage . Add ( new XAttribute ( "timestamp" , ( ( int ) ( DateTime . UtcNow - new DateTime ( 1970 , 1 , 1 ) ) . TotalSeconds ) . ToString ( CultureInfo . InvariantCulture ) ) ) ;
30
+ coverage . Add ( new XAttribute ( "timestamp" , ( int ) ( DateTime . UtcNow - new DateTime ( 1970 , 1 , 1 ) ) . TotalSeconds ) ) ;
31
31
32
32
XElement sources = new XElement ( "sources" ) ;
33
33
sources . Add ( new XElement ( "source" , string . Empty ) ) ;
@@ -51,7 +51,7 @@ public string Report(CoverageResult result)
51
51
@class . Add ( new XAttribute ( "filename" , document . Key ) ) ;
52
52
@class . Add ( new XAttribute ( "line-rate" , ( summary . CalculateLineCoverage ( cls . Value ) . Percent / 100 ) . ToString ( CultureInfo . InvariantCulture ) ) ) ;
53
53
@class . Add ( new XAttribute ( "branch-rate" , ( summary . CalculateBranchCoverage ( cls . Value ) . Percent / 100 ) . ToString ( CultureInfo . InvariantCulture ) ) ) ;
54
- @class . Add ( new XAttribute ( "complexity" , summary . CalculateCyclomaticComplexity ( cls . Value ) . ToString ( CultureInfo . InvariantCulture ) ) ) ;
54
+ @class . Add ( new XAttribute ( "complexity" , summary . CalculateCyclomaticComplexity ( cls . Value ) ) ) ;
55
55
56
56
XElement classLines = new XElement ( "lines" ) ;
57
57
XElement methods = new XElement ( "methods" ) ;
@@ -81,15 +81,15 @@ public string Report(CoverageResult result)
81
81
{
82
82
var branches = meth . Value . Branches . Where ( b => b . Line == ln . Key ) . ToList ( ) ;
83
83
var branchInfoCoverage = summary . CalculateBranchCoverage ( branches ) ;
84
- line . Add ( new XAttribute ( "condition-coverage" , $ "{ branchInfoCoverage . Percent } % ({ branchInfoCoverage . Covered } /{ branchInfoCoverage . Total } )") ) ;
84
+ line . Add ( new XAttribute ( "condition-coverage" , $ "{ branchInfoCoverage . Percent . ToString ( CultureInfo . InvariantCulture ) } % ({ branchInfoCoverage . Covered . ToString ( CultureInfo . InvariantCulture ) } /{ branchInfoCoverage . Total . ToString ( CultureInfo . InvariantCulture ) } )") ) ;
85
85
XElement conditions = new XElement ( "conditions" ) ;
86
86
var byOffset = branches . GroupBy ( b => b . Offset ) . ToDictionary ( b => b . Key , b => b . ToList ( ) ) ;
87
87
foreach ( var entry in byOffset )
88
88
{
89
89
XElement condition = new XElement ( "condition" ) ;
90
90
condition . Add ( new XAttribute ( "number" , entry . Key ) ) ;
91
91
condition . Add ( new XAttribute ( "type" , entry . Value . Count ( ) > 2 ? "switch" : "jump" ) ) ; // Just guessing here
92
- condition . Add ( new XAttribute ( "coverage" , $ "{ summary . CalculateBranchCoverage ( entry . Value ) . Percent } %") ) ;
92
+ condition . Add ( new XAttribute ( "coverage" , $ "{ summary . CalculateBranchCoverage ( entry . Value ) . Percent . ToString ( CultureInfo . InvariantCulture ) } %") ) ;
93
93
conditions . Add ( condition ) ;
94
94
}
95
95
0 commit comments