Question

In: Computer Science

In this assignment, you will use a LOC counting tool to count the lines of code...

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?

Solutions

Expert Solution

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.


Related Solutions

1. The lines of code below form a counting loop: LoadDelay mov.w #0x001A, R15 LoopTop dec.w...
1. The lines of code below form a counting loop: LoadDelay mov.w #0x001A, R15 LoopTop dec.w R15 jnz LoopTop Done How many times will this loop execute? Provide the answer in decimal_________ 2. Suppose the state of bits at P1OUT are 10110111 and the following line is executed: xor.b #0x05,&P1OUT What is the new state of bits at P1OUT after the above line executes? Provide the answer in binary_____________ 3. What value is contained in R9 after the following lines...
You are to use your code from part A of this assignment and add to it....
You are to use your code from part A of this assignment and add to it. In this part of the project, you are to do the following: 1. In the count_voters function you are to add code to: • Count the number of votes for Trump • Count the number of votes for Biden • Count the number of females • Count the number of males • Count the number of Democrats • Count the number of Republicans •...
Counting evens Write the pseudo-code for a brute force approach to counting the number of even...
Counting evens Write the pseudo-code for a brute force approach to counting the number of even integers in an array of n integers. Write the pseudo-code divide-and-conquer algorithm for counting the number of even integers in an array of n integers. Give the recurrence relation for the number of additions in your divide-and-conquer algorithm.  
USE GENERICS TO WRITE THE JAVA CODE FOR THIS ASSIGNMENT In this assignment, rewrite two of...
USE GENERICS TO WRITE THE JAVA CODE FOR THIS ASSIGNMENT In this assignment, rewrite two of the following sorting methods (Insertion Sort, Selection Sort, Quick Sort, and Merge Sort) to sort ArrayList of objects using Comaprable interface. (60 points)
In C++ Please comment in all-new lines of code, thank you DO NOT USE ANSWERS THAT...
In C++ Please comment in all-new lines of code, thank you DO NOT USE ANSWERS THAT ALREADY BEEN POSTED, please use code from the assignment Copy-paste will be reported Write a program to compare those two searching algorithms and also compare two sorting algorithms. You need to modify those codes in the book/slides to have some counters to count the number of comparisons and number of swaps. In the main function, you should have an ordered array of 120 integers...
In C++ For this assignment, you will write a program to count the number of times...
In C++ For this assignment, you will write a program to count the number of times the words in an input text file occur. The WordCount Structure Define a C++ struct called WordCount that contains the following data members: An array of 31 characters named word An integer named count Functions Write the following functions: int main(int argc, char* argv[]) This function should declare an array of 200 WordCount objects and an integer numWords to track the number of array...
Counting integers greater than 10 Write the pseudo-code for a brute force approach to counting the...
Counting integers greater than 10 Write the pseudo-code for a brute force approach to counting the number of integers greater than 10 in an array of n integers. Write the pseudo-code divide-and-conquer algorithm for counting the number of integers greater than 10 in an array of n integers. Give the recurrence relation for the number of comparisons in your divide-and-conquer algorithm in part b.  
Consider the following code segment:    count = 1    while count <= 10:       print(count,...
Consider the following code segment:    count = 1    while count <= 10:       print(count, end=" ") Which of the following describes the error in this code? The loop control variable is not properly initialized. The comparison points the wrong way. The loop is infinite. The loop is off by 1. Does this code contain an error? If so, what line is the error on? 0: ans = input("Yes/No? ") 1: if ans == "Yes": 2: print("Confirmed!") 3: else...
For this programming assignment, you will use your previous code that implemented a video game class...
For this programming assignment, you will use your previous code that implemented a video game class and objects with constructors. Add error checking to all your constructors, except the default constructor which does not require it. Make sure that the high score and number of times played is zero or greater (no negative values permitted). Also modify your set methods to do the same error checking. Finally add error checking to any input requested from the user. #include <iostream> #include...
JAVA CODE BEGINNER , Please use comments to explain, please Repeat the calorie-counting program described in...
JAVA CODE BEGINNER , Please use comments to explain, please Repeat the calorie-counting program described in Programming Project 8 from Chapter 2. This time ask the user to input the string “M” if the user is a man and “W” if the user is a woman. Use only the male formula to calculate calories if “M” is entered and use only the female formula to calculate calories if “W” is entered. Output the number of chocolate bars to consume as...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT