Search code examples
c#.netnantmetrics

Free Code Metrics Tool for .NET (should be callable directly from NAnt via Console)


I am looking for a free code metrics tool for .NET (mainly C# language). I have searched the web, but haven't found anything that matches my requirements.

Requirements:

  1. LOC and CC metrics (mainly)
  2. NAnt intregration is possible
  3. No configuration file needed (provide the source files and config parameter via console arguments)
  4. HTML output (or XML if GUI exists to view the file)

So road so far:

  1. NDepend (Commercial)
  2. Source Monitor (No good integration)
  3. Code Metrics Plugin for Reflector (No console, any way to use it?)

If you use one of these tools (except NDepend; Commercial) I would like to hear your nant integration.


Solution

  • Regarding SourceMonitor I don't agree with You. We have integrated SourceMonitor in our Continuous Integration Environment and call it through NAnt via command line. Passing the arguments by a configuration file is easy when You use a template and NAnt's <filterchain> function. The output is XML which we transform through XSLT into a user friendly report.

    Find more Information on Richard Banks' blog. Some of the examples are CruiseControl.NET realated but I'm sure You can cherry pick the stuff relevant to You.