<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code Analysis Team Blog : Code Analysis</title><link>http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx</link><description>Tags: Code Analysis</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Fun with Code Analysis Rule Sets</title><link>http://blogs.msdn.com/fxcop/archive/2008/11/12/fun-with-code-analysis-rulesets.aspx</link><pubDate>Wed, 12 Nov 2008 22:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9064155</guid><dc:creator>cristend</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/9064155.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=9064155</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=9064155</wfw:comment><description>&lt;P&gt;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 &lt;A href="http://go.microsoft.com/fwlink/?LinkId=129231" mce_href="http://go.microsoft.com/fwlink/?LinkId=129231"&gt;&lt;FONT color=#0000ff&gt;http://go.microsoft.com/fwlink/?LinkId=129231&lt;/FONT&gt;&lt;/A&gt;. The goal of the Community Technology Preview is to obtain feedback from our customers on the new scenarios we have enabled.&amp;nbsp; If you haven't already downloaded the CTP, do it now and take it out for a spin.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There&amp;nbsp;are many new cool features with the CTP such as an Historical Debugger and&amp;nbsp;Impact Analysis of&amp;nbsp;code changes, but today we are going to focus on &lt;STRONG&gt;Rule Sets&lt;/STRONG&gt; for code analysis. (For an overview of all the neat stuff happening in code analysis, check out this PDC video&amp;nbsp;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-theme-font: minor-latin"&gt;&lt;A href="http://mschnlnine.vo.llnwd.net/d1/pdc08/WMV-HQ/TL60.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/pdc08/WMV-HQ/TL60.wmv&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;Configuring code analysis in Visual Studio 2008 and earlier versions required evaluating each individual rule to determine whether it was important enough to turn on and fix for your project. This might be a very time-consuming process that made it difficult to make sure that the most important problems were identified and fixed. With rule sets, code analysis can now be configured much more quickly and easily with sets of rules that are targeted at specific scenarios or areas of emphasis. Let's take a look at&amp;nbsp;how this works.&lt;/P&gt;
&lt;P&gt;The following scenario comes from our CTP walkthrough.&amp;nbsp; You can find the walkthrough and more details when you download the CTP as described above.&amp;nbsp; Let's assume that you have the &lt;EM&gt;&lt;STRONG&gt;DinnerNow – Kiosk&lt;/STRONG&gt;&lt;/EM&gt; solution open and is the active project.&amp;nbsp; On the &lt;STRONG&gt;Analyze&lt;/STRONG&gt; menu, click &lt;STRONG&gt;Configure Code Analysis&lt;/STRONG&gt; &lt;STRONG&gt;for DinnerNow.Restaurants.Kiosk&lt;/STRONG&gt;.&amp;nbsp; The property page for Code Analysis is displayed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG title="Code Analysis Properties" style="WIDTH: 590px; HEIGHT: 376px" height=376 alt="Code Analysis Properties" hspace=1 src="http://blogs.msdn.com/photos/codeanalysis/images/9064354/original.aspx" width=590 vspace=1 border=1 mce_src="http://blogs.msdn.com/photos/codeanalysis/images/9064354/original.aspx"&gt;&lt;/P&gt;
&lt;P class=TextinList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This screen tells us that &lt;STRONG&gt;Microsoft All Rules&lt;/STRONG&gt; will be executed when we run code analysis, but what if we didn't want to run&amp;nbsp;every Microsoft rule?&amp;nbsp; What if we have a specific scenario we wish to target?&amp;nbsp; We can change which rule set to run by clicking on &lt;STRONG&gt;Open&lt;/STRONG&gt; which brings up:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Add or Remove Rule Sets" style="WIDTH: 590px; HEIGHT: 387px" height=387 alt="Add or Remove Rule Sets" hspace=1 src="http://blogs.msdn.com/photos/codeanalysis/images/9064400/original.aspx" width=590 vspace=1 border=1 mce_src="http://blogs.msdn.com/photos/codeanalysis/images/9064400/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;We can select which rule set(s) by simply selecting or deselecting the appropriate box.&amp;nbsp; Notice that each rule set has a brief description of the types of rules within the rule set.&amp;nbsp; Further, you can open up each individual rule set and see the specific rules that make up the rules sets.&amp;nbsp; You can also turn on or off individual rules within a rule set.&amp;nbsp; Finally, you can adjust the type of action a rule will trigger.&amp;nbsp; In the past, code analysis rules&amp;nbsp;have been limited to build Warnings, but now you can elevate code analysis rules to build Errors.&lt;/P&gt;
&lt;P&gt;As you can see, rules sets provide a powerful way to focus code analysis on the scenarios and rules that matter most to you.&amp;nbsp; You can also create custom rule sets based on your specific needs.&amp;nbsp; We wont go into it today, but if you download the CTP, the Walkthrough explains how to customize a rule set.&lt;/P&gt;
&lt;P&gt;Give it a try and let us know what you think.&lt;/P&gt;
&lt;P&gt;Cris&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9064155" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Custom+Rules/default.aspx">Custom Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/CodeCommunit+Analysis/default.aspx">CodeCommunit Analysis</category></item><item><title>New Code Analysis Features in Visual Studio 2010 September '08 CTP</title><link>http://blogs.msdn.com/fxcop/archive/2008/10/30/new-code-analysis-features-in-visual-studio-2010-september-08-ctp.aspx</link><pubDate>Thu, 30 Oct 2008 20:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9024851</guid><dc:creator>cristend</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/9024851.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=9024851</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=9024851</wfw:comment><description>&lt;P mce_keep="true"&gt;At this year's PDC, Microsoft released Visual Studio 2010 September '08 CTP (Community Technology Preview). This CTP is available as a Virtual PC (VPC) image which can be downloaded at &lt;A href="http://go.microsoft.com/fwlink/?LinkId=129231"&gt;http://go.microsoft.com/fwlink/?LinkId=129231&lt;/A&gt;. The goal of the Community Technology Preview is to obtain feedback from our customers on the new scenarios we have enabled.&amp;nbsp; If you are interested in code analysis, you need to get this CTP and here is why.&lt;/P&gt;
&lt;P&gt;The code analysis team is excited to share with you new code analysis features and rules in this CTP, including:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;I&gt;Rule sets&lt;/I&gt; - code analysis can now be configured much more quickly and easily with sets of rules that are targeted at specific scenarios or areas of emphasis&lt;BR&gt;&lt;BR clear=all&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;Enhanced policy support&lt;/I&gt; - enforce your rule set with the code analysis check-in policy&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;8 New Data Flow rules&lt;/I&gt; - find hard-to-detect flaws with these advanced dataflow rules for managed code; including certain SQL injection vulnerabilities&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Included with the CTP is a walkthrough guide.&amp;nbsp; Inside the walkthrough is a section dedicated to these exciting code analysis scenarios.&amp;nbsp; Over the next couple of weeks we will continue to blog about rule sets, policy support, and data flow rules so be sure to come back after you get the CTP. &lt;/P&gt;
&lt;P&gt;Now go get the CTP and starting sending us your feedback! &lt;A href="http://go.microsoft.com/fwlink/?LinkId=129231"&gt;http://go.microsoft.com/fwlink/?LinkId=129231&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9024851" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category></item><item><title>New for Visual Studio 2008 SP1 and FxCop 1.36 – Multi-targeting rule</title><link>http://blogs.msdn.com/fxcop/archive/2008/08/25/new-for-visual-studio-2008-sp1-and-fxcop-1-36-multi-targeting-rule.aspx</link><pubDate>Mon, 25 Aug 2008 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8893369</guid><dc:creator>David M. Kean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/8893369.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=8893369</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=8893369</wfw:comment><description>&lt;P&gt;I've just published a post over my blog about a new feature we added for Visual Studio 2008 SP1 and FxCop 1.36.&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://davesbox.com/archive/2008/08/25/new-for-visual-studio-2008-sp1-and-fxcop-1-36-multi-targeting-rule.aspx" mce_href="http://davesbox.com/archive/2008/08/25/new-for-visual-studio-2008-sp1-and-fxcop-1-36-multi-targeting-rule.aspx"&gt;New for Visual Studio 2008 SP1 and FxCop 1.36 – Multi-targeting rule&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8893369" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category></item><item><title>FAQ: How do I prevent FxCop 1.36 from firing warnings against generated code?</title><link>http://blogs.msdn.com/fxcop/archive/2008/02/28/faq-how-do-i-prevent-fxcop-1-36-from-firing-warnings-against-generated-code.aspx</link><pubDate>Thu, 28 Feb 2008 21:39:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7936799</guid><dc:creator>David M. Kean</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/7936799.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=7936799</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=7936799</wfw:comment><description>&lt;p&gt;&lt;em&gt;I've upgraded from FxCop 1.35 to 1.36 and now FxCop has started to fire warnings against typed DataSets and other generated code. How do I turn this off?&lt;/em&gt;&lt;/p&gt; &lt;p&gt;The reason this is occurring is because we changed the way that FxCop analyzed generated code. Whereas previously in 1.35, FxCop would only ignore particular generated code (such as DataSets), FxCop 1.36 will now either ignore no generated code, or all generated code. The former is the default.&lt;/p&gt; &lt;p&gt;To change this behavior and have FxCop skip over generated code:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Using an FxCop project:&lt;/strong&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Open your FxCop project in FxCop&lt;/li&gt; &lt;li&gt;Choose &lt;strong&gt;Project&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Options&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Spelling &amp;amp; Analysis&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;Check &lt;strong&gt;Suppress analysis results against generated code&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;strong&gt;Via the command-line:&lt;/strong&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Pass the /ignoregeneratedcode switch, for example:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;FxCopCmd.exe /file:MyAssembly.dll /out:AnalysisResults.xml /ignoregeneratedcode&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;For more information on FxCop's behavior over generated code, see &lt;a href="http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx"&gt;Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7936799" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/FAQ/default.aspx">FAQ</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category></item><item><title>Tutorial on writing your own Code Analysis rule</title><link>http://blogs.msdn.com/fxcop/archive/2008/01/18/tutorial-on-writing-your-own-code-analysis-rule.aspx</link><pubDate>Fri, 18 Jan 2008 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7143040</guid><dc:creator>David M. Kean</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/7143040.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=7143040</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=7143040</wfw:comment><description>&lt;P&gt;Jason Kresowaty has posted &lt;A class="" href="http://www.binarycoder.net/fxcop/" mce_href="http://www.binarycoder.net/fxcop/"&gt;a great tutorial on writing Code Analysis/FxCop rules&lt;/A&gt;. He also spends time on explaining parts of the Introspection&amp;nbsp;API, including the different nodes and their relationship to each other.&lt;/P&gt;
&lt;P&gt;It's a great read, even if you've written some Code Analysis rules before. Definitely recommended.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7143040" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Custom+Rules/default.aspx">Custom Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2005/default.aspx">Visual Studio 2005</category></item><item><title>What do you want to see in the second edition of Framework Design Guidelines?</title><link>http://blogs.msdn.com/fxcop/archive/2008/01/15/what-do-you-want-to-see-in-the-second-edition-of-framework-design-guidelines.aspx</link><pubDate>Tue, 15 Jan 2008 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7112171</guid><dc:creator>David M. Kean</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/7112171.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=7112171</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=7112171</wfw:comment><description>&lt;TABLE class="" cellSpacing=0 cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=187&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" alt="Framework Design Guidelines, Second Edition" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/WhatdoyouwanttoseeinthesecondeditionofFr_C50F/FrameworkDesignGuidelines_3.jpg" border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/WhatdoyouwanttoseeinthesecondeditionofFr_C50F/FrameworkDesignGuidelines_3.jpg"&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/kcwalina" mce_href="http://blogs.msdn.com/kcwalina"&gt;Krzysztof&lt;/A&gt; and &lt;A href="http://blogs.msdn.com/brada" mce_href="http://blogs.msdn.com/brada"&gt;Brad&lt;/A&gt; &lt;A href="http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx" mce_href="http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx"&gt;have announced&lt;/A&gt; they are working on the second edition of the awesome &lt;A href="http://www.amazon.com/Framework-Design-Guidelines-Conventions-Development/dp/0321246756" mce_href="http://www.amazon.com/Framework-Design-Guidelines-Conventions-Development/dp/0321246756"&gt;Framework Design Guidelines&lt;/A&gt; and are looking for feedback on what they should put in it. &lt;/P&gt;
&lt;P&gt;For those that don't know, &lt;EM&gt;a lot&lt;/EM&gt; of our Code Analysis rules are based on the writings in this great book, so expect to see additional rules in the future based on the new guidelines in the second edition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;To provide feedback, head over to &lt;A class="" href="http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx" mce_href="http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx"&gt;Krzysztof's blog&lt;/A&gt; and post a comment.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7112171" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Framework+Design+Guidelines/default.aspx">Framework Design Guidelines</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Books/default.aspx">Books</category></item><item><title>FAQ: Which Code Analysis rules shipped in which version?</title><link>http://blogs.msdn.com/fxcop/archive/2008/01/07/faq-which-rules-shipped-in-which-version.aspx</link><pubDate>Mon, 07 Jan 2008 21:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7018062</guid><dc:creator>David M. Kean</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/7018062.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=7018062</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=7018062</wfw:comment><description>&lt;P&gt;In response to &lt;EM&gt;a lot&lt;/EM&gt; of recent requests, we've put together a complete list of rules that shipped in the different versions of Visual Studio Code Analysis and FxCop. Attached is an Excel worksheet providing this information for Visual Studio 2005, Visual Studio 2008, FxCop 1.35 and FxCop 1.36 Beta.&lt;/P&gt;
&lt;P&gt;One of things you'll notice as you read through the list is that we removed some rules from the later versions. There are a few reasons for this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Noise and applicability.&lt;/STRONG&gt; We use feedback from customers, &lt;A href="http://blogs.msdn.com/jensenh/archive/2006/04/05/568947.aspx" mce_href="http://blogs.msdn.com/jensenh/archive/2006/04/05/568947.aspx"&gt;SQM data&lt;/A&gt; (to see which rules users turn off), and input from internal teams (Windows, Office, CLR, etc) to determine the rules that are noisy without adding any perceivable value. There are also rules that are either no longer applicable or can no longer fire. for example, a rule could have been firing on a limitation of the CLR which has since been fixed in later versions.&lt;BR&gt;&lt;BR&gt;
&lt;LI&gt;&lt;STRONG&gt;Merged rules&lt;/STRONG&gt;. Sometimes it makes sense to merge rules that fire on similar things, for example, the analysis in SecureGetObjectDataOverrides was already covered by OverrideLinkDemandsShouldBeIdenticalToBase, so these two rules were merged. Similarly, LongAcronymsShouldBePascalCased, ShortAcronymsShouldBeUppercase and IdentifiersShouldBeCasedCorrectly all fired on the casing of identifiers, and hence were merged in the later.&lt;BR&gt;&lt;BR&gt;
&lt;LI&gt;&lt;STRONG&gt;Analysis engine removed.&lt;/STRONG&gt; In Visual Studio 2008 and FxCop 1.36 we removed one of our analysis engines. This engine was removed for a variety of reasons; it increased analysis time (although the engine encompassed less than 5% our analysis, it took up 50% of our time-to-analyze), indeterministic results (results appearing and disappearing between runs), and bugs found within the engine (and hence the rules that depended on it) required huge architectural changes. We instead decided to invest the resources that we would have spent on fixing the old engine, on a new data flow analysis engine based on &lt;A href="http://research.microsoft.com/phoenix/" mce_href="http://research.microsoft.com/phoenix/"&gt;Phoenix&lt;/A&gt;, which we will ship in a future version of Visual Studio.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There are also more differences between Visual Studio Code Analysis and FxCop than just the rules - in a future blog post I will cover these in detail.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7018062" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/fxcop/attachment/7018062.ashx" length="55296" type="application/octet-stream" /><category domain="http://blogs.msdn.com/fxcop/archive/tags/FAQ/default.aspx">FAQ</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2005/default.aspx">Visual Studio 2005</category></item><item><title>Reporting Code Analysis Defect Counts</title><link>http://blogs.msdn.com/fxcop/archive/2008/01/02/reporting-code-analysis-defect-counts.aspx</link><pubDate>Wed, 02 Jan 2008 23:10:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6958609</guid><dc:creator>conorm</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/6958609.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=6958609</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=6958609</wfw:comment><description>&lt;ul&gt;   &lt;p&gt;Code analysis defect counts are available in the cube that is part of the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=480&amp;amp;SiteID=1"&gt;TFS Data Warehouse&lt;/a&gt;. This post shows you how to hook up Excel to show code analysis counts in a &lt;a href="http://office.microsoft.com/en-us/excel/HA010346321033.aspx"&gt;pivot table&lt;/a&gt;.&lt;/p&gt;    &lt;p&gt;First off you need to connect Excel up to the data warehouse that has the data. Under the &lt;strong&gt;Data&lt;/strong&gt; tab in Excel select &lt;strong&gt;From Other Sources, From Analysis Services&lt;/strong&gt;.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image001_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="213" alt="clip_image001" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image001_thumb.png" width="435" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Then you need to give the name of the server with the data warehouse. In the standalone TFS case this will be whatever machine is running TFS. Assuming you have read permissions with your Windows account you can click &lt;strong&gt;Next&lt;/strong&gt;, otherwise enter a user name and password that has access to the server and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image002_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="265" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image002_thumb.png" width="346" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Then, select the database (usually TfsWarehouse) and select the &lt;strong&gt;Build&lt;/strong&gt; table.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image003_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="263" alt="clip_image003" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image003_thumb.png" width="356" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt; and then supply whatever additional information that will help you remember this data connection.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image004_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="313" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image004_thumb.png" width="361" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Click &lt;strong&gt;Finish&lt;/strong&gt;. Then define how you want to show the data in Excel - e.g. a pivot table.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image005_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="324" alt="clip_image005" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image005_thumb.png" width="367" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Click &lt;strong&gt;OK&lt;/strong&gt; which gives you the following:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image006_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="315" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image006_thumb.png" width="372" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;In the &lt;strong&gt;PivotTable Field List&lt;/strong&gt;, Expand &lt;strong&gt;Build Project&lt;/strong&gt; where you will find two fields: &lt;strong&gt;Static Analysis Errors&lt;/strong&gt; and &lt;strong&gt;Static Analysis Warnings&lt;/strong&gt;:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image007_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="143" alt="clip_image007" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image007_thumb.png" width="234" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;You can click the checkboxes to add these to the values for your table. In most cases &lt;strong&gt;Static Analysis Warnings&lt;/strong&gt; would be the most useful since &lt;strong&gt;Static Analysis Errors&lt;/strong&gt; would typically stop the build.&lt;/p&gt;    &lt;p&gt;To complete the picture you can play with the pivot table and pivot and filter as you see fit. As a simple example you can add the &lt;strong&gt;Build&lt;/strong&gt; field:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image008_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="107" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image008_thumb.png" width="235" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Which will give you one row per build in the pivot table.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image009_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="165" alt="clip_image009" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/ReportingCodeAnalysisDefectCounts_A7B3/clip_image009_thumb.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Of course this data can be combined with other build data and charted etc. according to your needs. We are considering what reporting to provide in future versions so would love to hear your feedback on this feature and what you would like to see.&lt;/p&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6958609" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>Come chat with the Code Analysis team tomorrow</title><link>http://blogs.msdn.com/fxcop/archive/2007/12/04/come-chat-with-the-code-analysis-team-tomorrow.aspx</link><pubDate>Tue, 04 Dec 2007 20:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6655538</guid><dc:creator>David M. Kean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/6655538.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=6655538</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=6655538</wfw:comment><description>&lt;P mce_keep="true"&gt;Join members of the Visual Studio Team System product group to discuss features available in Team Foundation Server, Team Suite, Architecture Edition, Development Edition, Database Edition, and Test Edition. In addition, discuss what's new for these editions for Visual Studio 2008.&lt;/P&gt;
&lt;P mce_keep="true"&gt;We will be holding two sessions:&lt;/P&gt;
&lt;P mce_keep="true"&gt;Join the &lt;A href="http://msdn.microsoft.com/chats"&gt;chat&lt;/A&gt; on Wednesday, December 5th, 2007 from 10:00am - 11:00am Pacific Time. &lt;A href="http://www.microsoft.com/communities/chats/vcs/07_1205_msdn_VSTS10.ics"&gt;Add to Calendar&lt;/A&gt; | &lt;A href="http://www.timeanddate.com/worldclock/fixedtime.html?month=12&amp;amp;day=5&amp;amp;year=2007&amp;amp;hour=10&amp;amp;min=0&amp;amp;sec=0&amp;amp;p1=234"&gt;Additional Time Zones&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -and-&lt;/P&gt;
&lt;P&gt;Join the &lt;A href="http://msdn.microsoft.com/chats"&gt;chat&lt;/A&gt; on Wednesday, December 5th, 2007 from 4:00pm - 5:00pm Pacific Time. &lt;A href="http://www.microsoft.com/communities/chats/vcs/07_1205_msdn_VSTS4.ics"&gt;Add to Calendar&lt;/A&gt; | &lt;A href="http://www.timeanddate.com/worldclock/fixedtime.html?month=12&amp;amp;day=5&amp;amp;year=2007&amp;amp;hour=16&amp;amp;min=0&amp;amp;sec=0&amp;amp;p1=234"&gt;Additional Time Zones&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6655538" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Metrics/default.aspx">Code Metrics</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>Try the Code Analysis Rule Sets Feature in the November &amp;quot;Rosario&amp;quot; November 2007 CTP</title><link>http://blogs.msdn.com/fxcop/archive/2007/11/28/try-the-code-analysis-rule-sets-feature-in-the-november-rosario-november-2007-ctp.aspx</link><pubDate>Thu, 29 Nov 2007 01:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6586375</guid><dc:creator>conorm</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/6586375.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=6586375</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=6586375</wfw:comment><description>&lt;p&gt;We have a great new feature that we are previewing in &lt;em&gt;Microsoft&amp;#174; Visual Studio&amp;#174; Team System code name &amp;#8220;Rosario&amp;#8221; November 2007 CTP&lt;/em&gt;.&amp;#160; This feature allows you to select pre-defined sets of rules to configure code analysis as well as define your own.&amp;#160; To access this feature right click on a project and choose &amp;quot;Properties&amp;quot; then click on the &amp;quot;Code Analysis&amp;quot; tab.&lt;/p&gt;  &lt;p&gt;This feature is in response to the feedback we received that the number of rules is overwhelming and difficult to configure.&lt;/p&gt;  &lt;p&gt;For this preview release we have focused on the core concept and made minimal changes to the UI.&amp;#160; In RTM we will have a new UI and a rich edit experience.&amp;#160; &lt;strong&gt;This release is all about getting your feedback&lt;/strong&gt;.&amp;#160; Try out this feature on your code, use the built-in rule sets and let us know what you think.&amp;#160; Tell us what we missed or what rules you think are there and should not be.&amp;#160; Your real-life experience is our best guide for this feature.&amp;#160; &lt;/p&gt;  &lt;p&gt;You can create a custom rule set to fine tune the exact rules to use.&amp;#160; If you think we should include your custom rule set in the out of the box sets then we want to hear from you (feedback links below).&amp;#160; Just attach the exported file to your connect bug or mail us.&lt;/p&gt;  &lt;p&gt;Some useful links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Release Post from JeffBe and download instructions - &lt;/strong&gt;&lt;a href="http://blogs.msdn.com/jeffbe/archive/2007/11/28/november-rosario-ctp-now-available.aspx"&gt;here&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Feedback - &lt;/strong&gt;bugs and suggestions can be submitted via &lt;a href="http://connect.microsoft.com/visualstudio"&gt;http://connect.microsoft.com/visualstudio&lt;/a&gt;. Make sure when you submit issues through Connect that you indicate the product version as being &amp;#8220;Visual Studio Team System Code Name &amp;#8220;Rosario&amp;#8221; (November 2007 CTP)&amp;#8221;. That will ensure it gets to the right folks for consideration. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Questions&lt;/strong&gt; - we&amp;#8217;ve created a special forum specifically focused on Rosario: &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1736&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1736&amp;amp;SiteID=1&lt;/a&gt; or you can respond to this blog post.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We look forward to hearing from you and hope you enjoy this new feature.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6586375" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Releases/default.aspx">Releases</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>Maintainability Index Range and Meaning</title><link>http://blogs.msdn.com/fxcop/archive/2007/11/20/maintainability-index-range-and-meaning.aspx</link><pubDate>Tue, 20 Nov 2007 19:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6437143</guid><dc:creator>conorm</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/6437143.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=6437143</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=6437143</wfw:comment><description>&lt;P&gt;Another question:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The maintainability index has been re-set to lie between 0 and 100.&amp;nbsp; How and why was this done?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The metric originally was calculated as follows (based on the work in Carnegie Mellon University although we modified the Halstead Volume calculation a little since we don't include comments anywhere in our calculation): Maintainability Index = 171 - 5.2 * ln(Halstead Volume) - 0.23 * (Cyclomatic Complexity) - 16.2 * ln(Lines of Code)&lt;/P&gt;
&lt;P&gt;This meant that it ranged from 171 to an unbounded negative number.&amp;nbsp; We noticed that as code tended toward 0 it was clearly hard to maintain code and the difference between code at 0 and some negative value was not useful.&amp;nbsp;&amp;nbsp; I'll post some tech ed sample code showing very low maintainability or you can try on your own code to verify.&amp;nbsp; As a result of the decreasing usefulness of the negative numbers and a desire to keep the metric as clear as possible we decided to treat all 0 or less indexes as 0 and then re-base the 171 or less range to be from 0 to 100. Thus, the formula we use is:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.sei.cmu.edu/str/descriptions/mitmpm.html" mce_href="http://www.sei.cmu.edu/str/descriptions/mitmpm.html"&gt;Maintainability Index&lt;/A&gt; = MAX(0,(171 - 5.2 * ln(Halstead Volume) - 0.23 * (Cyclomatic Complexity) - 16.2 * ln(Lines of Code))*100 / 171)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;On top of that we decided to be conservative with the thresholds.&amp;nbsp; The desire was that if the index showed red then we would be saying with a high degree of confidence that there was an issue with the code.&amp;nbsp; This gave us the following thresholds (as mentioned in this blog previously):&lt;/P&gt;
&lt;P&gt;For the thresholds we decided to break down this 0-100 range 80-20 so that we kept the noise level low and only flagged code that was really suspicious. We have:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;0-9 = Red&lt;/LI&gt;
&lt;LI&gt;10-19 = Yellow&lt;/LI&gt;
&lt;LI&gt;20-100 = Green&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6437143" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Metrics/default.aspx">Code Metrics</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>Code Metrics as Check-in Policy</title><link>http://blogs.msdn.com/fxcop/archive/2007/11/15/code-metrics-as-check-in-policy.aspx</link><pubDate>Fri, 16 Nov 2007 10:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6279586</guid><dc:creator>conorm</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/6279586.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=6279586</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=6279586</wfw:comment><description>&lt;P&gt;This is the first in a series of posts around questions I am getting asked related to code metrics.&lt;/P&gt;
&lt;P&gt;One question that is coming up is:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Can a check-in policy be defined based on code metrics in TFS?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Well, code metrics itself does not have a check-in policy but fortunately the Maintainability Index, Class Coupling, Depth of Inheritance and Complexity metrics are all available as rules in Code Analysis in Visual Studio.&amp;nbsp; This means you can use code analysis check-in policy enabled with those rules.&amp;nbsp; The rules are grouped under the "Maintainability Rules" Category and are configured as follows: &lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=621 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=160&gt;&lt;B&gt;Metric&lt;/B&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=245&gt;Corresponding Rule&lt;/TD&gt;
&lt;TD class="" vAlign=top width=214&gt;Threshold&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=160&gt;Depth of Inheritance&lt;/TD&gt;
&lt;TD class="" vAlign=top width=246&gt;CA1501 &lt;A href="http://msdn2.microsoft.com/en-us/library/ms182213(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms182213(VS.90).aspx"&gt;AvoidExcessiveInheritance&lt;/A&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=214&gt;Warning at above 5 levels deep&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=160&gt;Complexity&lt;/TD&gt;
&lt;TD class="" vAlign=top width=246&gt;CA1502 &lt;A href="http://msdn2.microsoft.com/en-us/library/ms182212(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms182212(VS.90).aspx"&gt;AvoidExcessiveComplexity&lt;/A&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=214&gt;Warning at above 25&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=160&gt;
&lt;P&gt;Maintainability Index&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=246&gt;CA1505 &lt;A href="http://msdn2.microsoft.com/en-us/library/bb386043(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb386043(VS.90).aspx"&gt;AvoidUnmaintainableCode&lt;/A&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=214&gt;Warning at below 20&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=160&gt;Class Coupling&lt;/TD&gt;
&lt;TD class="" vAlign=top width=246&gt;CA1506 &lt;A href="http://msdn2.microsoft.com/en-us/library/bb397994(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb397994(VS.90).aspx"&gt;AvoidExcessiveClassCoupling&lt;/A&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=214&gt;
&lt;P&gt;Warning at above 80 for class and above 30 for a method&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;In the policy editor this would look like the following: &lt;/P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" alt="Code Metrics as a check-in policy" src="http://blogs.msdn.com/blogfiles/conorm/WindowsLiveWriter/CodeMetricsasCheckinPolicy_F36A/image_2.png" border=0&gt; 
&lt;P&gt;This allows you to enforce that code meets these thresholds before check-in.&amp;nbsp; In future we are looking in to allowing the threshold values to be changed. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6279586" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Metrics/default.aspx">Code Metrics</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>FxCop 1.36 Beta Released!</title><link>http://blogs.msdn.com/fxcop/archive/2007/10/10/fxcop-1-36-beta-released.aspx</link><pubDate>Wed, 10 Oct 2007 23:09:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5393512</guid><dc:creator>David M. Kean</dc:creator><slash:comments>22</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/5393512.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=5393512</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=5393512</wfw:comment><description>&lt;p&gt;I'm pleased to announce that we've &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3389f7e4-0e55-4a4d-bc74-4aeabb17997b&amp;amp;displaylang=en"&gt;released a beta of the next version of FxCop&lt;/a&gt;. This release has a number of changes since FxCop 1.35, including, but not limited to, the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;200+ bug fixes that reduce noise, missing analysis and rule crashes &lt;/li&gt;    &lt;li&gt;Support for &lt;a href="http://blogs.msdn.com/fxcop/archive/2007/09/21/new-for-visual-studio-2008-support-for-anonymous-methods-and-lambda-expressions.aspx"&gt;analyzing anonymous methods and lambda expressions&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;New option for skipping analysis over tool generated code      &lt;ul&gt;       &lt;li&gt;Turn this on in the UI via &lt;strong&gt;Project&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Options&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Spelling &amp;amp; Analysis&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Suppress analysis results against generated code&lt;/strong&gt; &lt;/li&gt;        &lt;li&gt;Turn this on in the command-line via &lt;strong&gt;/ignoregeneratedcode&lt;/strong&gt; switch. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Better support for C++/CLI and the Compact Framework &lt;/li&gt;    &lt;li&gt;Language 'friendly' API names in the UI and resolutions (ie Visual Basic syntax if running over a Visual Basic binary) &lt;/li&gt;    &lt;li&gt;New globalization, design and usage rules &lt;/li&gt;    &lt;li&gt;Performance improvements that cut analysis by 2x and use half as much memory &lt;/li&gt;    &lt;li&gt;Documentation that is &lt;a href="http://msdn2.microsoft.com/en-us/library/bb429476(VS.80).aspx"&gt;now available on MSDN&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There are also some other underlying changes that I will talk about in some future posts. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3389f7e4-0e55-4a4d-bc74-4aeabb17997b&amp;amp;displaylang=en"&gt;Download it&lt;/a&gt;, and tell us what you think. If you have any feedback, bug reports or any questions, feel free to head over to the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=98&amp;amp;SiteID=1"&gt;Code Analysis&lt;/a&gt; forum and ask away.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5393512" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Releases/default.aspx">Releases</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category></item><item><title>New for Visual Studio 2008 - The 'Analyze' menu</title><link>http://blogs.msdn.com/fxcop/archive/2007/09/22/new-for-visual-studio-2008-the-analyze-menu.aspx</link><pubDate>Sat, 22 Sep 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5004975</guid><dc:creator>David M. Kean</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/5004975.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=5004975</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=5004975</wfw:comment><description>&lt;P&gt;While Ian Huff has already &lt;A href="http://blogs.msdn.com/ianhu/archive/2007/08/07/the-new-developer-menu-in-visual-studio-team-system.aspx" mce_href="http://blogs.msdn.com/ianhu/archive/2007/08/07/the-new-developer-menu-in-visual-studio-team-system.aspx"&gt;talked about the new 'Developer' menu&lt;/A&gt; that has been added to Visual Studio 2008, I thought I would briefly mention some of the changes to it that were made between Beta 2 and RTM.&lt;/P&gt;
&lt;P&gt;For those that have yet to see this menu, similar to the existing &lt;STRONG&gt;Test&lt;/STRONG&gt; menu, we've added a new top-level menu that will contain the Code Analysis, Code Metrics and Profiling menu items. This was done for discoverability reasons, and something we hope to leverage moving forward towards &lt;A href="http://msdn2.microsoft.com/en-us/teamsystem/bb725993.aspx" mce_href="http://msdn2.microsoft.com/en-us/teamsystem/bb725993.aspx"&gt;Rosario&lt;/A&gt;.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=312 alt="New Analyze menu" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008TheAnalyzemenu_11837/AnalyzeMenu_3.png" width=759 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008TheAnalyzemenu_11837/AnalyzeMenu_3.png"&gt; &lt;/P&gt;
&lt;P&gt;A quick rundown on some of the things that have changed since Beta 2:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Renamed the menu itself from the very non-specific &lt;STRONG&gt;Developer&lt;/STRONG&gt; to the little bit more descriptive &lt;STRONG&gt;Analyze.&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Removed the &lt;STRONG&gt;Code Analysis&lt;/STRONG&gt; and &lt;STRONG&gt;Code Metrics&lt;/STRONG&gt; sub menus and pulled their associated menu items up one level.&lt;/LI&gt;
&lt;LI&gt;Pulled &lt;STRONG&gt;New Diff Report&lt;/STRONG&gt; up one level and renamed it to &lt;STRONG&gt;Compare Performance Reports...&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Renamed the Code Metrics and Code Analysis menu items: &lt;BR&gt;&lt;STRONG&gt;Generate Code Metrics&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Calculate Code Metrics&lt;/STRONG&gt;. &lt;BR&gt;&lt;STRONG&gt;Migrate Code Analysis Policy Settings to Solution&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Code Analysis Settings for Solution&lt;/STRONG&gt;. &lt;BR&gt;&lt;STRONG&gt;Replace Code Analysis Settings with Code Analysis Policy Settings&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Replace with Check-in Policy &lt;BR&gt;&lt;/STRONG&gt;&lt;STRONG&gt;Add Code Analysis Policy Settings to Code Analysis Settings&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Merge with Check-in Policy &lt;BR&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I probably don't have to tell that these changes, that we made to increase the usability of the menu, are great improvements, especially the renaming of probably what would have been in the running for the longest menu item in Visual Studio; &lt;STRONG&gt;Replace Code Analysis Settings with Code Analysis Policy Settings.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;While a very small addition to Visual Studio 2008, we hope the new &lt;STRONG&gt;Analyze&lt;/STRONG&gt; menu helps improve your workflow when working with the Code Analysis and Profiler features.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5004975" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Metrics/default.aspx">Code Metrics</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>New for Visual Studio 2008 - Support for anonymous methods and lambda expressions</title><link>http://blogs.msdn.com/fxcop/archive/2007/09/21/new-for-visual-studio-2008-support-for-anonymous-methods-and-lambda-expressions.aspx</link><pubDate>Fri, 21 Sep 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5017697</guid><dc:creator>David M. Kean</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/5017697.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=5017697</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=5017697</wfw:comment><description>&lt;P&gt;One of my favorite new features for Code Analysis in Visual Studio 2008 is our support for analyzing anonymous methods and lambda expressions. While anonymous methods have been around in C# since Visual Studio 2005, lambda expressions are new for both C# and Visual Basic in Visual Studio 2008. &lt;/P&gt;
&lt;P&gt;For those that are already familiar with the concept of anonymous methods (if not &lt;A href="http://msdn.microsoft.com/msdnmag/issues/06/00/C20/default.aspx" mce_href="http://msdn.microsoft.com/msdnmag/issues/06/00/C20/default.aspx"&gt;check out this article&lt;/A&gt;), lambda expressions provide a simpler, more concise syntax for writing inline methods. They also serve as the underpinnings of Linq. &lt;/P&gt;
&lt;P&gt;Take the following code written in Visual Studio 2005 which converts a list of strings to uppercase, for example: &lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;internal&lt;/FONT&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;class&lt;/SPAN&gt; &lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN style="COLOR: rgb(43,145,175)"&gt;StringFormatter&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;string&lt;/SPAN&gt;&amp;gt; ToUpper(&lt;SPAN style="COLOR: rgb(43,145,175)"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;string&lt;/SPAN&gt;&amp;gt; values, &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;CultureInfo&lt;/SPAN&gt; culture)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;return&lt;/SPAN&gt; values.ConvertAll(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;delegate&lt;/SPAN&gt;(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;string&lt;/SPAN&gt; value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;return&lt;/SPAN&gt; value.ToUpper(culture);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;Using the new lambda syntax, the equivalent can be written in C# and Visual Basic like so: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT face="courier new,courier"&gt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;internal&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;class&lt;/SPAN&gt; &lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN style="COLOR: rgb(43,145,175)"&gt;StringFormatter&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;string&lt;/SPAN&gt;&amp;gt; ToUpper(&lt;SPAN style="COLOR: rgb(43,145,175)"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;string&lt;/SPAN&gt;&amp;gt; values, &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;CultureInfo&lt;/SPAN&gt; culture)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;return&lt;/SPAN&gt; values.ConvertAll(value =&amp;gt; value.ToUpper(culture));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Friend&lt;/FONT&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Module&lt;/SPAN&gt; StringFormatter&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Function&lt;/SPAN&gt; ToUpper(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;ByVal&lt;/SPAN&gt; values &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;As&lt;/SPAN&gt; List(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;String&lt;/SPAN&gt;), &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;ByVal&lt;/SPAN&gt; culture &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;As&lt;/SPAN&gt; CultureInfo) &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;As&lt;/SPAN&gt; List(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;String&lt;/SPAN&gt;)&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Return&lt;/SPAN&gt; values.ConvertAll(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Function&lt;/SPAN&gt;(value) value.ToUpper(culture))&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;End&lt;/SPAN&gt; &lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Function&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Module&lt;/SPAN&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;To understand how lambda expressions and anonymous methods are implemented underneath in IL (which is important for a tool like Code Analysis that runs over the binary and not the source), see the great in-depth posts by Raymond Chen for C# (&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2006/08/02/686456.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2006/08/02/686456.aspx"&gt;Parts 1&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/oldnewthing/archive/2006/08/03/687529.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2006/08/03/687529.aspx"&gt;2&lt;/A&gt;, and &lt;A href="http://blogs.msdn.com/oldnewthing/archive/2006/08/04/688527.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2006/08/04/688527.aspx"&gt;3&lt;/A&gt;) and Jared Parsons for Visual Basic &lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/02/closures-in-vb-part-1.aspx"&gt;(Parts 1&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/03/closures-in-vb-part-2-method-calls.aspx"&gt;2&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/vbteam/archive/2007/05/25/closures-in-vb-part-3-scope.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/05/25/closures-in-vb-part-3-scope.aspx"&gt;3&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/vbteam/archive/2007/06/15/closures-in-vb-part-4-variable-lifetime.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/06/15/closures-in-vb-part-4-variable-lifetime.aspx"&gt;4&lt;/A&gt; and &lt;A href="http://blogs.msdn.com/vbteam/archive/2007/07/26/closures-in-vb-part-5-looping.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/07/26/closures-in-vb-part-5-looping.aspx"&gt;5&lt;/A&gt;). Once you've read those posts, you'll understand why Code Analysis didn't get support for this for free.&lt;/P&gt;
&lt;P&gt;What does this mean for Code Analysis users? Well, previously, in Visual Studio 2005, the engine would simply skip over these constructs and the user wouldn't find out about any violations, if any, contained within them. The good news is that we will now analyze them. The bad news is that any project making heavy use of anonymous methods is likely no longer Code Analysis clean on its upgrade to Visual Studio 2008. ;)&lt;/P&gt;
&lt;P&gt;For a little more information on Code Analysis's support of anonymous methods, see the following topic: &lt;A href="http://msdn2.microsoft.com/en-us/library/bb514189(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb514189(VS.90).aspx"&gt;Anonymous Methods and Code Analysis&lt;/A&gt; (code formatting to be fixed for RTM).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; These is a bug in Beta 2 that prevents Code Analysis from analyzing lambdas/anonymous methods that access any locals or parameters outside of its own scope. This will be fixed in RTM of Visual Studio 2008.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5017697" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item></channel></rss>