I am Computer Science student and working on a project in java through netbeans 7.0.1 to be submitted in college, Today my faculty asked me how much your project is completed and i confidently replied that, Yes sir approx 50% completed already, he said how many lines u code, and i just go "Ummmm don't know exactly Sir", he replied, "Are you actually working or just buying it from somewhere!", my mind go blank!!! :D
I googled for this and found a WordCount Plugin for netbeans, but it does not working in NetBeans 7, or may be i do't know how exactly it works..
Any substitute for this WordCount available for NetBeans 7.x?
Or any other way, except manual counting of line in whole application?
4 Answers 4
It's not part of Netbeans, but I use CLOC for this and find it does a nice job - identifies different languages well, reports on how many lines are comments, how many are code and so on.
1 Comment
Since a 'nix-based answer has been given, in Windows you could accomplish something similar with Powershell:
get-content *.java | measure-object -line
Comments
If you are on a unix system the following would work:
$ find . -name *.java | xargs cat | wc
1262 2862 37780
That will merge all the files together into a stream and pass it to wc which will do various counts. The first number is the number of lines.
In the above example, my codebase (from the directory I run it) has 1262 lines.
2 Comments
I'd like to suggest an answer to a different question:
How do I quantify progress in a programming project?
I have a preference for agile methodologies, so I would present a burn-down chart - which takes into consideration the total number of user stories/cards/tasks, the complexity/estimated time, and plots it against those remaining.
I think you need to do something simpler, but I expect simpler:
- Start by breaking your entire project down into units - tasks / bugs / areas of functionality
- Estimate the amount of effort required for each, and consider the risk + complexity
- For each unit, assess the amount it's completed - units should be small enough to be completed within a day or two at most.
- From this you can build statistics
I expect that just the act of project planning will be enough to improve your standing with your faculty as it shows a maturity in understanding there is more to a project than just the code.
50%, i do not write everything here that i showed the modules that are ready , i explain the profilation, pre-complete testing and all other things, because i don't think it is important to say all here..I've just a simple question,Is there a plugin or code API through which i can count no. of words, lines etc of my code directly...i respect your suggestions but did not need here...