In: Computer Science
In this assignment, you will use a LOC counting tool to count
the lines of code of the tool itself.
1. There are several open source free tools for LOC counting such
as CLOC and SLOC.
2. Run the tool to count the lines of code of the source files of
the tool (usually in the src directory).
3. Submit a report which includes:
a. Description of the tool
1. Name
2. Creator
3. Language(s) it is written
4. URL to download the tool
b. A printout of the execution of the tool.
c. Comments for the result. For example,
1. Does it include comment lines?
2. Does it count physical line or logical line?
3. Does it include blank lines?
2.
b)
$ mkdir my_project
$ cat my_project/bash.sh
#!/bin/bash
echo "hello world"
Let cloc to count the lines of our code:
$ cloc my_project/bash.sh
1 text file.
1 unique file.
0 files ignored.
http://cloc.sourceforge.net v 1.60 T=0.00 s (262.8 files/s,
788.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Bourne Shell 1 1 0 2
-------------------------------------------------------------------------------
a)cloc is a powerful tool that allows you to count all lines of
your code, exclude comment lines and white space and even sort it
by programming language.
1.Changing Lines of Code
3.Perl
4.Download:https://sourceforge.net/projects/cloc/
c)The first column specifies the name of programming languages that the source code consists of.The second column displays the number of files in each programming languages.
The fourth column displays number of comment lines.
And the final and fifth column displays total physical lines of given source code.
1.cloc counts blank lines,
2.comment lines,
3.and physical lines of source code in many programming languages.