views:

37

answers:

1

I need a plugin that can count the lines of code that a particular class uses. This includes the code within the particular class, and the number of lines of code in all the classes that it uses as well. (If it has an object from another class, the lines of code in that class need to be counted as well). I've found plugins that tell me all the lines in a whole project, but I just need to know the number involved in a particular class..

A: 

Check the Java NCSS plugin

Actually, why don't you simply check the line number of the last line of the class?

It seems you want to count the lines in classes that the current one depends on. I don't think you'll find one. The classes that are used within a class isn't always obvious. For example your methods may take a List as an argument. But whether this is LinkedList or ArrayList, the compiler can't know - it can be both.

Bozho
Well I need the count of lines in that class AND all other classes that are used within in. I can go through and manually count, but I'm sure there's an easier way to do it. The Metrics plugin I have been looking at from sourceforge seems to do it for the entire project, not just the particular class and the classes it uses.
Brayden
so you want to count the lines in the 1st level of dependencies? I don't think you'll find that ;) see my update for the reasons.
Bozho
Well more specifically I want to count the lines of all the classes (and subclasses, and subclasses) it uses that I'VE made. Not that classes given by Java... So yeah I guess this is getting more and more complex isn't it. I just imagine this is a thing that lots of companies would want to do, so there'd be a plugin for it.Right now I basically start with the top class, look at the imports, see what it imports that I've used (that I've created), go to that class, count it, check IT'S imports, and keep going down then back up through all the classes. It's quite a time consuming process.
Brayden