SaFi Bank Space : SonarLint with SonarQube in IntelliJ IDEA

Please ask SonarQube access first from your leads or from kai.hu (Unlicensed)

Steps to install and configure

  1. Install SonarLint plugin in IntelliJ IDEA(Preferences > Plugins > Install and Restart IDE)

2. Add SonarQube connection binding (Preferences > Tools > SonarLint > Click on + sign)

3. Select SonarQube and set the connection name and the sonarQubeURL as http://34.124.144.240:8080/. Click on Next button.

4. Login to SaFi SonarQube (http://34.124.144.240:8080/) using your credentials.

5. Click on your profile on the upper right portion of the page and click on My Account.

6. Click on Security > Enter token name > Click on Generate button > Click on Copy button

7. Paste this copied token in the token field back in IntelliJ IDEA SonarLint config window. Click on Next > Next > Create.

8. Go to SonarLint Project Settings (Preferences > Tools > SonarLint > Project Settings).

a. Check Bind project to SonarQube/SonarCloud

b. Select the newly created connection

c. Set the project key (this is usually your microservice)

d. Click on Apply and OK

How to Use

I. Analyze code for each file

  1. Open file to be analyzed

  2. Click on Analyze with SonarLint (in Editor, Project Explorer or SonarLint plugin window)

II. Generate report for all local changes

  1. Click on SonarLint Plugin Window (usually at the bottom section of the IDE)

  2. Click on the topmost button (Analyze VCS Changed Files)

References