Reputation: 904
Maybe this is due to my own misunderstanding of what in Sonar is being analyzed, but at the Component level Sonar is reporting a much higher percentage of code coverage than what appears to be possible given the results at the package level. May I point your attention to the attached screenshot... See: https://i.sstatic.net/yCnms.png Any ideas?
Upvotes: 3
Views: 3174
Reputation: 345
The screenshot only shows code coverage for packages
com.gfs.transportation.transprointegration.filewatcher
com.gfs.transportation.transprointegration.filewatcher.impl
If the Code coverage for the below components are 100%
com.gfs.transportation.transprointegration
com.gfs.transportation
com.gfs
com
Then total coverage will be (87.9 + 89.2 + 100 + 100 + 100 + 100) /600 which equals 96.183%
I am thinking if a package has no classes under it then the coverage of the package is 100%
Upvotes: 2
Reputation: 8378
It all depends on the size of the classes and how they contribute to the coverage of the module as a whole
The coverage overall is 60.3% (609/1010)
But if
Now the coverage overall is 89.7% (906/1010)
Then you have to take into account of whether the coverage for filewatcher also includes the coverage metrics of filewatcher.impl - which I suspect it might do.
Finally you haven't mentioned if the number you are displaying is branch/line or a combination of both which the link provided in the comment implies is possible, if the latter then the combinations involved start to make my head hurt.
Upvotes: 4