Posted by: rcosic | 06/04/2009

Code Analysis in Visual Studio 2010

What’s new in terms of Code Analysis in Visual Studio 2010 Team Edition (codename Rosario)? You can find it here..

At first, you can see that there is a slight change when you switch to the Code Analysis page inside the project properties:

Rulesets in Visual Studio 2010

Rulesets in Visual Studio 2010

Instead of the large list of rules, you now see the rule sets something you probably desired to see. You have different sorts of predefined sets of rules here, each targeted on a different scope:

  • Microsoft All Rules – expect to get large number of warnings here, it’s good for getting the big picture of the code analysis realm and all the rules it includes,
  • Microsoft Minimum Recommended Rules – the most critical problems in your code are enlisted here, it’s generally recommended that you include it,
  • Microsoft Basic Correctness Rules – addition to the previous set with the focus on logic errors and common mistakes,
  • Microsoft Basic Design Guideline Rules – focused on making the code easy to understand and use,
  • Microsoft Extended Correctness Rules – expands the basic correctness rules to maximum, emphasis on COM interop, mobile applications, and so on,
  • Microsoft Extended Design Guideline Rules – expands the basic design guideline rules to maximize the usability and maintainability, extra emphasis on naming conventions,
  • Microsoft Globalization Rules – focused on data usage in different languages, locales and cultures, i.e. localization and globalization stuff,
  • Microsoft Security Rules – maximizes on security issues.

 You can review and manage them by clicking the Open button on this page.

Of course, this isn’t all – it’s just a beginning.

You can select multiple rulesets, or you can examine each of the rules in the rulesets, and unselect them or select them as you please. And you can choose which action should the breaking of rule trigger – issuing a warning,  an error, or nothing. You can group the rules by category (default), name, namespace, target type, action, and source rule sets:

Examining the rule set

Examining the rule set

Also, there is a possibility to search for a rule, add or remove child rule sets. There is even a possibility to create your own rule, but from my point of view, it’s still difficult to do it. You can check those sites for getting to know how to do it: binarycoder, thescarms.

There are supposedly 8 new rules concerning Data Flow, but I didn’t manage to find it. And also, check-in policy is enhanced. Anyway, you can checkout it yourself by downloading the Visual Studio 2010 CTP on Microsoft site.

Kind regards,


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: