Wednesday, September 17, 2008

What is FxCop ?

What is FxCop ?



FxCop analyses programming elements in assemblies, called targets, and provides an informational report containing messages about the targets. FxCop represents the checks it performs during an analysis as rules. A rule is managed code that ‘analyses a target ‘and returns a message about its findings. Rule messages identify any relevant programming and design issues and, when possible, supply information on how to fix the target. Suggested improvements are often based on the .NET Framework Design Guidelines, which are, aswe have already learnt, Microsoft’s guidelines for writing robust and easily maintainable code using the .NET Framework.

FxCop analyses .NET assemblies for potential code compliance problems and forms part of static code analysis. With static code analysis the compiled code is checked for compliance to identify possible defects before executing the code.


FxCop is a mature tool. The first version of FxCop was released to the public shortly after the release of the .NET Framework 1.0 itself in 2002. In summer 2007, FxCop was awarded the Chairman's Award for Engineering Excellence by Microsoft chairman Bill Gates. This award reflected the substantial improvement FxCop has made to development and testing practices of managed code at Microsoft. FxCop is now integrated with Visual Studio as a part of the Visual Studio Team System code analysis features.



The .NET Framework includes an API for examining assembly metadata in the System.Reflection namespace. Rules in early versions of FxCop examined code directly through the reflection API. However, reflection has some limitations that become evident when used in a tool such as FxCop.


FxCop solves this problem by providing an alternate, similar technology called introspection. The API is similar to reflection but offers generally improved analysis features and is overall more suitable for FxCop than the reflection API.


Some of the less frequently used node types are Node,AssemblyReference,AttributeNode,Expression,(numerous),Instruction,Member,EventNode,EventNode,Field,Method,InstanceInitializer,StaticInitializer ,PropertyNode,TypeNode, ClassNode, DelegateNode, EnumNode,InterfaceNode, Struct ,ModuleNode, AssemblyNode, ModuleReference, SecurityAttribute, Statement.



1 comment:

Unknown said...

Are itna badaa code likh diya...