We have connected SonarQube with Github and amongst the things we require is Code Coverage.
We are using jacoco for report generation and SonarQube Developer Edition Version 7.7 (build 23042) for a multi-module, java, maven-built project.
Current status is:
- Analysis works ok,
- covers jUnits and ITs
- master branch is scanned correctly
PR Code Coverage analysis shows files that were not part of the PR at all. Meaning the developer did not alter them.
Such false positives usually are recently changes classes but we have seen older classes as well, that haven’t changed in months.
Code Coverage is reported correctly, what is wrong is having a list of 10-15 .java classes unrelated to your changes and having to analyse them to understand what is happening.
Any advice or redirection to documentation is appreciated.
Worst case scenario, can we mark such reported files as “False Positive” to avoid seeing them in the report and calculating accurately the Code Coverage %?