Why do overall coverage reported by SonarQube vs JaCoCo differ


(Biz786) #1

Hello Ann,
As requested , here is another thread for my question!
You mentioed in the last thread…

Specifically, for files that are omitted from the coverage report, analysis calculates how many executable (and therefore coverable ) lines are in the file, and adds that to the denominator when overall coverage percentage is calculated. This is why you may be seeing different overall coverage reported by SonarQube vs JaCoCo.

Can you please expand upon how the coverage reports of SonarQube vs JaCoCo may differ? Cause i know my boss is going to notice that and ask me :slight_smile:


(G Ann Campbell) #2

Hi,

If they differ, the overall coverage reported by SonarQube will be lower, for the reason you quoted.

 
:slight_smile:
Ann


(Biz786) #3

hi Ann ,in the quote it says “for files that are omitted”. Does this mean that if i have NOT omitted any files ,in that case the coverage report from Jacoco and Sonar would/should be same ??


(G Ann Campbell) #4

Yep. That’s what it means. :smile: