Browsing the archives for the ohloh tag.

Ohcount and Count Lines of code

Coding

Ohcount and Count Lines of Code (CLOC) counts size of code project. Mostly these aren’t very useful applications, but it is fun to see that I have written 300 lines of code in couple of days.

Ohcount is used Ohloh to generate source code reports. I was disappointed to found that i can’t use Ohcount to scan whole history of my repository, it only scans current status of code.

CLOC is written in Perl and Ohcount in Ruby. It maybe little annoying to compile Ohcount from source, but it is much faster than CLOC. If you want something that is easy to install, take CLOC. But if you are going to analysis more often than once, try Ohcount.

Here is example output from CLOC:


96 text files.
83 unique files.
33 files ignored.
http://cloc.sourceforge.net v 1.08 T=7.0 s (8.9 files/s, 547.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code scale 3rd gen. equiv
-------------------------------------------------------------------------------
PHP      49    588   172     1950 x 3.50    = 6825.00
SQL      1     58    87      277  x 2.29     = 634.33
BASH     10    54    133     261  x 3.81     = 994.41
CSS      1     46    5       192  x 1.00     = 192.00
Python   1     2     1       6    x 4.20       = 25.20
-------------------------------------------------------------------------------
SUM: 62 748 398 2686 x 3.23 = 8670.94
-------------------------------------------------------------------------------

And here is Ohcounts output from same file:

Examining 555 file(s)......

Ohloh Line Count Summary

Language Files Code Comment Comment % Blank Total
---------------- ----- --------- --------- --------- --------- ---------
php      58    2146 219     9.3%      716  3081
sql      1     277  87      23.9%     58   422
html     60    242  1       0.4%      38   281
css      1     192  5       2.5%      46   243
python   1     6    1       14.3%     2    9
---------------- ----- --------- --------- --------- --------- ---------
Total 121      2863 313     9.9%      860  4036

- Gestalts -------------------------------------------------------------------
Platforms: PHP, SQL, Scripting

Yep. There is some difference on results. I don’t know which one is more accurate.

I haven’t posted for a while because I have coded my main project. It isn’t public, but I will blog about it when it is ready. :) I try to blog more often.

No Comments

Ohloh

Internet

Ohloh is social website for aimed open source developers. It is also great way to find nice open source projects.

Anyone can add a open source project to Ohloh and then Ohloh uses svn (or git) to download projects source code for analyzing. After analyzing you can see how many lines of code is on example Vim, Firefox or even Linux Kernel. Also smaller projects are analyze not just, major softwares. There is also commit history and cool graphs that show amount of code lines.

There is also social part. Registered users can add information to profile and update a twitter like “journal”. The idea of journal is cool, but it is hard to get every one on project to use it actively.

Ohloh is great website for open source developer. I recommend it for everyone who writes open code and likes web 2.0 websites.

1 Comment