Minimize technical debts by integrating SonarLint with SonarQube

Ravi Verma
3 min readFeb 19, 2021

If you’re here then you must know that the SonarQube is amongst the popular automated code scanning tools in the industry. If you want to fix the issues before they even get reported then SonarLint is the tool you’re looking for.

SonarLint is the IDE plugin that can report issues like code smells, vulnerabilities and security hotspots as you code, so that they can be fixed before committing the code.

SonarLint supports four IDEs:

  • Eclipse
  • IntelliJ IDEA
  • Visual Studio
  • VS Code

How to setup SonarLint with IntelliJ IDEA?

  • Go to File > Settings > Plugins and select Marketplace. Now enter “SonarLint” and click install.
  • If the above option is not working try this one, Download the plugin from here and go to File > Settings > Plugins. Now click on the gear icon next to “Installed” option and select “Install Plugin from disk”.
  • Post successful installation, restart the IDE.
  • Now, go to File > Settings > Tools > SonarLint and click on the ‘+’ sign under SonarQube / SonarCloud connections.
  • Enter a connection name, then select sonarqube and enter SonarQube server URL and then click next.
  • Now choose Token or Login / Password and enter the value then click Next and the Finish.
  • For mapping your local project with the project on SonarQube. Go to “File > Settings > Tools > SonarLint >Project Settings” and check the option Bind project to SonarQube / SonarCloud and select the configured server from dropdown.
  • Click on the search list and select the corresponding project from the list and click apply and ok.

VOILA!!! you’re done with setup

How to Analyze your code with SonarLint?

  • Go to “Analyze” and select “Analyze all files with SonarLint”.

HAPPY CODING!!!!

--

--