28 February 2014

FxCop and StyleCop

It runs on compiled DLLs.
As it runs on compiled IL code, it can be used for C#, VB.NET, in short any language which compiles to IL code.
Keep in mind that it is not a Microsoft product. It is not even a Team System Power Tool. It is a tool developed by a very passionate developer at Microsoft (on evenings and weekends). There's no support, servicing, evolution or anything else beyond what he can get done in his spare time. Style checking is an interesting feature and may show up in an official product at some point down the road.
It runs on actual source code.
Currently it runs only on C#.
The ultimate goal of StyleCop is to allow to produce elegant, consistent code that team members and others who view developer code will find highly readable.
Code Analysis
No spell checking - FxCop uses a dictionary (plus custom dictionary) to check the names of methods, classes, etc. Code Analysis doesn't seem to do that.
Help - FxCop not only complained when something was wrong but provided a great deal of help/hints to resolve the problem. Code Analysis just seems to present the problem with no sign of a hint.
Note that Code Analysis is only available in the Premium and Ultimate editions of Visual Studio 2010 and also Visual Studio 2005 & 2008 Team System.

FxCop analyzes programming elements in managed assemblies, called targets, and provides an informational report that contains messages about the targets, Messages include suggestions about how to improve the source code used to generate them. FxCop represents the checks it performs during an analysis as rules. A rule is managed code that can analyze targets and return a message about its findings. Rule messages identify any relevant programming and design issues and, when possible, supply information about how to fix the target.
Using FxCop, you can perform the following tasks:
Control which rules are applied to targets.
Exclude a rule message from future reports.
Apply style sheets to FxCop reports.
Filter and save messages.
Save and reuse application settings in FxCop projects.
Working in the FxCop Application Window
The FxCop application window displays the targets and rules included in a project, and the messages that are generated when an analysis is performed. The window is divided into three major areas: the configuration pane on the left, the messages pane on the right, and the properties pane at the bottom.

No comments: