Microsoft Source Analysis for C#

Microsoft released a new cool tool called Microsoft Source Analysis for C#.  It's an internal tool that does somewhat FxCop does.  While FxCop analyse the IL, Source Analysis analyse the source code itself.  It comes with about 200 built in rules that are however not customizable.  These rules cover:

  • Microsoft Layout of elements, statements, expressions, and query clauses
  • Placement of curly brackets, parenthesis, square brackets, etc
  • Spacing around keywords and operator symbols
  • Line spacing
  • Placement of method parameters within method declarations or method calls
  • Standard ordering of elements within a class
  • Formatting of documentation within element headers and file headers
  • Naming of elements, fields and variables
  • Use of the built-in types
  • Use of access modifiers
  • Allowed contents of files
  • Debugging text

After installation, the tool is integrated into the VS 2005 or 2008 IDE.  You can right click in the code window to analyse that code:

Or right click on the project name in the Solution Explorer to analyse the whole project:

From the same menu, you can change the tool's settings:

The results are displayed in the same area as the Output window:


You can read about Source Analysis for C# here:
http://blogs.msdn.com/sourceanalysis/

You can download it here:
http://code.msdn.microsoft.com/sourceanalysis/Release/ProjectReleases.aspx?ReleaseId=1047

 

3 Comments

Comments have been disabled for this content.