Questions tagged [lines-of-code]

The number of code lines. Can be used as a metric.

The number of code lines. Generally, a set of metrics are placed to estimate the quality of coding. lines-of-code is one of the metrics used to determine for example if a class is too long or too short. This metric is not an accurate one and is most of the time used with other metrics such as the number of methods, number of static fields, etc.

170 questions
1
vote
3 answers

How do I get a breakup of my Lines Of Code?

Is there a tool that calculates various LOC statistics? It would have to support popular languages like C++, C#, Python, PHP, JavaScript, ActionScript, etc and interpret code accordingly. An example of the statistics I'm looking for: 350 Physical…
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
1
vote
2 answers

Why is the first line of my file not being counted?

I am trying to create a program that counts lines of code, where the commented lines are not included. I have come up with the code below, and its almost working completely, however when gets the strings from the file, it seems to be skipping the…
Casey
  • 536
  • 2
  • 14
  • 28
1
vote
1 answer

Get List of functions (with metrics) in My Solution

I have a large assembly (written in VB.NET). Is there a simple way (or tool) that will list all the functions with perhaps the size of each function (in respect to lines of code)? I have downloaded nDepend but could not see that facility within it.
1
vote
3 answers

Skipping comment lines starting with // in C++

I've got an assignment for my Software Engineering class that's driving me bananas. I've been asked to design a line counter that counts only the logical lines of code for any given file. It must omit blank lines and comments. I've got the code…
n_alvarez2007
  • 11
  • 1
  • 2
1
vote
2 answers

Can we find executable lines of code in a C/C++ source file with gcov

gcov primarily is a code coverage tool. However, is there any way we can find LOC (excluding comments...etc) with gcov? It must be easy for gcov to get that information, but I didn't find any documentation on that. Also, let me know if you know any…
ernesto
  • 1,899
  • 4
  • 26
  • 39
1
vote
2 answers

Sonar -LOC & Cyclomatic complexity

How does Sonar calculates software metrics particularly LOC and cyclomatic complexity? Does it uses any particular tools? IF yes, please also give the names.
1
vote
1 answer

Measure Lines of Code (LoC) including relative weight

I have to measure how many code lines in a project and a release (made between two labels). I can do that and there's no problem with that for me. My question is about the weight I have to "attach" to the files which consist the project. I have to…
Tamir Gefen
  • 1,128
  • 2
  • 18
  • 35
1
vote
1 answer

Bug count in Firefox releases

From where do I obtain data related to Mozillas Firefox's release history? I require the bug count after each release version No Of comments in the code of that particular release version No of Lines of Code (LOC) of the same release version I…
wishman
  • 774
  • 4
  • 14
  • 31
1
vote
1 answer

Line of code statistics with out comments

I am trying to get line of code statistics for my xcode code. For that i executed the following command in Terminal to get all possible kinds of codes. find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.xml" ")"…
Gani414
  • 93
  • 2
  • 12
1
vote
1 answer

In Sonar, how do I tell where lines of code were added to?

Is there a way to drill down to see which directories/files have added lines of code? Yesterday I see that my project added ~5k LOC. I think Sonar is confused, as we didn't add that many, we just split a couple files into a larger set of…
JoeB
  • 2,743
  • 6
  • 38
  • 51
1
vote
2 answers

A one-liner to read text file into std::string in c++?

Is there a one-liner to read the contents of a (not very big) text file into a string? The shortest I've found: #include #include #include std::ifstream t("file.txt"); std::string…
quimnuss
  • 1,503
  • 2
  • 17
  • 37
1
vote
1 answer

How can i ignore generated files while using sloccount

how can i ignore sloccount.sc and xml files created when using sloccount I use the following command: sloccount --duplicates --wide --details . | | sed "/\/\.svn\//d" | tee sloccount.sc i am using sloccount version 2.26 But i am also unit tests…
kamal
  • 9,637
  • 30
  • 101
  • 168
1
vote
4 answers

Get LOC count for classes and methods using Jenkins

I have installed Jenkins for my projects. The automatic build and deployment is happening successfully. I would like to get following data: No. of classes with lines in the range 0-50 No. of classes with lines in the range 301-500 No. of classes…
0
votes
3 answers

Can ANTLR return Lines of Code when lexing?

I am trying use ANTLR to analyse a large set of code using full Java grammar. Since ANTLR needs to open all the source files and scan them, I am wondering if it can also return lines of code. I checked API for Lexer and Parser, it seems they do not…
qinsoon
  • 1,433
  • 2
  • 15
  • 34
0
votes
1 answer

Method wise LOC counting

How can I get methodwise line of code given the java source file? I need the logic of getting the LOC in methods.