Sonarqube code coverage for php project is 0

My configuaration as follows-
SonarQube plugins:

  • SonarPython 1.14.0.3086 (python)
  • SonarCSS 1.1.1.1010 (cssfamily)
  • GitHub Authentication for SonarQube 1.5.0.870 (authgithub)
  • JaCoCo 1.0.2.475 (jacoco)
  • SonarGo 1.1.1.2000 (go)
  • SonarKotlin 1.5.0.315 (kotlin)
  • Svn 1.9.0.1295 (scmsvn)
  • SonarJS 5.2.1.7778 (javascript)
  • SonarRuby 1.5.0.315 (ruby)
  • SonarScala 1.5.0.315 (sonarscala)
  • SonarC# 7.15.0.8572 (csharp)
  • SonarJava 5.13.1.18282 (java)
  • LDAP 2.2.0.608 (ldap)
  • SonarHTML 3.1.0.1615 (web)
  • Git 1.8.0.1574 (scmgit)
  • SonarFlex 2.5.1.1831 (flex)
  • SonarXML 2.0.1.2020 (xml)
  • SAML 2.0 Authentication for SonarQube 1.1.0.181 (authsaml)
  • SonarPHP 3.2.0.4868 (php)
  • SonarTS 1.9.0.3766 (typescript)
  • SonarVB 7.15.0.8572 (vbnet)
    Global server settings:
  • sonar.core.id=******
  • sonar.core.startTime=******
  • sonar.php.coverage.reportPaths=src/app/coverage.xml
    Project server settings:
  • sonar.php.coverage.reportPaths=coverage.xml
    Project scanner properties:
  • sonar.host.url=******
  • sonar.login=******
  • sonar.projectBaseDir=/home/jenkins/workspace/PHP-Pipeline/src/app
  • sonar.projectKey=om-common
  • sonar.scanner.app=ScannerCLI
  • sonar.scanner.appVersion=4.6.2.2472
  • sonar.sourceEncoding=US-ASCII
  • sonar.sources=.
  • sonar.working.directory=/home/jenkins/workspace/PHP-Pipeline/src/app/.scannerwork

We have placed coverage.xml under src/app/ in our scm.

however i’m getting code coverage 0 for PHP project

Hey there.

You are using a very old version of SonarQube. Make sure you upgrade to at least v8.9 LTS (or go as far as v9.7) as let us know if you’re still facing an issue.

Hi @Colin
Thank you for update.
we are using community edition screenshot attached. I can’t upgrade sonarqube now.


is this version compatible for php code coverage?
our configuration is Gitlab->jenkins->sonarqube
Please help me with this

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.9 → 8.9.10 → 9.7.1 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your issue persists after upgrade, please come back to us.

Hi @Colin
Can you please confirm, Is “sonar.php.tests.reportPath” mandatory attribute in order to generate the code coverage?
If yes, how we can generate that report?
Do we need to write this report(test cases) manually?

Hey there.

We can’t provide support in this community for an EOL version of SonarQube, which is why I’m pushing you to upgrade first of all. :slight_smile:

And, you can find more details about PHP Test Coverage in the documentation, including an example of how to generate the report and pass it to sonar.php.coverage.reportPaths