Eclipse - how can I determine the number of methods in a Java application

Try to use a static code analyzer; Source Monitor, for example, is free SW and has the count you're searching for.


I would prefer using Reflection.

  • Retrieve all the class from expected packages, where logging is necessary
  • Summing up all the method available to all those class

Using Eclipse you can do this:

  • Press Ctrl-H (Search), then select the "Java Search" tab (if it doesn't appear click on the "Customize..." button at the lower left corner)
  • Put * in the search box
  • Select "Method" in the "Search For" fieldset
  • Select "Declarations" in the "Limit To" fieldset
  • Select "Sources" in the "Search In" fieldset
  • Select "Workspace" in the "Scope" fieldset
  • Click on "Search"

After the search is complete you should see a "XXXX declarations in..." message in the search view and that will be your result.

Hope it helps!


Use sonar - http://www.sonarsource.org/ - it's great tool for analyzing code.

Or look here: What are the good static code analysis plugins?

Tags:

Java

Eclipse