Question

I'm using the opensource tool ReportGenerator to show the details of the XML output generated from using OpenCover and mstest. For one particular project I see the following metrics:

  • Covered Lines: 3611
  • Uncovered lines: 3587
  • Coverable lines: 7198
  • Total lines: 35609

Ok, Covered + Uncovered = Coverable lines and this makes sense. However Total lines is significantly above this value and I want to know what constitutes or defines all these additional lines of code to make up Total lines.

The documentation for ReportGenerator is sparse at best, but I would guess it encompasses commenting, whitespace, things like using statements (for importing namespaces), declarations of methods, classes, etc. that are not testable. However I'm not sure, and I plan on using this tool for a lot of projects and need to be able to explain what's behind this number.

Does anyone know or can explain what the Total lines value is comprised of beyond the total testable lines?

Was it helpful?

Solution

According to Codefile.cs it is

string[] lines = System.IO.File.ReadAllLines(this.Path); 
this.TotalLines = lines.Length; 

and then these are aggregated at the class/assembly level

However if they are based on files recorded in the PDB then it will not be all your source files there are no sequence points (i.e. a place you can put a break point) that require the file to be recorded in the PDB.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top