5

I was wondering if there are any alternatives for code analysis. I suppose one can create a code analyser from scratch though this is a tedious work and I am not sure it worths it after all. Is there other, non .net specific, analysers?

Thanks, Sun

Sunscreen
  • 3,452
  • 8
  • 34
  • 40
  • 1
    There are a variety of tools available that do a variety of different things that might be considered "code analysis". Is there something specific that you are looking for? – Nicole Calinoiu Aug 24 '11 at 11:57
  • The first thing we need is coding standards, I think StyleCop does it. The other one is code complexity though it is again vague; it depends of the tool's output basicaly ... we are not in a position to know what we are looking exactly but we do not need FxCop output (or at least most of it). – Sunscreen Aug 24 '11 at 12:30

5 Answers5

6

NDepend is a commercial tool (with a Open Source / Academic Edition edition) that can do all sorts of analysis for you. Although it overlapps with FxCop for some rules, at has many more features.

I suppose one can create a code analyser from scratch

Everything is possible, but writing any validation tool that has any meaning costs large amounts of time. If your boss pays you for developing software, you will be burning his money. Writing your own analyzer is a good exercise, but will further be a complete waste of time.

Steven
  • 166,672
  • 24
  • 332
  • 435
4

I think ReSharper also has some Code Analysis features, search here in SO as well.

I found this one btw: http://www.itscodingtime.com/post/Visual-Studio-Code-Analysis-vs-FxCop-vs-StyleCope280a6-whats-the-diff.aspx

Also have a look at Sonar Source:

http://www.sonarsource.org, this is open source :)

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
4

http://www.mono-project.com/Gendarme open source and free.

https://github.com/unintelligible/GendarmeMsBuild is a nice add-on for it.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thanks for the answer though it is specific to VS2010 otherwise it needs the mono compiler... – Sunscreen Aug 24 '11 at 09:08
  • 3
    Gendarme does not requires Mono to execute (i.e. it runs fine on Windows using MS.NET), nor to be compiled using Mono compilers or tools (i.e. the Win32 release of Gendarme is build with VS2010). IWO Gendarme can run anywhere (there's a .NET VM) and be executed against any compiled IL. – poupou Aug 24 '11 at 12:18
1

My company offers a variety of tools for analyzing C#.

You are asking about analysis tools in a broad way, so I'll assume you are not just interested in static analysis. We also provide (dynamic analysis based) test coverage and profilers for C#.

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
1

As said by Davide Piras, you should definitively take a look at sonar C# plugin ecosystem. I am one of the main contributors of the project, I do not belong to sonarsource. These plugins and sonar itself are open source. The license is LGPL and hence business friendly.

If you want to see sonar in action on C# project, take a look to the demo instance :

http://nemo.sonarsource.org/dashboard/index/org.mybatis:mybatisdotnet

The official documentation is available here :

http://docs.codehaus.org/display/SONAR/C-Sharp+Plugins+Ecosystem

If you need help or have any question regarding the installation process, feel free to subscribe to the user mailing list :

http://www.sonarsource.org/support/support/

Alexandre Victoor
  • 3,104
  • 2
  • 27
  • 27