Search This Blog

Breaking

Friday, 24 September 2021

Sonar lint [A must have tool] for your automation project and team

 Recently I feel the need to have a static code analysis of my one of the java automation project. I was aware about the sonar qube and sonar lint but I never implemented or used these tool in any of my automation project. Though in one of my Typescript bases project we have used TSLint which was very impressive. 

So I started googling about it. And picked one of my sample project to use these tools. Let me first differentiate between these 2. 

Sonar lint lives only in the IDE (IntelliJ, Eclipse and Visual Studio). Its purpose is to give instantaneous feedback as you type your code. For this, it concentrates on what code you are adding or updating.

SonarQube is a central server that processes full analyses (triggered by the various SonarQube Scanners). Its purpose is to give a 360° vision of the quality of your code base. For this, it analyzes all the source lines of your project on a regular basis.

So I preferred to use sonar lint in one of my project. As usual, I added this in my favorite IDE intelij. Once it get installed, you can see an option sonar Lint in the bottom as an option,





It keeps showing you code smells with explanation and a possible solution. 

For example:






This helps you to reduce lots of small issues which we simply missed because of unawareness and our ignorance. We can run this for the whole project also, though it takes some time to get complete if its a large project.

Sonar lint is available for eclipse and visual studio as well.

No comments:

Post a Comment