How to count lines of Java code using IntelliJ IDEA?
After installation: - Right click on your project - Choose codepro tools --> compute metrics - And you will get your answer in a Metrics tab as Number of Lines. This one is actually quite good!
To use cloc simply type cloc followed by the file or directory which you wish to examine. Now lets run cloc on it. As you can see it counted the number of files, blank lines, comments and lines of code. Another cool feature of cloc is that can even be used on compressed files.
Launch it via new button that is installed in lower left corner of IntelliJ IDEA window. It has additional settings: File - Settings - (Project Settings) Statistic. The Statistic plugin provides file counts in addition to line counts.
Just Follow the instructions inside the plugin page. Then go to class matrix tab. then you can see the method count. For future reference: Go to help -> find action -> calculate metrics.
The Statistic plugin worked for me.
To install it from Intellij:
File - Settings - Plugins - Browse repositories... Find it on the list and double-click on it.
Access the 'statistic' toolbar via tabs in bottom left of project
OLDER VERSIONS: Open statistics window from:
View -> Tool Windows -> Statistic
Quick and dirty way is to do a global search for '\n'
. You can filter it any way you like on file extensions etc.
Ctrl-Shift-F -> Text to find = '\n'
-> Find.
Edit: And 'regular expression' has to be checked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With