I have netbeans 7 and I was wondering how to calculate the total lines for a project. I have looked through Google but every time I do it I only find dead ends or non working plugins. Does anyone know how to count the lines?
If you want to get the lines of code of a single file, you can use cloc <filename>. We're using the command to get the lines of codes of a simple Vue file. It also recognized that it is a VueJS component. We can check all of the lines of code in a file or directory by the command cloc --by-file.
cloc is a command-line-based tool. It counts the blank lines, comment lines, actual code lines written in many programming languages.
You can use wordcount that works with 7.1 nb-wordcount that works with 8.2.
To configure wordcount go in Tools->Options->Miscellaneous. You have to change Accept filename
if you want other files than Java and Groovy to match.
To display the count window go in Window->Open WordCount Window.
To display stats click on WordCounting (second button). I will display the stats of the directory selected in Projects (window)(it has to be a package or something like Source Packages or Web pages, it won't work if you select the project).
Also if you are on linux you can simply execute :
find . -name '*.java' | xargs wc -l
I know this is a very old question however there is a simpler way of finding the line count in a netbeans project that doesn't involve installing plugins:
Find
or Find in Files
or press CtrlF.Match
dropdown is set to Regular Expression
.\n
into the search box.Search Results
tab.Note: In NetBeans, the search is stopped after 5000 results, so if your project is longer than that then this method won't work
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