Is there a pluging/feature to count the number of lines in a proje开发者_如何学Goct?
This may be what you're looking for: http://metrics2.sourceforge.net/
A very simplistic way is to do a regular expression search for '\n' in your project. It will give you a good idea on the number of lines in your project without installing any extra plug-ins.
Instead of installing a new eclipse plugin; If you are on a linux system:
cd
to the eclispe project source directory(workspace/project-name/src)
and enter in termianl:
wc -l *.java
This will show you total number of lines as well as number of lines in each file
A quick way to do it is based on this tutorial I found: http://stephendnicholas.com/posts/eclipse-quick-line-count
To summarize, do the following (to use search in Eclipse press Ctrl+H):
- Find the total amount of lines: Search your code for
\n
using 'regular expression' under your code files (e.g. if you develop in java only then search only *.java files). - Find the total amount of blank lines: Search your code for
^\s*\n
- Find the total amount of commented lines: search your code for
//.*(\n{1})?
Finally: Get the total amount of lines of code by subtracting 2 and 3 from 1.
精彩评论