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
0
votes
2 answers

Subversion. Metrics. Get lines of added/updated code for each file in check-in programmatically

I need your advice. In my application I need to get programmatically such metrics for users check-ins as lines of added/updated code for each file in check-in. This app is writed on c# and uses the Subversion as version control system. How can I do…
w1z
  • 537
  • 2
  • 5
  • 17
0
votes
3 answers

Ruby how to add an element to element to hash that returns hash?

I'm trying to be really efficient with # of lines of code so I want to combine the following two lines of code: my_hash["X"] = value my_hash If I take out the second line, then my function returns the wrong thing because it will only return the one…
user3380049
  • 139
  • 1
  • 10
0
votes
1 answer

Can anybody recommend a program that generates a graph the lines of code count?

I've found a lot of programs and scripts for counting the number of lines of code using Google, but what I'm looking for is something that graphs it in real time. I'm hoping this will motivate myself and other programmers. Any ideas?
XXXX
  • 161
  • 1
0
votes
0 answers

SONAR always shows LOC as 0

I am new in SONAR and I just doing POC to implement SONAR. Currently I am doing code analysis trough StyleCop in my solution and every time that I execute the sonar-runner I do not get any LOC. Am I missing something to setup? The…
JAVH
  • 155
  • 1
  • 3
  • 13
0
votes
2 answers

How do I count modified lines of code?

I have a program which counts lines of code (excluding comments, braces, whitespace, etc.) of two programs then compares them. It puts all the lines from one program in one List and the lines from the other program in another List. It then removes…
JDCAce
  • 159
  • 12
0
votes
1 answer

Using Temporary Views in ClearCase

I would like to share a dilemma and hear your feedback. As part of the new version of R&D Reporter for ClearCase, we began offering "Lines of Code" (LoC) metrics and charts when comparing baselines and composite baselines (Added, Modified and…
Tamir Gefen
  • 1,128
  • 2
  • 18
  • 35
0
votes
2 answers

How would you measure inserted / changed / removed code lines (LoC)?

My question concerns LoC metrics. I have to provide statistics of inserted, changed and removed lines. My users use ClearCase and the example below based on it, however I believe that my question is general. Please have a look on the following…
Tamir Gefen
  • 1,128
  • 2
  • 18
  • 35
0
votes
1 answer

How to left-justify lines of code to the left edge of the window in eclipse

I have alot of code that has white space to the left of the lines of code in my eclipse project. I would like to select pieces of this code and remove the extra white spacing so each line lines up with the left edge of the window.
user589879
  • 51
  • 7
0
votes
3 answers

how to count the loc without block comments?

I am trying to get the number of lines of code from a java file. But I am having trouble counting them. First I tried to skip them with ifs, but my idea does not work. Now I am counting the same lines with comments, my Java file has this header. Any…
bentham
  • 1,701
  • 3
  • 20
  • 32
0
votes
2 answers

How can I make a batch file to run the same cloc command with one click?

To run the command: cloc-1.08.exe wizardry Obviously I don't want to go into DOS every time I want to do a line count.
Iain
  • 9,432
  • 11
  • 47
  • 64
0
votes
2 answers

lines of code within a class in python?

I'm trying to find the number of lines of code within class or function that are stored in a python file my code is like this... what I want is to find number of lines of code in the a class not all the file ... is there any good way to do so??…
tkyass
  • 2,968
  • 8
  • 38
  • 57
0
votes
1 answer

Is Line of code also Line of text?

I know this maybe a silly question I'm quite confuse about them, as I understand this example has 1 line of code and 2 line of text. 1. System.out.print("----------- 2. ----------------------------"}; Am I right or wrong?
Xitrum
  • 7,765
  • 26
  • 90
  • 126
0
votes
2 answers

Java LOC counting by comparing two project

I have two Java projects in eclipse. Same project but different versions. Now I want to compare these projects and find out the Inserted, Modified, Deleted LOCs of each java project. Is there any plugins are available for this same purpose? Or is…
developerXXX
  • 689
  • 3
  • 7
  • 18
0
votes
1 answer

Length of Character as a valid measure for source code

say lenchar be the number of characters in source code, is it a valid measure for the length of source code?
-1
votes
2 answers

How can I count words or tokens in my code?

There are all sorts of tools for counting lines of code in a source file or directory tree (e.g. cloc). There are also tools for counting words in a plain text file (wc). How would I go about counting words or tokens in my code, though? Is this…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1 2 3
11
12