This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "FxCop"

From OWASP
Jump to: navigation, search
(Similar Tools for .NET code analysis: added link to Phoenix, Gendarme, MD-codeanalysis)
(Custom Rules and other third-party Enhancements: added links to GotDotNet samples pulled from Archive.org)
Line 25: Line 25:
 
* [http://www.codeplex.com/LephoneFxCopRules Lephone FxCop Rules (CodePlex)] - a small set of custom rules
 
* [http://www.codeplex.com/LephoneFxCopRules Lephone FxCop Rules (CodePlex)] - a small set of custom rules
 
* [http://code.msdn.microsoft.com/InfoXchange CustomFxCop (CodePlex)] - implements "...new rule sets to check variable naming conventions in a project. This will really help projects to automate their code review process."
 
* [http://code.msdn.microsoft.com/InfoXchange CustomFxCop (CodePlex)] - implements "...new rule sets to check variable naming conventions in a project. This will really help projects to automate their code review process."
* [http://code.google.com/p/findbugs-fxcop/ findbugs-FxCop] - "This project will produce custom rules for FxCop, that will look for coding mistakes similar to those found by FindBugs, such as infinite recursive loops and ignored return values."
+
* [http://code.google.com/p/findbugs-fxcop/ findbugs-FxCop (Google Code)] - "This project will produce custom rules for FxCop, that will look for coding mistakes similar to those found by FindBugs, such as infinite recursive loops and ignored return values."
* [http://web.archive.org/web/20040724165715/http://tatochip.com/archive/2004/07/19/2678.aspx fxcop rule : checking for IDataReader in method parameters] - a single FxCop rule in source code form
+
* [http://web.archive.org/web/20040724165715/http://tatochip.com/archive/2004/07/19/2678.aspx Custom FxCop rule : checking for IDataReader in method parameters (Archive.org)] - a single FxCop rule in source code form
* [http://sourceforge.net/projects/fxdeputy/ FxDeputy] - "This project is of use to anyone writing rules for the FxCop checker for .NET. This provides a framework that will allow you to tag tests with attributes that will provide you with control of what tests are run against your rules."
+
* [http://web.archive.org/web/20060313113313/www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=14DEFFCB-9C2B-4C38-BEEC-AB860084E372 Custom FxCop rule: demonstrates extracting literal arguments from method call (Archive.org)] - a single FxCop rule in source code form
* [http://weblogs.asp.net/rosherove/archive/2007/02/24/introducing-fxcopunit-a-framework-for-integrated-fxcop-rule-testing.aspx FxCopUnit] - "A framework for integrated FxCop rule testing"
+
* [http://web.archive.org/web/20070826010853/www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B397F7AD-4811-45DE-9A6A-33F818994CB1 Custom FxCop rules: No Numerals in Variable Names, Naming Constants (Archive.org)] - two FxCop rules in source code form
 +
* [http://web.archive.org/web/20060427042023/www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=01D9F014-5F73-4D66-8E74-C658944180DD Custom FxCop 1.32 rule: detects calls to specific API] - a single FxCop 1.32 rule in source code form
 +
* [http://web.archive.org/web/20060313113430/www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=0BE37E51-6A0E-4E8E-A61F-84A388000859 Custom FxCop 1.32 rule: detects calls to specific API] - a single FxCop 1.32 rule in source code form
 +
* [http://web.archive.org/web/20060313113604/www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=BFBB8D82-678A-4E58-A305-5B00FDE900DB Custom FxCop 1.32 rules] - some FxCop 1.32 rules in source code form
 +
* [http://sourceforge.net/projects/fxdeputy/ FxDeputy (SourceForge)] - "This project is of use to anyone writing rules for the FxCop checker for .NET. This provides a framework that will allow you to tag tests with attributes that will provide you with control of what tests are run against your rules."
 +
* [http://weblogs.asp.net/rosherove/archive/2007/02/24/introducing-fxcopunit-a-framework-for-integrated-fxcop-rule-testing.aspx FxCopUnit (ASP.NET blogs)] - "A framework for integrated FxCop rule testing"
 
* [http://www.codeplex.com/fxcopdelta FxCop Delta (CodePlex)] - "a custom check-in policy for Visual Studio Team System that runs FxCop rules before performing a check-in."
 
* [http://www.codeplex.com/fxcopdelta FxCop Delta (CodePlex)] - "a custom check-in policy for Visual Studio Team System that runs FxCop rules before performing a check-in."
 
* [http://www.codeplex.com/FinRadFxCopStats FinRad Statistics Collector for FxCop (CodePlex)] - "...intended to help development teams to track the progress of an FxCop backlog cleanup effort."
 
* [http://www.codeplex.com/FinRadFxCopStats FinRad Statistics Collector for FxCop (CodePlex)] - "...intended to help development teams to track the progress of an FxCop backlog cleanup effort."
 +
* [http://web.archive.org/web/20070825153755/www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=BCFB8E54-989A-4464-BDB0-3C3B9B3F1346 FxCopReportAll.xsl (Archive.org)] - GotDotNet sample "style sheet for report that shows all Active and Excluded Messages."
 
* ''([http://code.msdn.microsoft.com/CustomRulesinFxcop CustomRules in FxCop] - '''DEAD CodePlex project''')''
 
* ''([http://code.msdn.microsoft.com/CustomRulesinFxcop CustomRules in FxCop] - '''DEAD CodePlex project''')''
  

Revision as of 08:32, 21 July 2008

What is FxCop?

FxCop is a free code analysis tool developed by Microsoft, use to analyze MSIL (Microsoft Intermediate Language) generated from any managed language (including C# and VB.NET).

FxCop is a standalone .NET 2.0 application, downloadable from the locations referenced below. A modified version of the FxCop codebase is integrated into Microsoft Visual Studio 2005 and 2008. While the rulebase for each is mostly the same, there are notable differences between the two (see the Rules comparison spreadsheet below), and the compiled format for custom rules is different; thus, one cannot generally develop custom rules that can be used natively in both contexts.

Resources

Tool, Documentation and Community

Custom Rules and other third-party Enhancements

Similar Tools for .NET code analysis

  • Agent Smith Plugin - "Agent Smith is C# code style validation plugin for ReSharper (Visual Studio plugin)."
  • Agent Johnson Plugin - "Plugin for JetBrains ReSharper", performing limited code analysis, refactoring and fixups on C# code.
  • Smokey (Google Code) - tool similar to FxCop for analysing managed code; has 220 separate rules.
  • Phoenix - an SDK from MS Research labelled as "...the software optimization and analysis framework that is the basis for all future Microsoft® compiler technologies. The Phoenix framework is an extensible system that can be adapted to read and write binaries and Microsoft Intermediate Language assemblies and represent the input files in an Intermediate Representation, which can be analyzed and manipulated by applications by using the Phoenix API."
  • Gendarme - "Gendarme is a extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compiler do not typically check or have not historically checked."
  • md-codeanalysis - "MonoDevelop.CodeAnalysis is an addin that integrates both Gendarme and Smokey into MonoDevelop."