Code Analysis Framework for SharePoint - SPCAF (Beta) released

I recently came across a code analysis tool for SharePoint, SPCAF beta that hekps you analyze the SharePoint code, The analysis includes the following:
 
This code analysis framework is capable of analyzing all the XML code in SharePoint packages like Features, ContentTypes, ListTemplates and all the other files like controls (.ascx), pages (.aspx) and master pages (.master) etc along with analyzing the assemblies like other tools like FxCop does.
 
The analysis of code includes:
  1. SharePoint solutions (.wsp) built on MOSS 2007, SharePoint 2010 and SharePoint 15
  2. Apps for SharePoint
SPCAF provides a client application to analyze existing WSP packages, can be integrated into a Team Build via a custom build activity, it can run on command line or as MSBuild task during each local build.
 
We can use SPCAF directly in Visual Studio 2010 or 2012 to analyze SharePoint projects. Below figure shows how SPCAF can be used in Visual Studio.
 
 

Using SPCAF in Visual Studio

 


Errors and Warnings in Visual Studio

As mention earlier the SPCAF can be used to analyze the existing solutions (.wsp) or apps. Below figure shows the same.
 
Client Application for Analyzing WSP and Apps 
 

Following are the highlights of SPCAF:
  • Contains ~300 rules to validate SharePoint code for correctness, solution design, best practices etc..
  • Creates dependency diagrams in DGML to visualize dependencies within SharePoint code
  • Can be seamlessly integrated into your development process
  • Provides a client application to analyze WSP and APP files.
  • Can also be run during a Team Build (supports TFS 2010 and TFS 2012)
  • Can be extended with custom rules or custom metrics
The result of the analysis includes:
  • Rules report to show errors and warnings
  • Inventory report listing all the contents of the packages
  • Metric report, showing complexity and amount of elements in the code
  • Dependency diagram to see the package dependencies 

Below diagram shows the visual dependency

Visual Dependency Diagram 

The beta version of SPCAF can be downloaded from here

 
 

No comments:

Post a Comment