Doing basic code analysis in Visual Studio 2012

Someone recently asked about using Codes Analysis in Visual Studio 2012.  Here is one approach. With a solution loaded in Visual Studio 2012, go to the build menu and pick Run Code Analysis on <project name>.    

clip_image002

Once the code analysis results appear, click the thing that looks like a gear and opens the configuration tool. 

clip_image003

For managed code mine defaulted to Microsoft Managed Recommended Rules. I think that is great place to start and that is the one I’d use.

The rule set field is a drop down. If you think Microsoft Managed Recommended Rules is too much than I’d suggest Microsoft Managed Minimum Rules.

clip_image005