Sonarqube overall coverage does not match jacoco report coverage

后端 未结 1 1058
太阳男子
太阳男子 2020-12-10 02:19

I have a multi-module Android project and I\'m seeing a discrepancy between the coverage that jacoco reports and what Sonarqube reports. The project is also a multi-flavor

相关标签:
1条回答
  • 2020-12-10 03:02

    As far as I can see branch coverage is the same: 40% in both cases, 15 uncovered.

    And comparison of "instructions" (shown in screenshot of JaCoCo report) with anything else is like comparison of apples and oranges - they don't represent the same thing. See http://www.eclemma.org/jacoco/trunk/doc/counters.html about counters that JaCoCo provides. And http://docs.sonarqube.org/display/SONAR/Metric+Definitions about what SonarQube shows. Instructions coverage is presented only in JaCoCo.

    "lines" ("27.1%" shown in screenshot of SonarQube) is not the same as "instructions": Single line of code usually contains many bytecode instructions. So for example if in total you have 100 instructions in 10 lines and cover 1 line with 20 instructions, then missed instructions 80%, but missed lines 90%.

    So all in all, there is no discrepancy or at least it is not shown on your screenshots.

    0 讨论(0)
提交回复
热议问题