/sonar-status-image

Generates an image showing unit test coverage from SonarQube suitable for use in a README.md file.

Primary LanguagePHP

sonar-status-image

Renders the unit test coverage as reported by SonarQube in an image suitable for use in a Github-style README.md.

Motivation

I needed a way to show code coverage in the README for glusterfs-java-filesystem similar to the TravisCI build status image. I couldn't find any existing solution, so I hacked this together.

Ideally the image would be generated by SonarQube directly, and look a lot nicer than what this simple PHP script produces. I am considering writing a widget plugin for SonarQube to do this.

Use

[![Test coverage](http://your.server.addr/sonar-status-image/index.php?resource=your.project.group:your-project-name)](http://your.sonar.addr/dashboard/index/your.project.group:your-project-name)

                  ^^^^^^^ url to this project's index.php file ^^^^^^^          ^^^^^^^^^ sonar project ID ^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^^^^ link to sonar project page ^^^^^^^^^^^^^^^^^^^^^^^^

Example

Test coverage

Acknowledgements

Thanks to c.bavota for the easy to use example of turning text into an image with GD