Search code examples
visual-studiocoding-stylefxcopstylecop

Can FxCop/StyleCop be limited to only analyze selected methods from with Visual Studio?


I am taking on a maintenance team and would like to introduce tools like FxCop and StyleCop to help improve the code and introduce the developers to better programming techniques and standards. Since we are maintaining code and not making significant enhancements, we will probably only deal with a couple of methods/routines at a time when making changes.

Is it possible to target FxCop/StyleCop to specific areas of code within Visual Studio to avoid getting overwhelmed with all of the issues that would get raised when analyzing a whole class or project? If it is possible, how do you go about it?

Thanks, Matt


Solution

  • I am using FxCopCmd.exe (FxCop 1.36) as an external tool with various command line parameters, including this one:

    /types:<type list>  [Short form: /t:<type list>]
    Analyze only these types and members.