CITcon 2007: Code Metrics

Eric PughApril 28, 2007

Notes from the Code Metric’s session:

What kind of code metrics do you collect?

  • Complexity
  • Coverage
  • Dependencies
  • Documentation
  • Code Style
  • of unit tests, line of code

  • Code Duplicates
  • Volatility
  • Velocity

Great first metric is volatility or churn: the number of commits in a specific area contracted to complexity. Volatility comes from version control data, complexity is produced by a script. Gives you a solid feel of where potential bugs are, typically where there are lots of commits in a complex area as measured by your complexity tool.

“Cyclomatic Complexity” apparently has lots of research behind it proving that high complexity leads to bugs, and that this is really good spot to look at in reducing code.

Metrics are much more valuable when you have them in a historical context. Hackystat (a favored tool of mine!) gets a plug. Sabre has developed a home grown system that parses reports and adds them to Mysql… They could use HackyStat for similar function.

Demo/introduction of Panopticode. Visualizes metrics with the goal of making the use of metrics simple and ubiquitous.

I think I’ll be looking very closely at Panopticode, and how visualizations can help make metrics more relevant to management and teams, versus just some charts that are never acted on.




More blog articles:


Let's do a project together!

We provide tailored search, discovery and analytics solutions using Solr and Elasticsearch. Learn more about our service offerings