Skip to content

Commit

Permalink
Fixed #92: Improved total lines metric on summary page
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpalme committed Jul 3, 2017
1 parent 1598611 commit 89fc5b1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ For further details take a look at LICENSE.txt.

CHANGELOG

2.5.9.0

* Fix: Issue #92: Improved total lines metric on summary page

2.5.8.0

* New: Issue #90: Added report type "HtmlInline"
Expand Down
4 changes: 2 additions & 2 deletions ReportGenerator.Reporting/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.8.0")]
[assembly: AssemblyFileVersion("2.5.8.0")]
[assembly: AssemblyVersion("2.5.9.0")]
[assembly: AssemblyFileVersion("2.5.9.0")]

[assembly: CLSCompliant(true)]
26 changes: 25 additions & 1 deletion ReportGenerator/Parser/Analysis/SummaryResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,31 @@ internal SummaryResult(IEnumerable<Assembly> assemblies, string usedParser, bool
/// Gets the number of total lines.
/// </summary>
/// <value>The total lines.</value>
public int? TotalLines => this.Assemblies.Sum(a => a.TotalLines);
public int? TotalLines
{
get
{
var processedFiles = new HashSet<string>();
int? result = null;

foreach (var assembly in this.Assemblies)
{
foreach (var clazz in assembly.Classes)
{
foreach (var file in clazz.Files)
{
if (!processedFiles.Contains(file.Path) && file.TotalLines.HasValue)
{
processedFiles.Add(file.Path);
result = result.HasValue ? result + file.TotalLines : file.TotalLines;
}
}
}
}

return result;
}
}

/// <summary>
/// Gets the coverage quota of the class.
Expand Down
4 changes: 2 additions & 2 deletions ReportGenerator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.8.0")]
[assembly: AssemblyFileVersion("2.5.8.0")]
[assembly: AssemblyVersion("2.5.9.0")]
[assembly: AssemblyFileVersion("2.5.9.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]

[assembly: CLSCompliant(true)]
Expand Down
4 changes: 2 additions & 2 deletions ReportGeneratorTest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.5.8.0")]
[assembly: AssemblyFileVersion("2.5.8.0")]
[assembly: AssemblyVersion("2.5.9.0")]
[assembly: AssemblyFileVersion("2.5.9.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]

0 comments on commit 89fc5b1

Please sign in to comment.