views:

31

answers:

2

Does anyone know of a stand-alone tool for C# code cleaning/auditing that can run outside of Visual Studio IDE so as to be part of a build. Or if that isn't possible can someone provide some guidance as to how to make Visual Studio part of a build process -- by that I mean it would be nice to run the IDE's Sort and Remove unused using statements on all files as part of the build, but even better would be an exe that can read the .sln, or .csproj and do the job as part of build system.

Thanks, L-

A: 

If by code 'auditing', you mean Code Analysis, then you can FXCop. It can run from outside visual studio if you want and can also be integrated as part of MSBuild or the Team Build process.

If you want to enforce style and consistency rules, then use StyleCop.

If you use Visual Studio Team System, it also has inbuilt CA process. Check these guidelines for using Code Analysis (this has to be used from within VS though)

desigeek
A: 

The following tools can be used in build scripts:

  • SD C# Metrics: Computes SLOC, Comments, Cyclomatic, Halstead, ... to the method level
  • SD C# CloneDR: finds exact and near-miss duplicate code across very large code bases
  • SD C# TestCoverage: determines test coverage of compiled code based on whatever testing methodology you use after builds.
Ira Baxter