First of all, here is what I’m using:
- Sonarqube: Developer Edition - Version 9.3 (build 51899)
- Scanner: 4.6.0
- Language: PHP
- Test and Coverage: PhpUnit 9.5.20
The issue is that the lines to cover of a project change when I add de coverage.xml to the sonar-project.properties file of my project like this:
I really don’t know if it’s really an issue or just an expected behavior I don’t understand. I experienced other dramatic changes in the LoC with other things like rising a version of a thrid party library on my composer.json but I think all are related to the coverage.xml file.
When I add the coverage results to the tests, the lines to cover metric rises, in this particular case, from 6229 lines to cover and 0 covered lines (no coverage.xml added to the scanner) to 11054 lines to cover and 2761 covered lines (with the coverage.xml added to the scanner). I want to remark that the only change is add that particular line I said before to the sonar-project.properties