I want to create extra rules in FXCop. Custom Rules to help ensure specific best practices like checking against inline sql.
I'm really looking for good resources and examples. Thanks!
I want to create extra rules in FXCop. Custom Rules to help ensure specific best practices like checking against inline sql.
I'm really looking for good resources and examples. Thanks!
You can also use the tool NDepend to write your custom rules and/or harness some of the 200 default rules. The cool fact about NDepend is that it comes with a dedicated and seamless language to write your own rules: Code Query Language (CQL)
For example the following CQL rule will warn if it finds method with more than 20 lines of code:
WARN IF Count > 0 IN SELECT METHODS WHERE NbLinesOfCode > 20
The tutorial above is pretty good. I knocked together a sample VS project that also might be useful, since I couldn't find any example projects http://www.doogal.co.uk/files/FxCopRules.zip