Monday, April 30, 2007

* Tool : FxCop - Managed Code Analysis

FxCop is a tool provided by Microsoft for managed code analysis. Its an excellent tool for doing a quality check on your code during and post development.

The documentation provided with FxCop is excellent for beginners so i will not demonstrate how to use the tool. I will list down some of the features of this tool to encourage you to start using this tool if you are not using it till now.

  • Its main objective is to check managed code for programming & design guidelines and report issues if there are any.
  • It is available both with GUI and as a command line tool to get integrated into automated build process. FxCop.exe is with GUi and FxCopCmd.exe is command line tool.
  • It comes by default with lot of best practices rules for programming and design in areas of Naming, performance, security etc.
  • Custom rules can be added and existing rules can be suppressed based on requirement.
  • It can be used to view IL stored in assemblies.
  • It can also be used for finding Managed & Full Binding closure of assemblies.
  • Can be used as an external command in Visual Studio
  • Some of the rules available by default are :
    • Validate Arguments of Public Methods
    • Mark assemblies with assembly version
    • Specify CultureInfo
    • Compound words should be cased correctly
    • Avoid unused parameters
  • With minimum of overhead this tool can bring lot of quality add to your application.

FxCop can be download from FxCop Team Page.

Other Posts

1 comment:

Patrick said...

Folks interested in FxCop should have a glance at the tool NDepend:
http://www.NDepend.com

NDepend analyses source code and .NET assemblies. It allows controlling the complexity, the internal dependencies and the quality of .NET code.

NDepend provides a language (CQL Code Query Language) dedicated to query and constraint a codebase.

It also comes from with advanced code visualization (Dependencies Matrix, Metric treemap, Box and Arrows graph...), more than 60 metrics, facilities to generate reports and to be integrated with mainstream build technologies and development tools.

NDepend also allows to compare precisely different versions of your codebase.

Post a Comment