Coverage Percentage Differences – IntelliJ IDEA vs SonarCloud

I would like to clarify an important observation about test coverage discrepancies when comparing results from IntelliJ IDEA and SonarCloud .

Intellij-TestCoverage SonarQube
73 35
  1. Why Are Coverage Results Different in IntelliJ, Eclipse, and SonarQube?
  2. Is there official guidance on how to align SonarQube coverage with IDE-level results like Eclipse or IntelliJ?
  3. Can SonarQube be configured to include test class coverage (like IDE), or is this intentionally excluded?
  4. What is the best practice to report consistent and meaningful coverage across development tools and CI?

Thanks

Hi,

Welcome to the community!

The main question here is what coverage reports you’re feeding in to SonarQube analysis. Is SonarQube able to read everything that IntelliJ is?

Beyond that, you may still see some discrepancies that this dusty-but-still-relevant blog post should help you understand.

 
HTH,
Ann