Sloccount – A source code analyzer

I just discovered David A. Wheeler’s SLOCCount software :) This software aims at analyzing the source code of a project and producing statistics about it such as used languages, number of files, number of lines etc… It has an embedded file duplicate detection allowing to produce smart statistics. And it is even able to estimate the development efforts to create the software (duration of the developments, number of developers and cost). Of course, I had to test it on OpenViBE.

So I created symlinks to each trunc of each project in the latest SVN (2535). It can easily be achieved using this basic script (assuming that you create a temporary folder in the svn root) :

#!/bin/sh
for d in `find .. -wholename ../openvibe*trunc`; do
    l=`echo “$d” | sed “s#^\.\./##g” | sed “s#/#-#g”`
    echo $l
    ln -s “$d” “$l”
done

Then I run David A. Wheeler’s SLOCCount using almost only its default settings (just specifying it should follow the symlinks I just created) :

$ sloccount –follow .

number of lines for each language:

Totals grouped by language (dominant language first):
cpp: 111066 (63.87%)
xml: 62568 (35.98%)
php: 236 (0.14%)
sh: 30 (0.02%)

estimation of devel efforts and price:

Total Physical Source Lines of Code (SLOC) = 173,900

Development Effort Estimate, Person-Years (Person-Months) = 45.01 (540.16)
  (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))

Schedule Estimate, Years (Months) = 2.28 (27.31)
  (Basic COCOMO model, Months = 2.5 * (person-months**0.38))

Estimated Average Number of Developers (Effort/Schedule) = 19.78

Total Estimated Cost to Develop = $ 6,080,737
  (average salary = $56,286/year, overhead = 2.40).

I counted 160k lines of codes a few months ago which is consistent with what SLOCCount returns…

I think I should deduce that we’ve been pretty slow for the development since it should have been done in less than 2 years and a half – But I should also deduce that we’ve been pretty good if we consider that this development should have been done by almost 20 people :)

I also tried to tell SLOCCount that each OpenViBE project is a separate project. In theory, there could be people working in parallel on each of them so it gives different statistics :

$ sloccount –follow –multiproject .

estimation of devel efforts and price:

Total Physical Source Lines of Code (SLOC) = 173,900

Development Effort Estimate, Person-Years (Person-Months) = 39.78 (477.34)
  (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))

Schedule Estimate, Years (Months) = 1.51 (18.14)
  (Basic COCOMO model, Months = 2.5 * (person-months**0.38))

Total Estimated Cost to Develop = $ 5,373,522
  (average salary = $56,286/year, overhead = 2.40).

So we should finally have done that software in a year and a half :) ! Again, the Person-Years estimate is much over the real values… But overall, those statistics seem to make sense.

And the Total Estimated Cost to Develop estimation should probably appear somewhere on the download page…

One Comment to “Sloccount – A source code analyzer”

  1. yarikoptic 24 December 2010 at 5:04 am #

    you might also like to expose openvibe to ohloh.net

    IOT is already there:
    http://www.ohloh.net/p/iot-project