Search code examples
sonarqubesonar-runnerjenkins-php

Report reuse for PHP projects in Sonarqube 4.2


I have a Jenkins job running for my project that generates reports for the following tools:

  • phpcpd
  • pdepend
  • phpcs
  • phpmd
  • phpunit (unit & integration tests)

I would like to have Sonar-runner analyze these reports, especially for integration tests, which the runner does not execute.

Is this still possible in Sonar 4.2? If so, what parameters in sonar-project.properties controls report re-use for the above listed tools?

I can't find documentation on how to get to sonar-runner to re-use these reports. The only documented parameters seem to be sonar.php.tests.reportPath and sonar.php.tests.coverage.reportPath. But these only relate to unit tests.

The only information I could find on this is this blog post. I've tried the parameters listed there and they appear to have no effect.


Solution

  • Indeed since version 2.0, the SonarQube PHP plugin doesn't rely anymore on external tools like pdepend, phpcs, phpcpd and phpmd. The only remaining external dependency is on phpunit.