sonarqube plugin usage in studio for code pre commit analysis

8
SonarQube plugin usage in Studio for code pre commit quality analysis By Ramakrishna Narkedamilli

Upload: ramakrishna-narkedamilli

Post on 12-Apr-2017

324 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Sonarqube plugin usage in studio for code pre commit analysis

SonarQube plugin usage in Studio for code pre commit quality analysis

By Ramakrishna Narkedamilli

Page 2: Sonarqube plugin usage in studio for code pre commit analysis

In this presentation will see the below things

How to install Sonarqube plugin in Eclipse Stuido

Integrating with SonarQube server

Run the analysis for the code issues and quality

Page 3: Sonarqube plugin usage in studio for code pre commit analysis

Prerequisites:

SonarQube server with required Project (Already Analysed, this can be done through jenkins build or Ant build with Sonar ANT plugin)

SonarQube plugin Software for Eclipse studio. This can be download from below https://bintray.com/artifact/download/sonarsource/Distribution/org.sonar.ide.eclipse.site-3.5.0.20150804-1512-RELEASE.zip

Alternatively , You can install the plugin from Eclipse Market place or using Install new software option (using update site http://downloads.sonarsource.com/eclipse/eclipse/)

Page 4: Sonarqube plugin usage in studio for code pre commit analysis

Install Sonar Plugin in Eclipse:

In Eclipse Click on Help --> Install New Software --> Add --> Local --> Select the above mentioned folder -- > ok --> Enter the name --> ok

Select the above mentioned options and click on next then agree the licence terms then click on finish.

Once installation is done, it will show pop up for eclipse restart then click ok. Once Eclipse Restarted then sonar plugin is ready to integrate with sonar server.

Page 5: Sonarqube plugin usage in studio for code pre commit analysis

Integration with sonarQube server: Select window --> preferences --> SonarQube --> Servers --> Add

Enter the Sonar Server Url and username, Password values then check the connection using Test connection button then click on Finish.

Page 6: Sonarqube plugin usage in studio for code pre commit analysis

Right click on Java project and select Configure --> Associate With Sonar

Enter the SonarQube project name which you want to analyze ( already created and analyzed in Sonar server ). When you start typing It will automatically display available project names select appropriate one.

Click on Finish. Now at this point your Eclipse project is integrated with SonarQube server project

Page 7: Sonarqube plugin usage in studio for code pre commit analysis

Run the Analysis:

Right click on code Project --> SonarQube --> Analyze, then it will run and gets the analysis from server.

Open any file that has errors . Then it will show errors related to that specific file Fix the errors and save Then again click on Java Project --> SonarQube --> Analyze. So It will re run the

analysis and gets the results. Ideally if you fix the errors It will reduce the no of issues.it.

Page 8: Sonarqube plugin usage in studio for code pre commit analysis

THANKS YOU By Ramakrishna Narkedamilli