Skip to content

Commit 89fc5b1

Browse files
committed
Fixed #92: Improved total lines metric on summary page
1 parent 1598611 commit 89fc5b1

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed

Readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ For further details take a look at LICENSE.txt.
6161

6262
CHANGELOG
6363

64+
2.5.9.0
65+
66+
* Fix: Issue #92: Improved total lines metric on summary page
67+
6468
2.5.8.0
6569

6670
* New: Issue #90: Added report type "HtmlInline"

ReportGenerator.Reporting/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.5.8.0")]
36-
[assembly: AssemblyFileVersion("2.5.8.0")]
35+
[assembly: AssemblyVersion("2.5.9.0")]
36+
[assembly: AssemblyFileVersion("2.5.9.0")]
3737

3838
[assembly: CLSCompliant(true)]

ReportGenerator/Parser/Analysis/SummaryResult.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,31 @@ internal SummaryResult(IEnumerable<Assembly> assemblies, string usedParser, bool
7272
/// Gets the number of total lines.
7373
/// </summary>
7474
/// <value>The total lines.</value>
75-
public int? TotalLines => this.Assemblies.Sum(a => a.TotalLines);
75+
public int? TotalLines
76+
{
77+
get
78+
{
79+
var processedFiles = new HashSet<string>();
80+
int? result = null;
81+
82+
foreach (var assembly in this.Assemblies)
83+
{
84+
foreach (var clazz in assembly.Classes)
85+
{
86+
foreach (var file in clazz.Files)
87+
{
88+
if (!processedFiles.Contains(file.Path) && file.TotalLines.HasValue)
89+
{
90+
processedFiles.Add(file.Path);
91+
result = result.HasValue ? result + file.TotalLines : file.TotalLines;
92+
}
93+
}
94+
}
95+
}
96+
97+
return result;
98+
}
99+
}
76100

77101
/// <summary>
78102
/// Gets the coverage quota of the class.

ReportGenerator/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
3434
// übernehmen, indem Sie "*" eingeben:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("2.5.8.0")]
37-
[assembly: AssemblyFileVersion("2.5.8.0")]
36+
[assembly: AssemblyVersion("2.5.9.0")]
37+
[assembly: AssemblyFileVersion("2.5.9.0")]
3838
[assembly: NeutralResourcesLanguageAttribute("en-US")]
3939

4040
[assembly: CLSCompliant(true)]

ReportGeneratorTest/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
//
3232
// You can specify all the values or you can default the Revision and Build Numbers
3333
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("2.5.8.0")]
35-
[assembly: AssemblyFileVersion("2.5.8.0")]
34+
[assembly: AssemblyVersion("2.5.9.0")]
35+
[assembly: AssemblyFileVersion("2.5.9.0")]
3636
[assembly: NeutralResourcesLanguageAttribute("en-US")]

0 commit comments

Comments
 (0)