I’m sure you have heard of Ohloh, the site that tracks progress and code/documentation contributions to free and open source software projects. What a lot of people (even today) don’t realize is that ohcount, the tool used to track the metrics of the projects is free software under the terms of the GPL v2 (only).
I first tried it well over a year ago, and realized today that I forgot to re-install it after upgrading my OS (using Ubuntu still, just the latest and greatest). It was pretty painless. You’ll need the following dependencies:
ruby rake rubygems
ragel swig gprof
Caveat – make sure you install gprof before attempting the build, otherwise nothing you do will get the parser to compile. The documentation does not mention a dependency on gprof, and its not one of those cases where you can keep trying the build while installing whatever comes up missing next.
Once you have it, as root copy ohcount to /usr/local/bin/ohcount, chmod 755 and viola, its available system wide. If you haven’t seen it, here’s a screen shot of what it produces (in the simplest form) when run inside a repository:
Ohcount Results - Click To Enlarge
As you can see, its very handy to have these metrics available when you want them. Sure, you could just register your project on Ohloh and get the same, but you might not want to do that for various reasons. It might just be a personal / hobby project that you don’t want to share with the world, a project for your company that you CAN’T share with the world, or maybe you just don’t want to wait for Ohloh to update again.
If its not obvious, its written mostly in ruby using SWIG for extensions. I wonder why more distributions don’t package it?
I like the nice overview it provides, especially the comment percentage and blank line count.