Carl Vuorinen has posted a tutorial about getting SonarQube to run on your codebase (with the help of Jenkins). SonarQube runs statics on your application including lines of code, number of classes, enforcement of coding standards and duplicated code.
n this second part of my Continous Integration setup I will detail the steps required to install SonarQube (previously called just Sonar, renamed to SonarQube with 3.6 release just a few days ago) and integrate it with the Jenkins server from the previous post so SonarQube will run a daily analysis of our PHP project. In the previous post I covered the installation of Jenkins on a CentOS server and integrated it with GitHub, so if you do not have Jenkins set up you might want to start there.
He talks a bit about what SonarQube can do for you and the features it includes as well as links to a screencast and live demo. From there he gets into the setup and configuration, broken down into steps:
- Installing SonarQube (with yum)
- Creating the MySQL database it needs
- Installing SonarQube Runner
- Installing PHP environment for SonarQube
- Integrating SonarQube with Jenkins
There's a quick note at the end about some things that can be done to optimize and clean up the installation too.