<?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 Policy</title><link>http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx</link><description>Tags: Code Analysis Policy</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>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>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>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 - Code Analysis Policy improvements</title><link>http://blogs.msdn.com/fxcop/archive/2007/09/20/new-for-visual-studio-2008-code-analysis-policy-improvements.aspx</link><pubDate>Thu, 20 Sep 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5002817</guid><dc:creator>David M. Kean</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/5002817.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=5002817</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=5002817</wfw:comment><description>&lt;P&gt;One not very well known feature that lights up when connected to a Team Foundation Server, is the ability to enforce that Code Analysis be run before every check-in. Called a &lt;EM&gt;Code Analysis Policy&lt;/EM&gt;, this feature allows your team to find and fix Code Analysis warnings earlier in the product cycle rather than later, where code changes are riskier and more expensive to make.&lt;/P&gt;
&lt;P&gt;To add a Code Analysis Policy to a Team Project, see the following topic on the MSDN Library, &lt;A href="http://msdn2.microsoft.com/en-us/library/ms181459(vs.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms181459(vs.90).aspx"&gt;How to: Add Check-In Policies&lt;/A&gt;.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=646 alt="Code Analysis Policy Editor dialog" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyEditor_3.png" width=703 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyEditor_3.png"&gt; &lt;/P&gt;
&lt;P&gt;In Visual Studio 2005, while a useful feature, there were a few usability issues that customers ran into time and time again:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Migrating the Code Analysis settings stored in the policy on the Team Foundation Server to the individual projects was confusing. At times, I literally sat in amazement as I watched my own colleagues new to Code Analysis Policy struggle to perform the (what should have been an easy) task of finding a menu item. &lt;/LI&gt;
&lt;LI&gt;Once the settings had been migrated, users were confused as to why the settings in the individual projects didn't match exactly what was stored in the project. For example, rules turned off in the policy, were still turned on in the project. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Our team actually knew about the confusion that issue 2 would cause when Visual Studio 2005 shipped. Surprisingly as it sounds, this behavior was actually the lesser of two evils. With the time that was available in the ship cycle they knew that they had two distinct choices, either a) have the policy completely override the settings stored in the project, or b) merge the policy settings with the project settings. Because a) prevented the scenario of allowing users to turn on more rules than the policy specified (in effect being stricter than the policy), the later was chosen as the preferred behavior.&lt;/P&gt;
&lt;P&gt;Issue 1 was somewhat of a surprise. Code Analysis Policy along with the rest of Code Analysis was a late edition to Visual Studio 2005, probably too late to get any real user feedback and perform any actionable usability studies. We didn't hear about the troubles users were having with this until after the product had already shipped.&lt;/P&gt;
&lt;P&gt;Once Visual Studio 2008 planning began, improving both of these issues was one of our top priorities, so we set about a &lt;A href="http://search.live.com/results.aspx?q=%22feature+crew%22+microsoft&amp;amp;src=IE-SearchBox" mce_href="http://search.live.com/results.aspx?q=%22feature+crew%22+microsoft&amp;amp;src=IE-SearchBox"&gt;feature crew&lt;/A&gt; to fix it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Code Analysis Policy Failure Details dialog&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Clearly users were first of all struggling to actually perform the migration; they were told by the Policy Failure that their projects settings were out-of-date, but not actually how to go about updating them. Even if they somehow figured out that a menu item might do this, looking intuitively on the individual project's context menus didn't help - the menu item that performed the job, &lt;STRONG&gt;Migrate Code Analysis Policy Settings to Solution &lt;/STRONG&gt;(what a mouthful!),&lt;STRONG&gt; &lt;/STRONG&gt;was hidden under &lt;STRONG&gt;File&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Source Control&lt;/STRONG&gt; and on the solution's context menu.&lt;/P&gt;
&lt;P&gt;The first thing we did to solve this confusion was to add a new dialog (displayed when double-clicking on a Code Analysis policy failure) that provided extra information about the situation they were in, what projects were out-of-date and how to go about solving it.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG height=569 alt="New Code Analysis Policy Failures Details dialog" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyFailuresDialog_3.png" width=867 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyFailuresDialog_3.png"&gt;&lt;/P&gt;
&lt;P&gt;We also chose to tell them at this time that their build date was out-of-date - something that we previously only told them after they had updated their project settings and then attempted to check-in again (breaking their workflow).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;New Policy Menu Items&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The way to solve the second issue was easy; provide the user a choice:&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=220 alt="New Code Analysis Policy menus" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyMenus_8.png" width=532 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyMenus_8.png"&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Some users preferred policy to win out and completely overwrite the local project settings, whereas, others wanted to be able to specify additional rules above and beyond what was specified in the policy (ie the current Visual Studio 2005 behavior). The new &lt;STRONG&gt;Analyze&lt;/STRONG&gt; menu (which I'll talk about in a future post), now provides two menu items, &lt;STRONG&gt;Replace with Check-in Policy&lt;/STRONG&gt; and &lt;STRONG&gt;Merge with Check-in Policy&lt;/STRONG&gt;, for performing both of these actions, respectively.&lt;/P&gt;
&lt;P&gt;Hopefully these changes will make using Code Analysis Policy a little more pleasant experience in Visual Studio 2008. The new dialog and menu items themselves made into Beta 2 (albeit with slightly different text and names), so &lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;install it&lt;/A&gt; today and tell what you think.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5002817" 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/Configuration/default.aspx">Configuration</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>TIP: Scope the Code Analysis Policy to apply to specific source control paths/file types</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/30/tip-scope-the-code-analysis-policy-to-apply-to-specific-source-control-paths-file-types.aspx</link><pubDate>Tue, 30 Jan 2007 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1554234</guid><dc:creator>ravkaur</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/1554234.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=1554234</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=1554234</wfw:comment><description>&lt;P&gt;On the forums, we have had posts&amp;nbsp; 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:&amp;nbsp; &lt;A href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1080300&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1080300&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1080300&amp;amp;SiteID=1&lt;/A&gt; ] There is now a way to configure code analysis policy to apply to specific source control paths/file types. Check out the tool on gotdotnet that helps you to do so. &lt;A href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=96d7da50-0d61-4230-9af9-49684ae9881e" mce_href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=96d7da50-0d61-4230-9af9-49684ae9881e"&gt;http://www.gotdotnet.com/codegallery/codegallery.aspx?id=96d7da50-0d61-4230-9af9-49684ae9881e&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here's what you need to do (Part of the steps are also in the readme for the custom path policy)&lt;/P&gt;
&lt;P&gt;a) Download the custom code analysis policy from the location specified on the link. This is a project and you will need to build it.&lt;/P&gt;
&lt;P&gt;b) Launch Regedit (or any other registry editor of choice), and navigate to the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\TeamFoundation\SourceControl\Checkin Policies &lt;/P&gt;
&lt;P&gt;c) Add a string value called "CustomPathPolicy" – set the value to the path where the DLL is located, such as: C:\SD_TIDM\Technical Integration\CustomPathPolicy\Extensibility\bin\Debug\CustomPathPolicy.dll &lt;/P&gt;
&lt;P&gt;Once the registry key is set up, follow these steps to set up the custom policy.&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add code analysis policy to the team project via Team Project Settings -&amp;gt; Source Control -&amp;gt; Check in Policy&lt;/LI&gt;
&lt;LI&gt;Click "Add" again and select "Custom Path Filter" item, which will invoke the Edit dialog.&lt;/LI&gt;
&lt;LI&gt;From the dropdown, select 'Code Analysis'&lt;/LI&gt;
&lt;LI&gt;Enter the regex path filters to which the policy should apply to, click add, repeat as needed.&lt;/LI&gt;
&lt;LI&gt;Click OK to save the settings.&lt;/LI&gt;
&lt;LI&gt;Disable the original code analysis policy set in step 1). If this is not done, the policy will be evaluated twice.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Once you have this set up, the code analysis policy will apply to only paths that you have specified. One thing to keep in mind is that migrating code analysis settings to solution does not respect the paths set in the custom path policy. i.e. Migrating code analysis policy settings to solution will migrate to all projects within the solution, not just the ones specified in the custom path policy.&amp;nbsp; &lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1554234" 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/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category></item></channel></rss>