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
29
votes
12 answers

Count lines of code in directory using Python

I have a project whose lines of code I want to count. Is it possible to count all the lines of code in the file directory containing the project by using Python?
Daniel
  • 1,599
  • 1
  • 16
  • 19
26
votes
4 answers

Query to list SQL Server stored procedures along with lines of code for each procedure

I want a query that returns a list of all the (user) stored procedures in a database by name, with the number of lines of code for each one. i.e. sp_name lines_of_code -------- ------------- DoStuff1 120 DoStuff2 50 DoStuff3 30 Any…
Simon D
  • 4,150
  • 5
  • 39
  • 47
22
votes
2 answers

Basis for claim that the number of bugs per line of code is constant regardless of the language used

I've heard people say (although I can't recall who in particular) that the number of bugs per line of code is roughly constant regardless of what language is used. What is the research that backs this up? Edited to add: I don't have access to it,…
Matt R
  • 9,892
  • 10
  • 50
  • 83
21
votes
4 answers

How to count lines of code in Python excluding comments and docstrings?

I want to count the lines of code in a multi-file Python project as accurately as possible, but without including comments, docstrings or blank lines in the total. I first tried using cloc, which is available as a Debian package. But cloc treats…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
20
votes
1 answer

How do I display the total number of lines in the Emacs modeline

The default Emacs modeline only shows the current line number and its percentage in relation to the total line numbers. How do I make it show the line total as well?
dkiyatkin
  • 614
  • 7
  • 11
20
votes
3 answers

Utility To Count Number Of Lines Of Code In Python Or Bash

Is there a quick and dirty way in either python or bash script, that can recursively descend a directory and count the total number of lines of code? We would like to be able to exclude certain directories though. For example: start at:…
Justin
  • 42,716
  • 77
  • 201
  • 296
18
votes
1 answer

Using Statistic plugin for IntelliJIDEA

I am trying to count the lines of code in my project in IntelliJIDEA. From this I saw that Statistic plugin is good for that. But I do not know how to use it. Can someone tell me that please? Please direct me to documentation if there is.
harsh
  • 2,399
  • 9
  • 29
  • 47
15
votes
22 answers

Is there a standard way to count lines of code?

I realize there's no definitely "right" answer to this question, but when people talk about lines of code, what do they mean? In C++ for example, do you count blank lines? Comments? Lines with just an open or close brace? I know some people use…
Gwildore
  • 388
  • 1
  • 3
  • 9
14
votes
5 answers

Lines-of-code counting for many C# solutions

I am currently researching a solution for counting lines of code in C#. I pretty much need a combination of the following two tools: http://richnewman.wordpress.com/2007/07/01/c-and-vbnet-line-count-utility/ http://www.locmetrics.com/index.html…
Eric
  • 151
  • 1
  • 1
  • 4
14
votes
3 answers

Lines Of Code in Team foundation server

I'm looking for reporting tools for TFS, I need to get Lines of Code for individual developer between 2 dates, do you think it is doable via TFS?
Sameh
  • 934
  • 1
  • 14
  • 40
13
votes
4 answers

Count total number of lines in a project excluding certain folders or files

Using the command: wc -l + `find . -name \* -print` You can get the total number of lines of all files inside a folder. But imagine you have some folders (for example libraries), which you don't want to count their lines because you didn't write…
rfc1484
  • 9,441
  • 16
  • 72
  • 123
11
votes
4 answers

Eclipse metrics plugin for C++

Does anyone know a good metrics plugin for Eclipse that works with C++ ? I'm looking for lines of code mainly. Thanks.
tree-hacker
  • 5,351
  • 9
  • 38
  • 39
11
votes
6 answers

Is LOC correct parameter for project estimation?

Is LOC correct parameter for project estimation? there are so many scenarios where complexity takes much more time for a single line of code, other than LOC what could be the suggested parameter for project estimation? As peoples are talking about…
Jaswant Agarwal
  • 4,755
  • 9
  • 39
  • 49
10
votes
4 answers

Eclipse plugin for measuring lines of code

I'm running Eclipse Helios (3.6) and was wondering if there is a nice plugin out there that will count the number of logical lines of code in a java source file. By logical, I mean if (j > 6) { j--; } In other words, 2 logical lines of code (2…
Joeblackdev
  • 7,217
  • 24
  • 69
  • 106
10
votes
11 answers

How to present your code to potential buyers?

I'll do a demo of my code to slightly non-technical audience, and I need to show them what I've got in my project (about 15K lines of code). I'm trying to convince them that I've spend time on the project and it's in a good state. These guys…
dr. evil
  • 26,944
  • 33
  • 131
  • 201
1
2 3
11 12