Fun with Code Analysis Rule Sets

Two weeks ago, I introduced you to Visual Studio 2010 September ’08 CTP (Community Technology Preview). This CTP is available as a Virtual PC (VPC) image which can be downloaded at http://go.microsoft.com/fwlink/?LinkId=129231. The goal of the Community Technology Preview is to obtain feedback from our customers on the new scenarios we have enabled.  If you…

5

Reporting Code Analysis Defect Counts

Code analysis defect counts are available in the cube that is part of the TFS Data Warehouse. This post shows you how to hook up Excel to show code analysis counts in a pivot table. First off you need to connect Excel up to the data warehouse that has the data. Under the Data tab…

10

TIP: How to change the (Orcas) Managed Code Analysis naming/design rules to fire on internals

A while ago I mentioned that FxCop (and hence Managed Code Analysis) naming and design rules only fire on publicly visible types and members. As you may recall, there were a couple of reason for this: The .NET Framework Design Guidelines, which FxCop/Managed Code Analysis enforces, only contains guidelines for publicly visible API. What internal Microsoft teams (and you) do with their internal…

1

TIP: Scope the Code Analysis Policy to apply to specific source control paths/file types

On the forums, we have had posts  from customers who want to customize their code analysis policy to skip certain file types such as .sql, docs etc. This is because the policy will block checkins even though code analysis doesn’t apply to those files.[ See thread:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1080300&SiteID=1 ] There is now a way to configure…

1

TIP: Automatically generate Managed Code Analysis/FxCop suppressions

I see a lot of users attempting to hand code a SuppressMessageAttribute themselves. This can be error prone and is not needed when both Visual Studio and the standalone FxCop can automatically generate these for you. In Visual Studio 2005 Right-click a Code Analysis warning in the Error List and choose Suppress Message(s). In Visual Studio Orcas Right-click a…

1

TIP: How to change the FxCop naming/design rules to fire on internals [David Kean]

By default, the FxCop naming and design rules only fire on publicly visible types and members. There are a couple reasons for this: The .NET Framework Design Guidelines, which FxCop enforces, only contains guidelines for publicly visible API. What internal Microsoft teams (and you) do with their internal types and members is completely up to them. Noise. If you tend…

4

TIP: Get more information about a rule/warning within Visual Studio [David Kean]

Did you know you can get more information about a particular rule/warning within Visual Studio; including its description, information on how to fix it, whether or not it is considered a breaking change, when or when not to suppress it and code samples? To do this for a particular warning in the Error List: Right-click…

3