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
(References: added link to more CodePlex custom rules projects, and to Wikipedia article)
(References: re-organized references, added additional links)
Line 4: Line 4:
 
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 [[FxCop#References | 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.
 
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 [[FxCop#References | 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.
  
== References ==
+
== Resources ==
 +
=== Tool, Documentation and Community ===
 
* Download - [http://code.msdn.microsoft.com/codeanalysis FxCop v1.35]
 
* Download - [http://code.msdn.microsoft.com/codeanalysis FxCop v1.35]
 
* Download - [http://www.microsoft.com/downloads/details.aspx?familyid=3389F7E4-0E55-4A4D-BC74-4AEABB17997B&displaylang=en FxCop v1.36 (beta)]
 
* Download - [http://www.microsoft.com/downloads/details.aspx?familyid=3389F7E4-0E55-4A4D-BC74-4AEABB17997B&displaylang=en FxCop v1.36 (beta)]
 +
* Download - [ FxCop v1.32] - necessary if you wish to perform analysis of code written in Visual Studio 2003 or earlier
 
* Download - [http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=556 Rules comparison spreadsheet] - documenting the rules differences between those shipped with FxCop and the Visual Studio Code Analysis feature
 
* Download - [http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=556 Rules comparison spreadsheet] - documenting the rules differences between those shipped with FxCop and the Visual Studio Code Analysis feature
 
* Documentation - [http://msdn.microsoft.com/library/bb429476.aspx FxCop] - MSDN documentation for FxCop
 
* Documentation - [http://msdn.microsoft.com/library/bb429476.aspx FxCop] - MSDN documentation for FxCop
Line 13: Line 15:
 
* Blog - [http://blogs.msdn.com/fxcop/ Microsoft Code Analysis Team blog] - addresses both the standalone FxCop tool as well as the Visual Studio Code Analysis feature
 
* Blog - [http://blogs.msdn.com/fxcop/ Microsoft Code Analysis Team blog] - addresses both the standalone FxCop tool as well as the Visual Studio Code Analysis feature
 
* Blog - [http://davesbox.com/ Dave's Box] - personal blog written by a member of Microsoft's Code Analysis team
 
* Blog - [http://davesbox.com/ Dave's Box] - personal blog written by a member of Microsoft's Code Analysis team
* CodePlex project - [http://www.codeplex.com/JSLFxCop JSL FxCop] - open-source utility to help build custom FxCop rules
+
* Article - [http://blogs.microsoft.co.il/blogs/sasha/archive/2007/02/10/Run-FxCop-from-Code.aspx Run FxCop from Code]
* CodePlex project - [http://www.codeplex.com/CSAR Community Static Analysis Rules] - "a community-based project for creating a set of static analysis rules to extend those provided by the FxCop team."
+
* Article - [http://weblogs.asp.net/rosherove/archive/2007/02/24/writing-real-unit-tests-for-your-custom-fxcop-rules.aspx Writing Real Unit Tests for your Custom FxCop Rules]
* CodePlex project - [http://www.codeplex.com/LephoneFxCopRules Lephone FxCop Rules] - simple set of custom rules and the source code to create them
+
 
* CodePlex project - [http://code.msdn.microsoft.com/InfoXchange CustomFxCop] - implements "...new rule sets to check variable naming conventions in a project. This will really help projects to automate their code review process."
+
=== Custom Rules and other third-party Enhancements ===
* CodePlex project - [http://www.codeplex.com/fxcopdelta FxCop Delta] - "a custom check-in policy for Visual Studio Team System that runs FxCop rules before performing a check-in."
+
* [http://www.codeplex.com/JSLFxCop JSL FxCop (CodePlex)] - open-source utility to help build custom FxCop rules, as well as many custom rules.
* CodePlex project - [http://www.codeplex.com/FinRadFxCopStats FinRad Statistics Collector for FxCop] - "...intended to help development teams to track the progress of an FxCop backlog cleanup effort."
+
* [http://www.codeplex.com/CSAR Community Static Analysis Rules (CodePlex)] - "a community-based project for creating a set of static analysis rules to extend those provided by the FxCop team."
* Google project - [http://code.google.com/p/smokey/ Smokey] - tool similar to FxCop for analysing managed code; has 220 separate rules.
+
* [http://sourceforge.net/projects/tngfxcoprules/ TeachNaGeamhradh FxCop Rules (SourceForge)] - "A growing collection of rules and experimentation with FxCop to provide a comprehensive list of rules that are useful against the .Net assemblies."
* ''(CodePlex project - [http://code.msdn.microsoft.com/CustomRulesinFxcop CustomRules in FxCop] - '''DEAD project''')''
+
* [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.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://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://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://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://code.msdn.microsoft.com/CustomRulesinFxcop CustomRules in FxCop] - '''DEAD CodePlex project''')''
 +
 
 +
=== Similar Tools for .NET code analysis ===
 +
* [http://code.google.com/p/agentsmithplugin/ Agent Smith Plugin] - "Agent Smith is C# code style validation plugin for ReSharper (Visual Studio plugin)."
 +
* [http://code.google.com/p/agentjohnsonplugin/ Agent Johnson Plugin] - "Plugin for JetBrains ReSharper", performing limited code analysis, refactoring and fixups on C# code.  
 +
* [http://code.google.com/p/smokey/ Smokey (Google Code)] - tool similar to FxCop for analysing managed code; has 220 separate rules.

Revision as of 21:55, 20 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

  • JSL FxCop (CodePlex) - open-source utility to help build custom FxCop rules, as well as many custom rules.
  • Community Static Analysis Rules (CodePlex) - "a community-based project for creating a set of static analysis rules to extend those provided by the FxCop team."
  • TeachNaGeamhradh FxCop Rules (SourceForge) - "A growing collection of rules and experimentation with FxCop to provide a comprehensive list of rules that are useful against the .Net assemblies."
  • Lephone FxCop Rules (CodePlex) - a small set of custom rules
  • 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."
  • 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."
  • 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."
  • FxCopUnit - "A framework for integrated FxCop rule testing"
  • FxCop Delta (CodePlex) - "a custom check-in policy for Visual Studio Team System that runs FxCop rules before performing a check-in."
  • FinRad Statistics Collector for FxCop (CodePlex) - "...intended to help development teams to track the progress of an FxCop backlog cleanup effort."
  • (CustomRules in FxCop - DEAD CodePlex project)

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.