How to get the total number of lines from the cobertura xml report?

Jun 23 at 9:53 AM

The current coverage element just mentions the total coverage but there's no way to get the absolute number of lines that have been covered (or not covered).

How could I retrieve this easily?

Jul 5 at 7:00 AM

Cobertura is a XML format for Cobertura Jenkins plugin and so this information cannot be added directly to the XML.

You can compute it easily by counting the tag line.
  • If hits attribute is "1" (for example <line number="5" hits="1"/>) then the line is covered.
  • If hits attribute is "0" (for example <line number="5" hits="0"/>) then the line is not covered.
I hope this will help,