I have been working on Java Projects for quite some time and interested in exploring the source code metrics like size and complexity across project not specific to perticular package or class and looking after LOC (Line of Code) counters to capture some metrics of the source code.
Explored some tools and found that JavaNCSS is a good match for the context of sizing metrics on Java. JavaNCSS is a command line utility which measures some standard source code metrics for the Java programming language. The metrics are collected globally, for each class and/or for each function.
The following are some of the advantages that i have seen
- Support for Ant Tasks, so easy to integrate with build process
- Reports can be in Text, XML, HTML etc
- Support for Stylsheets and easy to get nice HTML reports
- Metrics at each level Package / Class / Method
- Cyclomatic Complexity Number
- List the number of packages / classes / functions / LOC counter at each level
Further Reading:
- JavaNCSS Home
- LOC Counters for C++ / Java on Joel Software Discussion group
- SLOC on Wikipedia


The Ant tasks for JavaNCSS are ancient and produce warnings when metrics pass a threshold, but not reports. I’ve built my own version which I’m planning on releasing on sourceforge soon in the “PriNCSS” project.
I also plan on releasing a task to maintain a running graph with your build.
Alex Miller
Good to hear that Alex. There are some issues with JavaNCSS and it does help to get going with intial metrics.
Thanks for your comments and eager to see PriNCSS.
Venkat.
Good read, thanks. Seo is important. Looking for good free rank checking software.
[...] This post was Twitted by venkatreddyc [...]