Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Counting Line Numbers in Eclipse [closed]

Tags:

java

eclipse

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).

like image 685
user128807 Avatar asked Oct 04 '22 12:10

user128807


People also ask

How do I turn on line numbers in eclipse?

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.

How do I count line codes in eclipse?

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.

How do I count the number of lines in a Java project?

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!

How do I change line numbers in Eclipse editor?

In Eclipse IDE, select “Windows” > “Preference” > “General” > “Editors” > “Text Editors” , check on the “Show line numbers” option. See result.


1 Answers

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.

like image 179
Brian Sweeney Avatar answered Oct 07 '22 00:10

Brian Sweeney