Continuous integration/SonarQube Scanner

wmf-sonar-scanner
The Code_Health_Group/projects/Code_Health_Metrics working group maintains an integration with the static analysis code tool, SonarQube.

To use it, run "check experimental" on MediaWiki core or any extension (example). The link to the generated report will be output in the build logs for the "wmf-sonar-scanner" job.

You can read more about in this blog post.

Coming soon:


 * post a comment in gerrit with the link to the SonarQube analysis report
 * ingest code coverage from JS/PHP/Java projects
 * Other ideas: https://phabricator.wikimedia.org/project/view/3621/

Debugging
You can test out the scanner locally, if you have an API key.

The following example is useful if you want to make modifications to run.sh and copy them into the container without rebuilding the Docker image.

Then you can execute

Sonar Lint
The SonarLint tool is a useful complement to SonarQube, as it runs many of the same checks locally in your IDE.