mirror of
https://github.com/irongut/CodeCoverageSummary.git
synced 2026-05-20 08:50:14 +02:00
added overall complexity
This commit is contained in:
@@ -27,6 +27,8 @@ namespace CodeCoverageSummary
|
|||||||
|
|
||||||
public int BranchesValid { get; set; }
|
public int BranchesValid { get; set; }
|
||||||
|
|
||||||
|
public int Complexity { get; set; }
|
||||||
|
|
||||||
public List<CodeCoverage> Packages { get; set; }
|
public List<CodeCoverage> Packages { get; set; }
|
||||||
|
|
||||||
public CodeSummary()
|
public CodeSummary()
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ namespace CodeCoverageSummary
|
|||||||
if (o.Format.Equals("text", StringComparison.OrdinalIgnoreCase))
|
if (o.Format.Equals("text", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
summaryText.AppendLine($"Line Rate = {summary.LineRate * 100:N0}%, Lines Covered = {summary.LinesCovered} / {summary.LinesValid}")
|
summaryText.AppendLine($"Line Rate = {summary.LineRate * 100:N0}%, Lines Covered = {summary.LinesCovered} / {summary.LinesValid}")
|
||||||
.AppendLine($"Branch Rate = {summary.BranchRate * 100:N0}%, Branches Covered = {summary.BranchesCovered} / {summary.BranchesValid}");
|
.AppendLine($"Branch Rate = {summary.BranchRate * 100:N0}%, Branches Covered = {summary.BranchesCovered} / {summary.BranchesValid}")
|
||||||
|
.AppendLine($"Complexity = {summary.Complexity}");
|
||||||
foreach (CodeCoverage package in summary.Packages)
|
foreach (CodeCoverage package in summary.Packages)
|
||||||
{
|
{
|
||||||
summaryText.AppendLine($"{package.Name}: Line Rate = {package.LineRate * 100:N0}%, Branch Rate = {package.BranchRate * 100:N0}%, Complexity = {package.Complexity}");
|
summaryText.AppendLine($"{package.Name}: Line Rate = {package.LineRate * 100:N0}%, Branch Rate = {package.BranchRate * 100:N0}%, Complexity = {package.Complexity}");
|
||||||
@@ -96,6 +97,8 @@ namespace CodeCoverageSummary
|
|||||||
select item;
|
select item;
|
||||||
summary.BranchesValid = int.Parse(branchesValid.First().Value);
|
summary.BranchesValid = int.Parse(branchesValid.First().Value);
|
||||||
|
|
||||||
|
summary.Complexity = 0;
|
||||||
|
|
||||||
// test coverage for individual packages
|
// test coverage for individual packages
|
||||||
var packages = from item in coverage.Descendants("package")
|
var packages = from item in coverage.Descendants("package")
|
||||||
select item;
|
select item;
|
||||||
@@ -110,6 +113,7 @@ namespace CodeCoverageSummary
|
|||||||
Complexity = int.Parse(item.Attribute("complexity").Value)
|
Complexity = int.Parse(item.Attribute("complexity").Value)
|
||||||
};
|
};
|
||||||
summary.Packages.Add(packageCoverage);
|
summary.Packages.Add(packageCoverage);
|
||||||
|
summary.Complexity += packageCoverage.Complexity;
|
||||||
}
|
}
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
|
|||||||
Reference in New Issue
Block a user