Example custom code analysis rule(s) for Continuous Inspection presentation (given with no warranty or support, obviously)
To apply the custom rule(s), compile the project (and make sure the unit tests pass!) and then copy the CustomFxCopRule.dll to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules (or wherever you have VS installed.)
There's some documentation on creating custom Visual Studio 2013 rulesets at https://msdn.microsoft.com/en-us/library/dd264974.aspx
To use this with the FxCopCmd command line application: https://msdn.microsoft.com/en-us/library/bb429474(v=vs.80).aspx
As you'll see, this is intentioonally a work-in-progress. More test cases need to be addressed. It is for demonstration/illustration only.
Hopefully you get the idea :)
Jason Gorman www.codemanship.com