views:

1023

answers:

5

I'm trying to do automated code review and refactoring with a tool. Something in the lines of FxCop or ReSharper.

Looking for tool suggestions that meet these requirements:

  1. Low learning curve.
  2. Targeted at C# (and maybe VB.NET).
  3. Let's me easily add or customize rules (and understands entire CodeDOM).
  4. Well documented.
  5. FREE or dirt cheap. Sorry, low exchange rate =)

Manual code reviews will still be done. But the tool should be thorough enough to catch all the common boo boos before a senior developer does the manual review.

If you have stories to share about the tools that you have used/are using then that would be great, too.

Thanks.

EDIT: Finally had some time to look into the suggestions more. StyleCop does NOT integrate with Visual Studio Express Edition which is what I'm using. ReSharper has a lot more features than what I require (which is purely to automate code reviews). I would say it's not a very focused tool for my purposes (and also the reason for it's price tag). Still looking for other suggestions if any.

EDITDIT: StyleCop does NOT integrate with Visual Studio Express but you can still set it up to run as part of your build in Visual Studio Express. Seems like the best solution for now.

+3  A: 

Since you mentioned ReSharper, I would recommend looking into the sharing code styles feature that is available in one of the latest versions. This way you can have your team following the same standards and coding styles and will let them know as they code. You can read more here: Sharing Code Styles.

I have also been on a project where we ran FxCop from Visual Studio as a post build process. You can set warnings and errors the way you want in FxCop and even fail the build if you would like.

Microsoft's StyleCop is another free project on MSDN Code gallery that may be worth checking out:

Team System has some nice features in it, but you said cheap so I'm not even going there :)

The most important thing I learned about any of these processes, is the dev team needs to understand why this is important and everybody needs to buy into it in order for it to be successful. One rogue developer or contractor can make the whole thing a mess and then the rest of the team may think why even bother.

SaaS Developer
A: 

I don't know about automated refactoring, but you're on the right track for analysis. FxCop is extensible with custom rules and you can use StyleCop to directly analyze your source (FxCop examines the compiled MSIL). You can also tweak StyleCop to handle your specific requirements. As far as true "automation" goes you'd have to script something up. I am spoiled in that I have VSTS 2008 and automation is provided through the IDE. You could use PowerShell or such to create a scaffolding that provided the first pass that a senior developer/reviewer could then work from.

Todd Williamson
One common problem I have is newbies using the column name to get the value from a DataRow in a loop. I want them to get the index of the column outside the loop and use the index instead of the name inside the loop. Can StyleCop catch these types of mistakes. The documentation seems vague on this.
fung
+1  A: 

I'd like to mention Code Metrics, which is a good code review tool included in the Team System editions. If you don't those fancy versions of Visual Studio you can have a look at StudioTools from Exact Magic Software, which is a free plugin.

Microserf
+2  A: 

Check this thread Tool to aid Code Review..

You might also want to look at the Code Collaborator

Prakash
A: 

Review Board is free!

And here's Flickrfeed for Screenshots!

Prakash
Review Board looks more like a tool to manage reviews rather than to automate it. Is that right?
fung