This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes Software to count java SLOC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Software to count java SLOC" Watch "Software to count java SLOC" New topic

Software to count java SLOC

smee bond
Ranch Hand

Joined: Sep 29, 2007
Posts: 34
Could anyone suggest me a free software that can be used to count java Software Lines Of Code?
(Sorry if I am in the wrong forum! Thought this is the apt one)
Rob Spoor

Joined: Oct 27, 2005
Posts: 20193

Not the best one, but it's something I wrote years ago.
It can handle multiple files and directories and is quite configurable.

It's limited in that it cannot find comments that are after or before some code. Multi line comments are no problem though.

How To Ask Questions How To Answer Questions
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45338
Can't you use the line numbers on a text editor or IDE?

[Edit: Rob Prime's suggestion seems a lot better /edit]
[ December 11, 2007: Message edited by: Campbell Ritchie ]
smee bond
Ranch Hand

Joined: Sep 29, 2007
Posts: 34
Thanks for your suggestions. I could have used textpad to count the number of lines, but I want the count of only the code without comments or blank spaces. Meanwhile I was doing some search on the net and found the following tool:
Its a neat tool....very helpful and easy to use.
It is sorta covered in the JavaRanch Style Guide.
subject: Software to count java SLOC
It's not a secret anymore!