eclipseeclemmasonarqube5.3

Code Coverage of a java file is not reflected neither in Sonar nor in Eclipse


SonarQube5.3 displays the coverage of a java file as 0.0% even though there exist a test file for it. This test file is not included in SonarExclusions.json. Also, in eclipse which uses Eclemma tool for code coverage highlights the source with red color indicating the source code is not covered completely.

What must be the reason for the coverage not being reflected?


Solution

  • This can be helpful.

    If this is correct, then SonarQube might require something else like cobertura or jacoco to provide it the test coverage. Please try adding such a analysis tool and try running Sonar again.