0

we use the following suite to analyse our .Net4 project:

  • Maven 2.2.1
  • Gallio 3.2.750
  • PartCover 4.0.20626
  • Sonar 2.9
  • Sonar C# Plugins Ecosystem 1.0

When we open the coverage report file (build with Maven/Gallio/Partcover) in PartCover Explorer we have some files with 100% of coverage and so a global coverage of 97%.

But in the sonar coverage browser we cannot see these files and then the calculation of global coverage is downed to 65%.

We try with NCover3 and we have the same behaviour.

Is it the normal behaviour? Is there any parameters to configure?

Updated to add OPs answer into question

We analyze the problem a little more. And in fact, it is not due to the 100% covered files, but the interfaces. Indeed, they are not analyzed by PartCover or NCover (no information present in the xml output) but they are included in the calculation of total coverage with Sonar. Is there a way to parameter this?

JoseK
  • 31,141
  • 14
  • 104
  • 131

1 Answers1

0

Interfaces have no code to instrument and as such you will not get any coverage data for them this applies to NCover, PartCover and OpenCover AFAIK. You only get coverage information when they are actually implemented.

The Sonar coverage browser is probably working on actual lines of code and not what was eventually turned into code; measured by number of sequence points (and branch points for NCover/OpenCover).

To exclude code like interfaces, enums and abstract methods, auto implemented properties etc etc - would require some hefty parsing and it would be language specific.

If you are after a code coverage metric go with what your coverage tool gives you and explain away the rest

Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56