How to count total line of code in whole project/directory?
In many case you will require to count total number of line of code in your project.So here i am going to introduce with one powerful tool for counting line of code. That is CLOC .
ABOUT TOOL :
CLOC is open source project. CLOC is written entirely in Perl language and CLOC is almost portable .
ClOC can works on
- many flavors of Linux,
- Mac OS X,
- AIX,
- Solaris, IRIX,
- z/OS
CLOC counts blank lines, comment lines, and physical lines of source code in many programming languages.
BASIC USE :
just DOWNLOAD CLOC from here and put its binary anywhere in your machine.
Now open terminal go to in directory where your binary is kept.
type
prompt> cloc-1.53.pl /path to your project directory
now you will find complete set of list showing various info of your project
like this
4076 text files. 3883 unique files. 1521 files ignored. http://cloc.sourceforge.net v 1.50 T=12.0 s (209.2 files/s, 70472.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Perl 2052 110356 130018 292281 C 135 18718 22862 140483 C/C++ Header 147 7650 12093 44042 Bourne Shell 116 3402 5789 36882 Lisp 1 684 2242 7515 make 7 498 473 2044 C++ 10 312 277 2000 XML 26 231 0 1972 yacc 2 128 97 1549 YAML 2 2 0 489 DOS Batch 11 85 50 322 HTML 1 19 2 98 ------------------------------------------------------------------------------- SUM: 2510 142085 173903 529677 -------------------------------------------------------------------------------
if yoy still not happy with this tool then you can find more such tool from following links
for same purpose.
You may like to read this also....
2 Comments to “How to count total line of code in whole project/directory?”
Post comment
Search in this website
our sponsors
latest comments
- venkat on C programming interview questions and answers for freshers
- Ankur on How to configure mail from localhost ( wamp ) using PHP?
- ergVFyd on Huffman Encoding Using Linked List with Source Code
- karthick on how can I write applications in C or C++ for Android?
- karthick on how can I write applications in C or C++ for Android?
Find us on Facebook
Top Authors
Find us on stackoverflow
Polls
My Bookmarks
- Audio/video Recorder & player application based on MATLAB
- check dependency of your binary
- defination of all standard c programming language function
- Great Question-Answer on c programming
- know what your c code means
- Limition of c programming language
- List of all version of c programming language
- Online c compiler
- php freelancing work
- some more stuff on C programming language
- Volatile Keyword in Embedded System
- Write Android application in c language
Hi. Its a good tool and worked fine for mine project too.But can you just let me know which are the files it is ignoring in its calculation.
here it will consider only know language’s extension file others are ignoring. supported programming language you will find from
http://cloc.sourceforge.net/#Languages