CodeCoverageSummary icon indicating copy to clipboard operation
CodeCoverageSummary copied to clipboard

Method Coverage

Open dberry-rcs opened this issue 4 years ago • 2 comments

Feature Request

It would also be useful to have Method coverage reported by the tool.

Expected Behaviour

There would be an additional column that reports Method coverage

Additional Context

Similar to what is printed out by dotnet test:

Calculating coverage result... Generating report './bin/test-results/coverage.cobertura.xml'

+------------------+--------+--------+--------+ | Module | Line | Branch | Method | +------------------+--------+--------+--------+ | RCS.Libs.ArgUtil | 93.82% | 95.83% | 92.3% | +------------------+--------+--------+--------+

+---------+--------+--------+--------+ | | Line | Branch | Method | +---------+--------+--------+--------+ | Total | 93.82% | 95.83% | 92.3% | +---------+--------+--------+--------+ | Average | 93.82% | 95.83% | 92.3% | +---------+--------+--------+--------+

dberry-rcs avatar Aug 02 '21 15:08 dberry-rcs

The Cobertura format doesn't include a method coverage value.

It would be possible while looping through the packages in the coverage file to loop through classes, loop through their methods and count the number of methods with line-rate > 0.0 and total number of methods. Method coverage could then be calculated as the ratio of line-rate > 0.0 : total methods. For a large project this could be slow so would be optional.

irongut avatar Sep 27 '21 23:09 irongut

Optional would be fine.

dberry-rcs avatar Oct 06 '21 21:10 dberry-rcs