Introduction
In this article, we are going to explore the prerequisites needed for the Sonarqube installation and the small demo project along with test cases to configure with Sonarqube.
Overview
It's always a best practice while working on big projects to take code analysis and security into consideration. Sonarqube is one of the open-source platforms which we can use for continuous inspection of the code.
Below are a few points which sonarqube provide us in the form of analysis reports-
- It does static code analysis and gives us reports of bugs
- code smells
- code duplications
- vulnerabilities check
So, let us start with the step by step integration of it with Visual Studio 2019 edition.
Pre-requisites
Below are the tools I have used for this demo.
- Visual Studio 2019
- JDK 16.0.1
- Sonarqube 8.9
- Coverlet utility installed in Visual Studio
- SonarScanner v 5.2.1
Demo steps
Step 1. Installation of Sonarqube
- Visit https://www.sonarqube.org/downloads/ and download the community edition.

2: It will download Zip folder into your downloaded folder.
Before doing unzip, check the properties of the downloaded folder. It might be blocked for your machine so you need to unblock it and then unzip the folder.
Step 2. Installation of JDK-
If you want to use open JDK then visit - https://openjdk.java.net/install/ and download it locally.
Step 3. Visual Studio code
Now open Visual Studio and write down your C# project along with test cases.
Below is the project which I have created for demo configuration.

Step 4
Now, as you have your project ready, you need to install coverlet utility using the below steps-
- Go to Visual studio extension- Manage extension then search Coverlet Report and install it.
Step 5. Installation of SonarScanner
Go to developer command prompt and enter the below command-
dotnet tool install --global dotnet-sonarscanner
Step 6
Visit the SonaQube unzipped folder and open Wrapper config file and enter the JDK path manually before proceeding further.

Step 7
Now you need to start sonarqube using the below command,








Cheers
Gokulkanna BalusamyPosted Mar 10, 2022, 5:14 PM
This article is very useful for beginners and all working fine