-1

I'm part of a small team that has been tasked to help rebuild the TFS/SharePoint/etc for our project teams while we're on a bit of downtime. Management has informed us that we should use SONAR as a static-code-review tool. This is somewhat entertaining because we use C#/ASP.Net/MVC for our projects...whereas SONAR is designed for Java, and it's only through plugins that it can handle C# at all.

So, by my own gut instinct and the recommendation of some senior team members, I'm looking for alternatives.

Can anyone recommend to me such a system that was designed for working in the .Net framework? I know FxCop exists that can target the code at run-time, but it would be preferred to have something that will work on the non-compiled source code.

Thanks in advance for the input.

guildsbounty
  • 3,326
  • 3
  • 22
  • 34

1 Answers1

3

As @CodeInChaos mentioned, use StyleCop.

That said, FxCop/Code Analysis is arguably more useful, and, contrary to the question, doesn't run at runtime. It runs post-compile, which isn't the same thing. My $0.02 is that all .NET projects should use it, with the sole exception of unit tests projects.

Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273
  • 1
    Big +1. Set up a build server (such as TeamCity) and configure it to run builds, tests, and FxCop analysis on source control check-ins. – TrueWill Jan 17 '11 at 18:14
  • Thanks for pointing out FXCop. That somehow escaped me until now. Do you know of any rule files that in addition check for common coding shortcomings (unuinitialized values...). Thanks° – Mario The Spoon Jan 17 '11 at 22:23
  • Using uninitialized values won't even compile in C#. But FxCop does catch problems above and beyond what the compiler checks (e.g., missing null checks on method arguments.) – Craig Stuntz Jan 18 '11 at 14:37