Monday, May 24, 2004
FxCop, Introspection, and a custom fxcop rule

After using FxCop to analyze some assemblies, it became quite apparent the value FxCop provides.  Thanks to FxCop, our upcoming code reviews will be focusing on reviewing code, not coding standards.

After we all started cleaning our respective sections, though, we started to find some of the default rules that just we're not right for us.  Without thinking, or really knowing what was entailed in making a new rule, I volunteered to get our new rule implemented.  I knew FxCop was expandable, but didn't know how.

After a bit of research, I found FxCop uses 2 engines for it's analysis.  Reflection, and Introspection.  Introspection?  What’s that?  Here is a good 5 cent overview of reflection and introspection from .NET Undocumented.

So the search was on for a way to implement this new undocumented introspection.  Exciting stuff.  The first link I found was this article by the BugSlayer.  Excellent article that covered everything I wanted to know, and more.  The next thing I found was 1 post on the GDN forums that provided a complete, almost working base rule.  After playing with that, and some help from the author, I got it to work, and posted my results to the forum.

So now we have a couple custom rules, and will be adding more.  The links here should help anyone in search of the same. 

 



1/23/2005 3:53:32 PM (Eastern Standard Time, UTC-05:00)
The Bugslayer article is a great introduction. There are also some Instrospection examples and custom rules on www.fxcoprules.com .


Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):