From Designite’s version 1.15.0 onwards, it is possible to bridge Designite and SonarQube with the help of the Designite plug-in for SonarQube. The plug-in helps you import the smells detected by Designite in SonarQube. This text elaborates the steps involved in integrating Designite with SonarQube.
Download the latest version of Designite (from http://www.designite-tools.com/download-2/) and install it. You require version 1.15.0 (or later) of Designite that comes with Designite plug-in for SonarQube.
Install and configure SonarQube
- Download SonarQube (from http://www.sonarqube.org/downloads/) and install
- Download SonarQube scanner for MSBuild, install, and configure it (find out more information from here: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild).
Refer this web page for more help on setting up SonarQube for analyzing C# projects (https://docs.sonarqube.org/pages/viewpage.action?pageId=1441900).
Install Designite plug-in
You can find the plug-in sonar-designite-plugin-X.jar (where X refers to version of the Designite plug-in) in a sub-folder named SonarDesignitePlugin within installation folder of Designite. You need to put this plug-in jar file to $SonarQubeRootFolder$\extentions\plugins folder.
Configure SonarQube server for Designite plug-in
- Start the SonarQube server. You can do it by executing the relevant batch file in the bin folder of SonarQube installation. For instance, you may run $SonarQubeRootFolder$\bin\windows-x86-64\StartSonar.bat if you are running 64-bit Windows.
- Open http://localhost:9000/ in your browser and login as the admin.
- Go to Administration and select Designite from the categories listed on the left side.
- Provide inputs for the following two configuration settings:
- Designite execution timeout: The time in minutes after which the execution of Designite will be stopped by the SonarQube. The default value for this setting is 10 minutes.
- Path to DesigniteConsole.exe: You need to provide an absolute path of the DesigniteConsle.exe (such as C:\Program Files (x86)\Designite\Designite\DesigniteConsole.exe).
- Save the changes by clicking on Save Designite Settings.
- Click on Rules tab (with admin privilege) and select “Designite C#” from Repository option on the left side. Click on Bulk Change -> Activate in.. and then select “Sonar way – C#” to activate the rules in SonarQube’s C# profile.
That’s it. You are now ready to analyze your project with SonarQube.
After the successful completion of the analysis, the smells (both design and implementation smells) detected by Designite will be present along with any other violated rule within SonarQube.