I need to count the number of classes, number of methods, number of comments lines, LOC for any Java code as part of analysis process. So, I need a tool or plugin that gives me these data in any form; Excel, XML ...etc.
I'm positive that most IDE's have some information regarding that. For example, I use IntelliJ Idea ( https://www.jetbrains.com/idea/ ), which has a few plugins that can give you that info:
Another tool that I suggest is ANTLR. This tool is a library can help you to write an application to analyze those metrics. But you must write some code :-(