jacoco-report icon indicating copy to clipboard operation
jacoco-report copied to clipboard

Not only support instructions coverage, but also line coverage

Open sgc109 opened this issue 2 years ago • 3 comments

It seems like jacoco-report using instructions counters in a report Jacoco generated to calculate the entire coverage.

Can't I change this to use line counters?

sgc109 avatar Dec 30 '22 07:12 sgc109

Sadly there is no way to configure this right now. But I am thinking of adding an option to configure this. I will add more info here soon.

thsaravana avatar Jul 22 '23 09:07 thsaravana

I am rethinking again how we can do this effectively. As far as I checked, INSTRUCTIONS seems to be more accurate than LINE counter. We have the LINE counter for File, Module and Project level, but not at Line level. For each Line, we have INSTRUCTION and BRANCH but not Line. So how do we determine if a Line is covered or not? For now, we depend on INSTRUCTION. But this also is not fully correct. We can have a Line that has a BRANCH but no INSTRUCTION.

🤔

thsaravana avatar Jul 30 '23 16:07 thsaravana

@thsaravana Jacoco itself reports instruction & branch coverage, so I suggest adding support for branch coverage, rather than line coverage. As you said, if it was accurate, I'd assume Jacoco itself will visualize it anyways!

gokhan-oner avatar Aug 24 '23 18:08 gokhan-oner

Closing this as we will pursue adding Branch Coverage as part of #67.

instrap avatar Sep 20 '24 19:09 instrap