wtorek, 18 września 2012

FxCop - code analysis tool

About FxCop?
FxCop, is a code analysis tool that checks managed code assemblies for conformance to Microsoft .NET Framework design guidelines.



FxCop makes it easy for developers to learn the correctness rules that modern application development requires. The resulting application is easier to understand and maintain—it runs more reliably and with fewer security errors.

It uses introspection, MSIL parsing, and call graph analysis to inspect assemblies for more than 200 defects in the following areas: Library design, Localization, Naming conventions, Performance, Security. Introspection is described as a new faster, engine for performing Reflection on .NET classes .The main advantages of introspection engine are it performs a more extensive analysis than reflection, multithreading, analysis of assemblies of different versions of the framework, ability to Managed Extensions for C++ executables, and non-locking behaviour.

The rules enforced by FxCop are based on the "Microsoft .NET Framework Design Guidelines." These guidelines are based on how the .NET team wants you to use the .NET Framework. FxCop works quite differently than many other "code analysis" tools. Other code analysis tools typically work by scanning your source code, running it through a number of rules, and checking whether your code complies with these rules or not. If your code doesn't comply with a rule, then the tool throws out a message with an explanation of what's "wrong" with your code.
The difficulty these code analysis tools have to deal with is analyzing your code. Some tools work better then others. The more difficult your code the harder the code analysis tool has to work. FxCop is also called a code analysis tool but it doesn't really look at your source code. It looks at your compiled assemblies and by doing so avoids the common pitfalls many other code analysis tools have. The tool doesn't have to deal with the complexities of analyzing your source and understanding all the different ways how you can write and format your code. FxCop reads the meta-data of an assembly and with the meta-data knows exactly what your code is doing.


The following are the main improvements and features in the new version of FxCop.
- Perform analysis through Introspection
- Faster code analysis and supports multithreaded analysis
- Ability to resolve missing dependencies
- Powerful dataflow analysis
- Many UI Improvements
- More rules, rule topics and rule fixes



Download:
Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO)

The Windows SDK provides tools, compilers, headers, libraries, code samples, and a new help system that developers can use to create applications that run on Microsoft Windows.

FxCop Installation Instructions
1. Download the Microsoft Windows SDK for Windows 7 and .NET Framework 4 version 7.1.
2. Run %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop\FxCopSetup.exe to install FxCop.


How it's look like:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMVD21_Nfdgv_lvFPLgdA6eIOyP2B5yfiLeZXTd_CMli-cu5FFLW6hBBXoXrdfVGJjvqKSIHU_luoaVKz49f2aCbnmw0rntZgKBNejM-c_C_W0Ho5y3q-rxd9BFfK4jQoiWJ_y1zP_z6c/s1600/3.png

FxCop MSDN



Writing Quality Code MSDN



FxCop Integrator allows to integrate stand-alone FxCop and Code Metrics PoewrTool into VS2010. You can analysis your source code on VS2010 Pro.

FxCop Integrator homepage

Brak komentarzy:

Prześlij komentarz