Effective Code Analysis through SonarLint in Visual Studio

Good Morning Folks!!

I had been thinking to write my blog from several years & I always complained about the time shortage in my life.
I feel, if I haven’t started to google a bit about where & how to start writing blog, few more years may pass happily with the same complain.

To cut the story short, I am writing my first blog and idea is to cover the technical information & challenges which I am facing during my day to day work.
The motive behind this is to share the knowledge and at the same time I have things documented which can  refer at any time.

Today morning, when I got a mail from my manager asking the team about whether we are following specific coding standard & guidelines in our application & first question triggered in my mind, are we, Really?
Well, we have a quite complex application which is developed in NET technology (C#) & has around 40-50 projects (1000s of  C# files) within one solution which we are maintaining from last 5 years.
So another thought was, how shall we ensure code standards for all these files within application which grows tremendously over 5 years of time.

We have number of developers who are/were working on this application & each developers has their own coding style (of course, we all follow basic C# coding standards).
However, we are one of the happiest agile team in our organization as we have around 70% automation test code coverage so we feel, we are quite in control in terms of code quality, in spite of the complexity level of the application.

I have started googling to look into the tools which provides the Code Analysis including coding standard & to my surprise, I found SonarLint for Visual Studio which exactly does the same thing.
You can install SonarLint through VS Extensions, in our case it is VS 2015.


Integration of SonalLint & Visual Studio works seamlessly & as a developer you can get immediate feedback related to new bugs and quality issues written by you, which I think is excellent.

You will be able to see the Lint warnings with line numbers in C# (.cs) file on which you are currently working on. You also have a possibility to suppress some of the warning rules, if you find is not relevant for your project.


You can find more information here – http://www.sonarlint.org/visualstudio/index.html

For us, now it is ongoing activity to fix the issues reported by SonarLint on each file & whoever is working on the specific file will take the responsibility to remove these warnings by fixing in code.

It will take a while, but we are positive that one day we shall get rid of all the warnings & will set new standards 🙂

Signing off for now…