SPCAF : A very useful code analysis tool for SharePoint

In the last 5 days, my mission was to analyze a set of SharePoint solutions that was developed during 6 months and to write a document that lists things that should be fixed or enhanced. Usually, my analysis tasks is based on FxCop,SPDisposeCheck and Source code analysis. This time i've googled a littled bit in order to see if there is a tool that could help me automating my task. After 2 minutes of search, i found a tool in Microsoft Visual Studio Gallery called : SPCAF (SharePoint Code Analysis Framework).It is still in BETA version.

SPCAF cannot only analyze assemblies like other tools as FxCop or SPDisposeCheck. It can also analyze 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.

The tool can be run in 5 different modes :

  • Integrated with visual studio 2012/2010
  • Client application
  • Integrated into a Team Build
  • Command line
  • MSBuild Task
Client Application

Integrated with Visual Studio

SPCAF client application is able to analyse SharePoint solution without the need of source code. You'll have to use the WSP files as an input to SPCAF. Differents analysis rules are available. 
SPCAF generates 4 types of reports :
  • Rules Report
  • Code metrics Report
  • Dependencies Report
  • Inventory Report
It is amazing how the tool is useful. One of the best advantages of this tool is that it doesn't only tell what's wrong but also how to fix that error.

Great thanks to Torsten Mandelkow and Matthias Einig :)



Enregistrer un commentaire