File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes utitility to find code metrics? (lines of code, etc) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "utitility to find code metrics? (lines of code, etc)" Watch "utitility to find code metrics? (lines of code, etc)" New topic

utitility to find code metrics? (lines of code, etc)

Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

I'm looking for a utility that kind find lines of code, # methods, # classes, that kind of thing... for a java project I created.

I tried using CCCC (C and C++ Code Counter) -- it also does Java. But it didn't get # methods.

Anyone have any utitlity they've used before. I'm using IntelliJ, so I don't know if there are any plug-ins out there that I couldn't find that work with IntelliJ.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Have you read my article?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Google for "java static source analysis" or words like that. "static" means it reads your source code as opposed to tools that watch a running system.

There are a number of open source and commercial tools that do the kind of counts you mention, plus a whole world of good inforamation about package and class dependencies. JDepends and JTest do dependency analysis based on Robert Martin's metrics for what is "good".

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

MetricsReloaded plugin for IntellJ, just go to your plugin list in the settings area.

I used it before and it gives lots of information.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

excellent! Thanks Mark -- I knew some lovely person out there had to have created a plugin for IntelliJ. That thing has tons of metrics.

And no Lasse, I was a bad Sheriff and haven't yet read your article. I'll check it out! I'm doing a research project at school about generating system tests and figuring out how well they cover the code.

Thanks to the other suggestions too. Its much appreciated.
[ September 29, 2004: Message edited by: Jessica Sant ]
I agree. Here's the link:
subject: utitility to find code metrics? (lines of code, etc)
It's not a secret anymore!