thomas908
asked on
JavaNCSS, get metrices for multiple packages
I am trying to use javaNCSS
http://www.kclee.de/clemens/java/javancss/
to get the number of classes, methods, comments etc of classes in various packages. i can do it for 1 package at a time such as
E:\Test\javancss21.41>.\bi n\javancss -gui pack1\pack2\pack3\main\*.j ava
It gives me the metrics for pack1\pack2\pack3\main package. But I have number of other packages such as
pack1\pack2\abc
pack1\pack2\xyz
pack1\pack2\abc\pack4
etc.
Will I have to write seperate commands to find the metrics for all the packages or is there a way to do it with one command.
pack1 is the root pack for the application. I am using windows
http://www.kclee.de/clemens/java/javancss/
to get the number of classes, methods, comments etc of classes in various packages. i can do it for 1 package at a time such as
E:\Test\javancss21.41>.\bi
It gives me the metrics for pack1\pack2\pack3\main package. But I have number of other packages such as
pack1\pack2\abc
pack1\pack2\xyz
pack1\pack2\abc\pack4
etc.
Will I have to write seperate commands to find the metrics for all the packages or is there a way to do it with one command.
pack1 is the root pack for the application. I am using windows
E:\Test\javancss21.41>.\bi n\javancss -gui pack1\pack2\pack3\main\*.j ava pack1\pack2\abc\*.java pack1\pack2\xyz\*.java
String firstPackage = args[0];
String secondPackage = args[1];
...
...
String firstPackage = args[0];
String secondPackage = args[1];
...
...
Alternatively if you know the path you can do it recursively in your code. Here is an exampel of how to read files recursively:
http://javaalmanac.com/egs/java.io/GetFiles.html
http://javaalmanac.com/egs/java.io/GetFiles.html
ASKER
Sorry, didn't get it.
My main method has nothing to do with the calculation of metrices. The metrices are calcualted by java NCSS
My main method has nothing to do with the calculation of metrices. The metrices are calcualted by java NCSS
ASKER
My main method just runs the application
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you have access to the source code? If yes you can find out how you can do it (if at all).
ASKER
>>Do you have access to the source code? If yes you can find out how you can do it (if at all).
are u asking about javaNCSS source code
are u asking about javaNCSS source code
Yes.
ASKER
yes its open source
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
you were right, it is traversing through all the parameter. So multiple parameters can be specified.
thanks
thanks
Thank you for accepting, glad problem is solved :)
E:\Test\javancss21.41>.\bi
and inside your main method just read them using the arguments[] parameter.