Click here to Skip to main content
13,149,756 members (82,444 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

9.5K views
6 bookmarked
Posted 9 Jun 2016

Four C# Code Analyzers That Are Worth Your Time

, 9 Jun 2016
Rate this:
Please Sign up or sign in to vote.
Four C# code analyzers that are worth your time

With the advent of .NET Compiler Platform (code-named “Roslyn”), it became possible to build code analyzers for languages like C# with ease. In the past, only big companies like JetBrains or DevExpress with a lot of resources could build a code analyzer, because building it involved writing your own compiler for that purpose. Now the .NET Compiler Platform provides developers with a set of APIs to query the compiler and interact with it. In this post, I'm going to introduce four code analyzers that I happen to use, if you think some other important analyzer exists that is worth mentioning, please let me know in the comments section.

What is Code Analyzer?

In its simplest form, code analyzers are a set of tools that can analyze your code, and based on their rulesets, tell you what part of your code has a potential problem, and can get better. In this case, some of them can also provide you with an automatic fix for that problem.

Refactoring Essentials

Refactoring Essentials constantly gets updated by an active community, it works with C# and VB, and provide a set of features that you can see here.

Code Cracker

Code Cracker is another amazing code analyzer for C# and VB, it also has an active community around it that only gets better as the set of rules and fixes grows.

StyleCop Analyzers

Another great analyzer to have is StyleCop Analyzer for the .NET Compiler Platform, you don't have to use the old stuff anymore, this analyzer does its magic for you on the fly.

SonarLint

SonarLint is a great analyzer, the thing that set it apart from others, is that it has a connected mode, which allows you to connect to a server and automatically updates your rulesets for the solution. It also has an active community. You can install it as an Visual Studio extension.

As a minor note to those of you who don't use Visual Studio 2015, if you want to use these features, you need to either install VS 2015, or install the roslyn compiler as a nuget package. What you need to install can be found here and here and here!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Hamid Mosalla
Software Developer
Iran (Islamic Republic of) Iran (Islamic Republic of)
I like the unknown, that's why I watch a lot of sci-fi, but that also led to my fascination with technology. I'm curious about new things, I like to tinker with them, use them and know them. I always try to take the more elegant and challenging route. I always welcome changes, without change, being a programmer is boring. Currently I work as a web developer and mostly use Microsoft products for my daily job, but I'm eager to learn and use any kind of technology to do the job.

You may also be interested in...

Pro

Comments and Discussions

 
QuestionCombining code analyzers. Pin
Member 1255225014-Jun-16 17:20
memberMember 1255225014-Jun-16 17:20 
AnswerRe: Combining code analyzers. Pin
Hamid Mosalla15-Jun-16 7:45
memberHamid Mosalla15-Jun-16 7:45 
QuestionWhich to use? Pin
DW196210-Jun-16 3:30
memberDW196210-Jun-16 3:30 
AnswerRe: Which to use? Pin
Rajan Patekar14-Jul-16 5:37
professionalRajan Patekar14-Jul-16 5:37 
PraiseRe: Which to use? Pin
DW196214-Jul-16 11:29
memberDW196214-Jul-16 11:29 
GeneralRe: Which to use? Pin
Andre L.A.C Bittencourt18-Nov-16 6:30
memberAndre L.A.C Bittencourt18-Nov-16 6:30 
AnswerRe: Which to use? Pin
Hamid Mosalla25-Jul-16 5:51
memberHamid Mosalla25-Jul-16 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170924.2 | Last Updated 9 Jun 2016
Article Copyright 2016 by Hamid Mosalla
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid