Introduction :
SonarLint is an IDE extension that helps you to detect and solve your issues on your code before committing code.
What is SonarLint :
SonarLint is an Open Source and license-free IDE extension. You can add this extension on your IDE like Eclipse or Visual Studio Code that can help developers for finding and detecting the issues of the code in just a second. So that developers are easily writing code.
Requirement :
- Your computer should be connected to the Internet.
- Your working SonarQube server should be (6.7.4+0).
- A recent version of Visual Studio Code, STS, or Eclipse.
- A Java Runtime (JRE) should be version 8 or higher than 8 installed on your computer.
Installation :
The Sonar Lint can be installed in many editors like Eclipse, IntelliJ, VSCode, and STS. And we will go to install IDE such as IntelliJ then we will go to install the plugin of Sonarlint on IntelliJ.
Click on “Browse repositories”, and search for “SonarLint” then click the install button-
Now we have a Sonar Lint installed on our IDE.
USE:
This IDE is used in the development process when we develop the code. It analyses the code and finds the issues with our code. These issues are the following types-
- BLOCKER: In this Bug with a high probability. Bug-like- memory leak, unclosed JDBC connection.
- CRITICAL: Bug with a low probability. In this bug-like, an empty SQL injection, catch block, etc.
- MAJOR: It can highly impact developer productivity. In this bug-like an uncovered piece of code, unused parameters, duplicated blocks, etc.
- MINOR: In these lines should not be too long. “Switch” statements should have a minimum of 3 cases.
After this, we can see what’s types of issues on our code and explanations of issues about how we solve them.
Conclusion :
- The SonarLint allow us to improve our code removing the possible bug causes;
- Easy to use;
- Fast feedback;
- We can use IntelliJ, Visual Studio, VSCode, STS, and Atom.
References :