0

Does anyone know of a good static code analysis tool that can give answers to the following question?

Input: A set of classes and path to a folder containing java files

Output: A nice statistic about how often the methods of the given classes are called in any java file contained in the specified folder.

I know that eclipse would be one way - Search for references but then i would have to evaluate every method individually and we are talking about > 100 methods inside the given set of classes.

I am one step away from writing a simple program extracting the method names and grepping for them in the target folder but I can not believe there is no solution for such a task yet. ;)

Thanks in advance! Stefan

  • Did you see https://stackoverflow.com/questions/17455521/how-can-i-perform-the-searches-java-ides-do-for-method-references-programmatical?rq=1 ? –  May 02 '17 at 18:42
  • If you want to write the code, I would recommend using an io file reader/writer. Using this, you can retrieve all of you your java file names, then read the code in your java files looking for calls to the programs you have already found – Josh Heaps May 02 '17 at 18:50
  • Keep in mind that 'just grepping' will only work of the method names are unique. Otherwise you also have to infer the type of the object that the method is called on, which is not as simple as it may sound. – NickL May 02 '17 at 19:38

0 Answers0