It's all about the answers!

Ask a question

LOC/SLOC/LLOC tools?


Tim McDaniel (401146) | asked Jun 10 '10, 12:59 p.m.
An extension like this may be well off-topic for jazz.extend.
If so, my apologies.

My boss wants a tool to measure Lines of Code (Source Lines of Code,
Logical Lines of Code, whatever). It needs to have a command-line
interface so we can invoke it from builds, and it needs to be able to
count changes between different versions of the same code, like
counting lines added/deleted/changed between the current tip versus a
snapshot. Our primary language is Java but we have a few programs in
C. We use RTC for source control.

If anyone has suggestions, primarly for tools that are RTC-aware but
also for tools that just work on filesystems, please e-mail
tmcd@panix.com

--
Tim McDaniel, tmcd@panix.com

2 answers



permanent link
Victor Campbell (3502618) | answered Jul 22 '10, 10:49 a.m.
My boss also want me to provide the "lines of code" metrics for changes between builds. Anyone have some info on this, or expert advice on not doing this?

permanent link
Nick Edgar (6.5k711) | answered Jul 22 '10, 12:27 p.m.
JAZZ DEVELOPER
You can use the SCM CLI to list files changed between the current state loaded for the build and a specific snapshot.
See https://jazz.net/wiki/bin/view/Main/BuildFAQ#ScmCli

You don't mention which language you're using, but there are various tools out there for calculating LOC. See for example:
http://stackoverflow.com/questions/2773055/lines-of-code-counting-for-many-c-solutions

You could then publish the resulting file using the logPublisher Ant task.
See https://jazz.net/wiki/bin/view/Main/BuildFAQ#BuildSystemToolkitContents

Regards,
Nick

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.