Search code examples
sonarqubecode-coveragesonarqube-scantest-coverage

SonarQube coverage not showing up


Here's a screenshot so you better understand what I'm talking about: list of file metrics

Shouldn't all directories have coverage?

I have to say that those directories (without any number) are not covered by any tests but doesn't this mean that the coverage is 0%?


Solution

  • Yes, they should. But they don't because when no coverage engine reports any coverage on a file, is that because the file is executable but there are no tests on it, or because the file is not executable?

    SonarQube v6.2 will begin to address this by automatically forcing to 0 the coverage metrics on files not covered in the unit test reports. However, this behavior will only be fully enabled when each of the language plugins reports the "executable lines" for each file.

    So in practice the new behavior enabled in 6.2 (not released at this writing, but "soon") won't be truly available until the language plugins start supporting it. Probably over the next few months.