SonarQube provides a plugin for IntelliJ (and Eclipse as well) which is a great tool to perform dev-box code analysis before committing or checking-in your changes. It gives the developers a chance to check and make sure they aren’t introducing any new defects or technical debt in the code they have added or modified. Here’s how to set up the plugin and get going.
Install SonarQube IntelliJ Plugin
- Launch IntelliJ and go to File -> Settings -> Plugins
- Search for ‘sonarqube’ and install the plugin
Setting up SonarQube plugin Capture one m1 apple.
SonarQube is a central server that processes full analyses (triggered by the various SonarQube Scanners). Its purpose is to give a 360° vision of the quality of your code base. For this, it analyzes all the source lines of your project on a regular basis. Sonarqube Use Sonarqube in IntelliJ / PhpStorm / etc. Nico Maas Docker, Product Specific 3. October 2016 19. September 2016 1 Minute. Sonarqube is cool, as the generated results can not only be viewed via the web interface, but also via an plugin in IntelliJ or other Jetbrains IDEs.
- In IntelliJ go to File -> Settings -> Other Settings -> SonarQube
- Add details about the sonar server here. The plugin will use this to download the quality profile/analyzers etc.
- This plugin executes the analysis in preview mode where no data is pushed to the server.
Associate your IntelliJ project with Sonar project
- Right click on the project in IntelliJ and select 'Associate with SonarQube…'
- Search for the sonar project and select it
Running the analysis
Idea Sonarqube
- Make your code changes
- Right click on the project and select Analyze -> Run Inspection by Name…
- In the search box type 'Sonarqube' and select 'SonarQube Issue' from the result list
- In the 'Inspection Scope' dialog, select Custom Scope and set its value to Changed Files. This will ensure that the analysis is run on the files modified by you.
Sonar Phpstorm
- The plugin will run the preview analysis and display the results in the inspection tab. The inspection shows issues in two files which were modified before the analysis.