posted on Tuesday, January 04, 2005 4:03 PM
by
roydictus
FxCop 1.312
I hadn't noticed, but on 9 December, Microsoft released version 1.312 of FxCop on GotDotNet. This version of the wonderful static code analysis tool is self-updating, so it'll check for new versions automatically from now on.
I gave it a quick spin and it looks good. Rule messages are much less confusing now, to say the least, and a number of new rules have been added (such as "Do not expose generic lists", "Avoid calls that box value types" and "Rethrow to preserve stack details.") Rule details are generally, uh, well-detailed and very useful.
For those who are unfamiliar with FxCop: this free tool analyses compiled assemblies (DLLs and EXEs) and checks them against a set of rules about good programming. For example, a class that contains nothing but static methods (called Shared methods in Visual Basic.Net) should not contain a constructor. FxCop produces a report with all the rules that were violated, explains why a rule is the way it is, and points you even to the line in your source code that you should change. Great!
Unfortunately, the SDK to develop your own rules is still missing. It was still around in version 1.29, then it disappeared... Hey guys, what's up? Why don't you supply an SDK anymore so we can add our own rules?
But besides that, I think FxCop should be in every serious developer's arsenal of quality assurance tools.
Update: In the Feedback for this post, Raymond Lewallen points to http://msdn.microsoft.com/msdnmag/issues/04/09/Bugslayer/ and writes: "that artilce by John Robbins provides source code that uses the new Introspection engine FxCop uses now, instead of the Reflection engine. You can download the sample and get write your own code based on what he did in his examples." Thank you Raymond!