Skip to content

Commit 85551b8

Browse files
updates
1 parent ea0c1d6 commit 85551b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/coverlet.core/Reporters/CoberturaReporter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public string Report(CoverageResult result)
2727
coverage.Add(new XAttribute("line-rate", (summary.CalculateLineCoverage(result.Modules).Percent / 100).ToString(CultureInfo.InvariantCulture)));
2828
coverage.Add(new XAttribute("branch-rate", (summary.CalculateBranchCoverage(result.Modules).Percent / 100).ToString(CultureInfo.InvariantCulture)));
2929
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));
3131

3232
XElement sources = new XElement("sources");
3333
sources.Add(new XElement("source", string.Empty));
@@ -51,7 +51,7 @@ public string Report(CoverageResult result)
5151
@class.Add(new XAttribute("filename", document.Key));
5252
@class.Add(new XAttribute("line-rate", (summary.CalculateLineCoverage(cls.Value).Percent / 100).ToString(CultureInfo.InvariantCulture)));
5353
@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)));
5555

5656
XElement classLines = new XElement("lines");
5757
XElement methods = new XElement("methods");
@@ -81,15 +81,15 @@ public string Report(CoverageResult result)
8181
{
8282
var branches = meth.Value.Branches.Where(b => b.Line == ln.Key).ToList();
8383
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)})"));
8585
XElement conditions = new XElement("conditions");
8686
var byOffset = branches.GroupBy(b => b.Offset).ToDictionary(b => b.Key, b => b.ToList());
8787
foreach (var entry in byOffset)
8888
{
8989
XElement condition = new XElement("condition");
9090
condition.Add(new XAttribute("number", entry.Key));
9191
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)}%"));
9393
conditions.Add(condition);
9494
}
9595

0 commit comments

Comments
 (0)