Forums Register Login

tool to identify unused methods

+Pie Number of slices to send: Send
is there a tool which will identify unused methods for classes? we have a code base which is probably 3 years old and after much refactoring and such there's most certainly methods that got replaced but never removed.
+Pie Number of slices to send: Send
There are tools to test code coverage - JBuilderX springs to mind. I think its got that sort of profiling capabilities. Nothing however beats a proper manual code review - especially when you got technologies like Reflection where methods might not be directly refered to by other classes, but are used at run time.
+Pie Number of slices to send: Send
There are a number of decent static analysis tools available that will do this -- no need to subject humans to that sort of bookkeeping work. IntelliJ IDEA has this built in, but there's also the open-source PMD.
+Pie Number of slices to send: Send
The Code Guide IDE can do that, as far as I know. You simply tell it all the root classes (main class, classes loaded via reflection etc.), and it flags all unreachable code. Haven't tried it yet, though.
+Pie Number of slices to send: Send
 

Originally posted by Ernest Friedman-Hill:
there's also the open-source PMD.



From the description on the homepage it seems as if it only works for private methods, which is rather trivial (Eclipse can do that, too).

Finding unused *public* methods would be helpfull for us, too. Sadly, my feature request has been without effect until now...
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 765 times.
Similar Threads
Tool to clean source code?
How to determine uncalled functions?
Tool for JVM instance Identifier
Problem with properties file
difference between gc and runFinalization
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:01:20.