SonarQube is an open platform to manage code quality. It covers following aspects of a project
- Architecture and Design
- Duplication
- Unit Testing
- Complexity
- Potential Bugs
- Coding Rules
- Comments
There are about 20 plugins available for SonarCube to analyze most of the common programming languages such as Java, C#, C++ etc..
Analyzing a Project with SonarQube Runner
Prerequisites
Prerequisites
- Java should be installed on your machine
- SonarQube download sonarqube-5.0.1.zip
- SonarQube Tunner download sonar-runner-dist-2.4.zip
Extract both SonarQube and SonarQube runner to desired locations. In my machine I've extracted SonarQube to
/home/thusitha/Training/sonarqube-5.0
and SonarQube Runner to
/home/thusitha/Training/sonar-runner-2.4
Inside the SonarQube you can find there are many directories for each platform. Find the matching platform based on your OS.
e.g.
If you are using ubuntu x64 bit OS then you must go to linux-x86-64 directoty
Go to the particular directory through the console and run the Sonar script to start the Sonar sever
Go to the particular directory through the console and run the Sonar script to start the Sonar sever
To start the server run the sonar script in the directory
In Linux
sh sonar.sh console
In Windows
StartSonar.bat
In Linux
sh sonar.sh console
In Windows
StartSonar.bat
Sonar Dashboard http://localhost:9000/
Now go to the project root folder that you want to analyze and create a file and name it as
Then we can run SonarQube Runner to analyze the project using this file. To do that run the following command from the location where the created file resides.
On Linux
sonar-runner
On Windows
sonar-runner.bat
No comments:
Post a Comment