Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Code Use Checker

I am working on a library where we want to determine how much of our library is being used. I.E. we want to know how many methods in our library are public, but never being called.

Goal: Static Analysis Determine how many lines of code call each public method in package A in the current project. If the number of calls is zero, the method should be reported as such.

like image 393
James Van Boxtel Avatar asked Apr 20 '09 00:04

James Van Boxtel


1 Answers

I belive you are looking for this eclipse plugin --> UCDetector

From the documentation (pay notice to second bullet point)

  • Unnecessary (dead) code
  • Code where the visibility could be changed to protected, default or private
  • Methods of fields, which can be final

On Larger scale, if you want to do Object Level Static Analysis, look at this tool from IBM -->Structural Analysis for Java. It is really helpful for object analysis of libraries, APIs, etc.

like image 128
Kartik Shah Avatar answered Sep 22 '22 14:09

Kartik Shah