views:

581

answers:

4

Is there some free tool (preferably command line based) that you can give your root source directory and it will inspect all files and sub-folders and generate a set of nice "statistics"? Like... lines of code, number of classes, etc?

I just thought it would be quite a nice and interesting way for us to keep track of the project's growth.

+4  A: 

Source Monitor from http://www.campwoodsw.com/ will do that and one hell of a lot more. Works with C#. VB.NET, C, C++ and others, either from the command line or its own GUI. It's free & it's great.

anon
A: 

G'day,

It doesn't really matter what you use if you're tracking project growth just so long as you are consistent in your measurement approach.

You could even use a grep for trailing semi-colons as a simple measure of SLOC.

HTH

cheers,

Rob Wells
+7  A: 

I use CLOC (http://cloc.sourceforge.net/). Works great, and supports a ton of languages. Command line based, has a lot of options (exports stats into xml/csv too, so you can programatically dig into the stats easily)

Yuvi
cloc is nice. I especially like its scaling factor that tries to give rough complexity comparisons between different languages. Does anyone know good front-end tools to turn its output into web pages (graphs, blah, blah). Understanding the relative size of different projects (all written by the same team, so they're comparable), helps us in our scheduling of new projects that are of similar size.
Rob Napier
A: 

There's the CodeMetrics Add-In for .NET Reflector; I don't know of a way to run it from the command-line, but it might be possible. Are you wanting to use this in a CI build? It works on assemblies, not source code.

TrueWill