Static Code Analysis

Intergrating FxCop into the cruisecontrol .net build process is not too hard. Also finding the SuppressMessage attribute was by pure luck. This attrbiute allows you to flag exceptions to FxCop rules in your source, rather than in the FxCop project file. But that doesn't phase me too much as i would still like the project file for message historys etc. I just created another file in the properties folder of the assembly for Analysis.cs.

The trouble with fxcop is that it only checks the compiled source, it doesn't check the actuall source code. I need a tool to intergrate with cruise control to check coding standards. The is a tool called PREfast in team studio, but i think it only does c/c++ for device drivers. And from the look of this article, thats all that microsoft offers. There is a java open source project called checkstyle that looks promising, but i will have to see that it doesn't throw huge amounts of errors for c#. I am surprised there is not a port yet. The last tool that i had a look at is SSW Code Auditor but it seems there server is having troubles at the moment and i can't download the trial. But it says it overs a large amount of source code checking, from cs, to html, to templates and sql.

No comments: