Skip to main content

FxCop

Share:

Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

This, to me, is the best tool for .NET so far. And, I’m including nDoc here :)

FxCop is a code inspector that checks assemblies for conformance to .NET Framework design guidelines. And, it really works. Kind of.

The program works using introspection and a flexible rule engine to decompile and analyse managed assemblies and show you where your code is breaking the guidelines.

As a test, I checked out my own blog code with FxCop. The process takes just seconds, and a whole list of bad practises were presented. I actually learnt from the analysis. For example, I used a sloppy:


if (bodyText == "")

FxCop has told me to check for empty strings using:


if (bodyText.Length() == 0)

as its far more efficient. Now, that’s cool.

Many of the problems it highlighted were actually produced by Visual Studio .NET, such as :

“Make ‘CheckBox1’ private or internal and provide a public or protected property to access it.”

Taking those errors to one side however, you can really get a good idea of how to improve your coding. What a great tool.

FxCop is Microsoft produced, and is free to download.

thanks to Zak for the original link!

Related Articles

Philip is a Computer Science PhD student at Liverpool John Moores University. He's still not mastered guitar tabs, never finished Mario, and needs a haircut. He discusses life at http://www.miseldine.com/.

New books out now!

Learn the basics of programming with the web's most popular language - JavaScript


A practical guide to leading radical innovation and growth.

Integromat Tower Ad