Skip to content

Commit 7b1923c

Browse files
committed
improved generated package names when names missing
1 parent 1699cd4 commit 7b1923c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CodeCoverageSummary/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private static CodeSummary ParseTestResults(string filename, CodeSummary summary
217217
{
218218
CodeCoverage packageCoverage = new()
219219
{
220-
Name = string.IsNullOrWhiteSpace(item.Attribute("name")?.Value) ? $"Package {i}" : item.Attribute("name").Value,
220+
Name = string.IsNullOrWhiteSpace(item.Attribute("name")?.Value) ? $"{Path.GetFileNameWithoutExtension(filename)} Package {i}" : item.Attribute("name").Value,
221221
LineRate = double.Parse(item.Attribute("line-rate")?.Value ?? "0"),
222222
BranchRate = double.Parse(item.Attribute("branch-rate")?.Value ?? "0"),
223223
Complexity = double.Parse(item.Attribute("complexity")?.Value ?? "0")

0 commit comments

Comments
 (0)