tags:

views:

94

answers:

3

Are there any good code measuring tools available?

I found code measure pretty useful and interesting, but I don't think I can pay $1K/year for just using the measuring tool.

I imagine there might be a tool that is/can

  • open source software
  • language independent
  • OS independent
  • measure the metrics from different categories : LOC, LOC without blank lines, Number of functions ...
+3  A: 

For basic line-count metrics like the ones you describe, try cloc.

My 2c-worth: code metrics are generally worse than useless. The only value I've ever gotten out of them is to measure the efficiency of one language against another.

Marcelo Cantos
Cloc is good, I use it for all my projects where I care about line count.
tomdemuyt
Which metrics are you talking about as "worse than useless"? Your statement is too broad to help.
Andy Dent
@Andy: Pretty much all of them: lines of code, cyclomatic complexity, defect injection rates, etc. On one occasion, after I had reduced several thousands lines of code down to a 200-line code-gen script, a colleague who was obsessed with metrics told me that my code was of average quality, because my defect-injection-rate-to-LOC ratio was par for the language we were using. It didn't bother him at all that the LOC had dropped by an order of magnitude while the defect count remained unchanged. Metrics help when you bake cookies every day, not when everything you write is brand new.
Marcelo Cantos
@Marcelo, thanks for the story as defect-injection-rate-to-LOC ratio sounds seductively useful, especially to management, and it's nice to have a counter-example. Have you considered any of the OO quality metrics such as SOLID and the Chidamber and Kemerer metrics? They are the ones I'm most interested in, especially how they change in a project. As someone who aims to improve code, LOC is a metric I've long ignored. Good code often gets smaller.
Andy Dent
Marcelo Cantos
A: 

With 82 code metrics supported NDepend is the code metrics Roll's Royce tooling for .NET developers.

Patrick Smacchia - NDepend dev
A: 

Sonar is a Java based server side application for code measurement. It is mostly targeting Java, but support for other languages is available via plugins.

Timo Westkämper