http://www.crabaware.com/Utils/CountLoc/CountLoc.zip
This is a binary-only release (Win/Linux/OSX).
I tried to match cloc counts but I failed (because I found a nasty bug in cloc which in rare cases miscounts comments vs code; at least as of 1.62 but I already found the bug in their tracker)
My tool operates in two modes:
- conservative (default), where punctuation on separate lines is not counted as LOC
- greedy (trying to mimic cloc)
conservative considers the following fragments 2 LOC (2, 4, 3 in greedy mode):
Code: Select all
if (a)
b();
if (a)
{
b();
}
if (a) {
b();
}
While LOC is probably not a good measure to compare effort or compare different projects (if two programs do the same but one is much smaller then obviously less is more),
still it gives a rought idea about the size of a project.
Because of the way it works, it's actually pretty fast (compared to cloc from my experience), but this comparison is a bit unfair as cloc attempts to auto-detect file type while mine simply relies on file extension.
Duplicate (md5 hash)/empty files are ignored.
Each file is loaded into memory, then running 1 MD5 pass and 1 LOC pass.
Archives aren't supported.
UTF-16 source files aren't supported (wrong result in that case as comments/CRLF EOLs won't be detected properly).
List of supported extensions:
cc, cpp => C++ source
h, hpp => C/C++ include
inl => C/C++ inline
mm => Objective C++ source
m => Objective C source
cs => C# source
java => Java source
js => JavaScript source
for more information about command-line arguments, see readme.txt