I have a Java project in Eclipse with ~10 packages and ~10 class files per package. Is there a way to determine total lines of code for the whole project from within Eclipse? I am familiar with other tools (e.g., Code Analyzer, wc, etc.) but I want to know if there is a way to do this within Eclipse (or get confirmation that there is no way to do it).
Go to Windows → Preferences → General → Text Editors → Show numberlines. Click OK, then Apply changes. Then it will show the line count automatically. Show activity on this post.
One possible way to count lines of code in Eclipse: using the Search / File... menu, select File Search tab, specify \n[\s]* for Containing text (this will not count empty lines), and tick Regular expression. wow, that's super genius.
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!
In Eclipse IDE, select “Windows” > “Preference” > “General” > “Editors” > “Text Editors” , check on the “Show line numbers” option. See result.
Search
> File Search
Check the Regular expression
box.
Use this expression:
\n[\s]*
Select whatever file types (*.java
, *.xml
, etc..) and working sets are appropriate for you.
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