Visual Studio Code Analysis and Code Metrics announcement
-
Link
This forum has been locked; it will still be available for review in the Archived Forums folder. Any future posts on this topic should be put in the Visual Studio Debugger forum.
-
Link
Version 10.0 of FxCop is the version that ships with Visual Studio 2010 Premium. FxCop 10.0 is part of Version 7.1 of the Microsoft Windows SDK for Windows 7 and .NET Framework 4.
Instructions
- Download the Microsoft Windows SDK for Windows 7 and .NET Framework 4 Version 7.1
- Using elevated privileges execute FxCopSetup.exe from the %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop folder.
-
Link
Please see our blog for a description of the new Code Analysis functionality available in Visual Studio 2010: http://blogs.msdn.com/codeanalysis/archive/2010/03/22/what-s-new-in-code-analysis-for-visual-studio-2010.aspx
-
Link
Following is a collection of Frequently Asked Questions (FAQ) regarding PreFAST, FxCop, Managed Code Analysis and Code Metrics.
Visual Studio 2010 Rule Sets
Question: How do I ensure that the same code analysis rule set is used for all the projects developed by my team(s)?
Answer: See JB Browns blog post on this topic.
Rule Behavior
Question: Why does FxCop generate violations against itself?
Answer: Answered on the FxCop blog.
Question: Why do some sources recommend extending ApplicationException while FxCop does not?
Answer: Answered on the FxCop blog.
Question: Why does FxCop ignore my in-code (SuppressMessageAttribute) suppressions?
Answer: Answered on the FxCop blog.
Question: Why does DoNotExposeGenericLists recommend that I expose Collection<T> instead of List<T>?
Answer: Answered on the FxCop blog.
Question: How do I indicate to DoNotDeclareReadOnlyMutableReferenceTypes that a type is immutable?
Answer: Answered on the FxCop blog.
Custom Rule Development
Question: How do I integrate my custom FxCop rules into Visual Studio 2010?
Answer: Answered on the FxCop blog.
Question: Where is the official FxCop custom rules SDK?
Answer: There is currently no official custom rules SDK developed by Microsoft. The primary reason is that we are currently rewriting key components of the FxCop metadata reader and data flow analysis engine. This work guarantees that rules written today will need to be modified or entirely re-written in the future. Rules developers who have been working in FxCop for the past few years can attest to the fact that every release has involved some churn in the custom rules API. Each release readme contains detailed information about porting existing rules to the latest architecture.
As soon as the FxCop metadata and other relevant API stabilize sufficiently, we will develop an official FxCop custom rules SDK with samples demonstrating common patterns written in several languages. Until then, there are several resources available to custom rules developers:
· This forum. Post your rules development questions here.
· Rules samples uploaded to the MSDN Code Gallery. Search for 'FxCop'.
· Rules samples developed externally. Search the web for 'fxcop' and 'rules'
· Visit the custom rules category on the FxCop blog
Question: How do I integrate custom rules with Visual Studio?
Answer: Answered on the FxCop blog.
Question: How do I access the locals for a method?
Answer: Answered on the FxCop blog.
-
2 Votes
FxCop 1.36 Released!
We've released FxCop 1.36. See the following for more information: http://blogs.msdn.com/fxcop/archive/2008/08/19/fxcop-1-36-released.aspxSticky | 9 Replies | 64111 Views | Created by Haiying Xu - MSFT - Tuesday, August 19, 2008 8:41 PM | Last reply by Kiran Boligarla - Wednesday, April 27, 2011 4:51 AM -
3 Votes
Tell me what kind of Custom Rule you want to write!!!
I am a program manager for our Code Analysis system. I want to know what kind of custom rules you would like to write. Ignore what you may or may not know about what's in FxCop ...Sticky | 82 Replies | 55541 Views | Created by Joe Rohde - Wednesday, July 4, 2007 1:35 AM | Last reply by Santiago Pontiroli - Friday, May 11, 2012 7:19 PM -
0 Votes
FxCop Blogs
Following is a list of blogs containing FxCop content and by FxCop team members. FxCop Team Blog http://blogs.msdn.com/fxcop Visual Studio Team System ...Sticky | 0 Replies | 34074 Views | Created by David M. Kean - Thursday, April 13, 2006 2:06 PM | Last reply by David M. Kean - Thursday, April 13, 2006 2:12 PM
-
0 Votes
FxCopCmd.exe exit codes
Hi everyone out there! I've been using fxcopcmd.exe from MsBuild and I keep getting a 513 exit code after running the analysis. Do you know what this code means? Is there a place online where I can ...Answered | 2 Replies | 19196 Views | Created by acyment - Tuesday, July 3, 2007 5:54 PM | Last reply by - Wednesday, December 12, 2012 11:37 AM -
0 Votes
Question about CA1819: PropertiesShouldNotReturnArrays
Heya folks, i have a property that returns a byte array /// <summary> /// Binary data of the ringtone. /// </summary> public byte[] ...Answered | 6 Replies | 16461 Views | Created by Pure Krome - Sunday, January 29, 2006 3:48 AM | Last reply by Dynavics - Wednesday, December 12, 2012 8:31 AM -
0 Votes
VS2012 Code Analysis Window Doesn't Work
I've been working on transitioning our team to VS2012 and I actually thought the Code Analysis window wasn't supposed to work if building any project that includes v4 tools and/or targeting .NET 4.0. ...Answered | 3 Replies | 6415 Views | Created by Scott C Parillo - Sunday, December 2, 2012 4:35 PM | Last reply by Jack Zhai-MSFT - Tuesday, December 11, 2012 5:31 AM -
1 Votes
VS2012 Impacts VS2010 Code Analysis?
I have read a couple of MSDN posts on this topic but they appear to be different issues. We did some experiments in a VM whereby both VS2010 and VS2012 are installed side-by-side since this is the ...Answered | 9 Replies | 10038 Views | Created by Scott C Parillo - Tuesday, November 20, 2012 12:42 AM | Last reply by Scott C Parillo - Tuesday, December 11, 2012 2:25 AM -
0 Votes
Daily, weekly, monthly, yearly sales report in crystal report.
hi ! can some help me in making report for my Point of sales and inventory system?im making report as it will allow the user to choose from daily, weekly, monthly, quarterly, ...Answered | 1 Replies | 9208 Views | Created by Wil sara - Thursday, December 6, 2012 11:52 AM | Last reply by Jack Zhai-MSFT - Friday, December 7, 2012 10:31 AM -
0 Votes
VS 2012 / FxCop / Spelling
Hi, I'm struggling with the custom dictionary. I've got a class "OAuthToken" that fires CA1704 because "Auth" is unknown. Basically that's ...Answered | 4 Replies | 6067 Views | Created by MIrle - Wednesday, December 5, 2012 11:39 AM | Last reply by MIrle - Friday, December 7, 2012 9:55 AM -
0 Votes
Code Coverage with VSTools using Visual Studio 2010
I wanted to use Code Coverage using Visual Studio 2010 ultimate edition. My requirement is to have vsinstr.exe and VSPerfCmd.exe available as part of VS ...Answered | 3 Replies | 7043 Views | Created by _Pankaj - Tuesday, November 27, 2012 3:27 AM | Last reply by Jack Zhai-MSFT - Tuesday, December 4, 2012 1:58 AM -
0 Votes
Prefast not detecting SAL errors
Visual Studio 2008 9.0.30729.1 SP .NET Framework 3.5 SP1 WinDDK 7600.16385.1 The Prefast option resolves to the ...Unanswered | 3 Replies | 9263 Views | Created by John Thewlis - Wednesday, September 7, 2011 3:29 PM | Last reply by sergei_vorobiev - Monday, December 3, 2012 10:28 AM -
0 Votes
How does VS 2010 and VS 2012 know which version of fxcopcmd.exe to use?
A developer on my team was evaluating VS 2012 with a project that performs code analysis. He found that a greater number of fails occured against the same ...Answered | 7 Replies | 11896 Views | Created by StevenIBSI - Friday, September 21, 2012 8:13 PM | Last reply by Jesse Houwing - Thursday, November 29, 2012 12:25 PM -
0 Votes
Code Analysis errors are not showing line details in Vsts 2012
Hi, I have installed vsts 2012 on my machine and enabled code analysis for my projects. I made all the code analysis warnings to appear as ...Answered | 2 Replies | 5714 Views | Created by Sirisha M - Tuesday, November 27, 2012 1:17 PM | Last reply by Sirisha M - Thursday, November 29, 2012 12:01 PM -
0 Votes
FxCop 10 report with absent exclusions in source information
Hi all, with FxCop 1.35 we did something like this within a FxCop project file: <SaveMessages> <Project Status="Active, Excluded" ...Proposed | 11 Replies | 6889 Views | Created by Peter Brightman - Tuesday, October 16, 2012 1:27 PM | Last reply by Peter Brightman - Monday, November 26, 2012 9:23 AM -
0 Votes
FxCop custom rule to check the use of property
I want to check if the code has been used visible property. How to check the check method in FxCop ? Thanks.Answered | 3 Replies | 6252 Views | Created by damiano626 - Monday, November 19, 2012 2:53 PM | Last reply by Jia Xuan 2010 - Friday, November 23, 2012 6:04 AM -
1 Votes
How to know the method that hangs in .net process built on release
I have the dump files of a .net process that hangs in an unknown location. I need to know the method where the hang is occurring. The application is very complex with many threads, ...Answered | 1 Replies | 5387 Views | Created by Baron Alep - Sunday, November 18, 2012 2:32 PM | Last reply by Jack Zhai-MSFT - Tuesday, November 20, 2012 6:12 AM -
0 Votes
FxCop update for VS 2012 and .NET 4.5
Will there be an update to the stand alone FxCop (FxCop 11?) to support code analysis outside of VS 2012 for the non-premium/ultimate SKU's and to support .NET 4.5?Answered | 2 Replies | 19793 Views | Created by Carel.Lotz - Friday, September 14, 2012 9:21 AM | Last reply by Carel.Lotz - Monday, November 19, 2012 10:10 AM -
0 Votes
ReviewSqlQueriesForSecurityVulnerabilities Missing Rule
Hi, I am using VS2010 Pro edition which means I don't get FxCop Code Analysis pre-integrated. I downloaded FxCop 1.36 separately and running it. However, FxCop does not seem to have ...Answered | 1 Replies | 5295 Views | Created by Khalid Ashraf - Friday, November 16, 2012 5:10 PM | Last reply by Jesse Houwing - Friday, November 16, 2012 5:57 PM -
0 Votes
Code Analysis Error CA0001: An unknown error occurred while running Code Analysis
I have inherited a rather large and old code base. I'm interested in running code analysis to identify dead code. There's lots of it and it's driving me crazy. I'm getting the error ...Answered | 2 Replies | 9220 Views | Created by Arhiannas - Tuesday, November 6, 2012 7:43 PM | Last reply by Jack Zhai-MSFT - Tuesday, November 13, 2012 2:16 AM -
6 Votes
Code metrics for unmanaged C++ code?
Does code metrics in Visual Studiu 2008 Tema System work for unmanaged C++ code?Answered | 28 Replies | 37989 Views | Created by Anchy - Wednesday, October 8, 2008 10:15 AM | Last reply by Harry Martyrossian - Friday, November 9, 2012 4:44 AM -
1 Votes
How can I integrating latest Window SDK developer tools with VS 2008 professional edition so that I can use the \Analyze Static code analysis feature.
I have a Visual Studio 2008 professional edition. I know that VS 2008 Professional edition does not contain the /Analyze feature , but I have read some where that I can integrate the latest ...Answered | 3 Replies | 5237 Views | Created by 27Prac - Wednesday, October 31, 2012 11:32 AM | Last reply by Jesse Houwing - Thursday, November 1, 2012 8:31 AM -
1 Votes
FxCop 1.36: 'Referenced assembly could not be found' for assemblies in GAC
I am using FxCop 1.36 and VS2008 SP1. We have a number of solutions and projects in our organization. Some are placed in the GAC by a post-build ...Answered | 6 Replies | 12359 Views | Created by jonwithoutanh - Thursday, October 2, 2008 7:37 PM | Last reply by Jesse Houwing - Friday, October 26, 2012 9:23 PM -
0 Votes
"Object is currently in use elsewhere" error for picturebox
Hello everyone, I created a GUI for plotting values in a picture box. I get values from a serial port every hour, store it in an array then plot those values using ...Discussion | 1 Replies | 6452 Views | Created by TrinetteK - Monday, October 22, 2012 7:32 AM | Last reply by Jack Zhai-MSFT - Tuesday, October 23, 2012 10:02 AM - Items 1 to 20 of 2883 Next ›
Visual Studio Code Analysis and Code Metrics announcement
-
Link
This forum has been locked; it will still be available for review in the Archived Forums folder. Any future posts on this topic should be put in the Visual Studio Debugger forum.
-
Link
Version 10.0 of FxCop is the version that ships with Visual Studio 2010 Premium. FxCop 10.0 is part of Version 7.1 of the Microsoft Windows SDK for Windows 7 and .NET Framework 4.
Instructions
- Download the Microsoft Windows SDK for Windows 7 and .NET Framework 4 Version 7.1
- Using elevated privileges execute FxCopSetup.exe from the %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop folder.
-
Link
Please see our blog for a description of the new Code Analysis functionality available in Visual Studio 2010: http://blogs.msdn.com/codeanalysis/archive/2010/03/22/what-s-new-in-code-analysis-for-visual-studio-2010.aspx
-
Link
Following is a collection of Frequently Asked Questions (FAQ) regarding PreFAST, FxCop, Managed Code Analysis and Code Metrics.
Visual Studio 2010 Rule Sets
Question: How do I ensure that the same code analysis rule set is used for all the projects developed by my team(s)?
Answer: See JB Browns blog post on this topic.
Rule Behavior
Question: Why does FxCop generate violations against itself?
Answer: Answered on the FxCop blog.
Question: Why do some sources recommend extending ApplicationException while FxCop does not?
Answer: Answered on the FxCop blog.
Question: Why does FxCop ignore my in-code (SuppressMessageAttribute) suppressions?
Answer: Answered on the FxCop blog.
Question: Why does DoNotExposeGenericLists recommend that I expose Collection<T> instead of List<T>?
Answer: Answered on the FxCop blog.
Question: How do I indicate to DoNotDeclareReadOnlyMutableReferenceTypes that a type is immutable?
Answer: Answered on the FxCop blog.
Custom Rule Development
Question: How do I integrate my custom FxCop rules into Visual Studio 2010?
Answer: Answered on the FxCop blog.
Question: Where is the official FxCop custom rules SDK?
Answer: There is currently no official custom rules SDK developed by Microsoft. The primary reason is that we are currently rewriting key components of the FxCop metadata reader and data flow analysis engine. This work guarantees that rules written today will need to be modified or entirely re-written in the future. Rules developers who have been working in FxCop for the past few years can attest to the fact that every release has involved some churn in the custom rules API. Each release readme contains detailed information about porting existing rules to the latest architecture.
As soon as the FxCop metadata and other relevant API stabilize sufficiently, we will develop an official FxCop custom rules SDK with samples demonstrating common patterns written in several languages. Until then, there are several resources available to custom rules developers:
· This forum. Post your rules development questions here.
· Rules samples uploaded to the MSDN Code Gallery. Search for 'FxCop'.
· Rules samples developed externally. Search the web for 'fxcop' and 'rules'
· Visit the custom rules category on the FxCop blog
Question: How do I integrate custom rules with Visual Studio?
Answer: Answered on the FxCop blog.
Question: How do I access the locals for a method?
Answer: Answered on the FxCop blog.