Calculate code metrics

NDepend for .net


Sonar is definitively a tool that you must consider, especially for Java projects. However it will also handle PHP or C/C++, Flex and Cobol code.

Here is a screenshot that show some metrics on a project:

alt text http://sonar.codehaus.org/wp-content/uploads/2009/05/squid-metrics.png

Note that you can try the tool by using their demo site at http://nemo.sonarsource.org


On my latest project I used SourceMonitor. It's a nice free tool for code metrics analysis.
Here is an excerpt from SourceMonitor official site:

  • Collects metrics in a fast, single pass through source files.
  • Measures metrics for source code written in C++, C, C#, VB.NET, Java, Delphi, Visual Basic (VB6) or HTML.
  • Includes method and function level metrics for C++, C, C#, VB.NET, Java, and Delphi.
  • Saves metrics in checkpoints for comparison during software development projects.
  • Displays and prints metrics in tables and charts.
  • Operates within a standard Windows GUI or inside your scripts using XML command files.
  • Exports metrics to XML or CSV (comma-separated-value) files for further processing with other tools.

For .NET beside NDepend which is simply the best tool, I can recommend vil.

Following tools can perform trend analysis:

  • CAST
  • Klocwork Insight

Tags:

Metrics