Skip to main content
9 votes
Accepted

Relation between LOC and Cyclomatic Complexity

The paper posted in John R. Strohm's answer is somewhat misleading. Although I don't disagree that there is a relationship between cyclomatic complexity and lines of code, it looks like cyclomatic ...
Thomas Owens's user avatar
  • 83.4k
5 votes

Number of lines of code executed per line of code: Are there significant differences per language?

I think in the linked talk "executed lines of code" means "executed processor instructions" Basically higher level languages do more with less typing. Or in Jim Keller's words: &...
Ewan's user avatar
  • 77.6k
5 votes

When should I care about code metrics in Visual Studio?

Code metrics are simply sensors that indicate when something is out of an expected range. Taken in isolation, they really aren't that interesting as you point out, you can already guess at what it's ...
Berin Loritsch's user avatar
5 votes

Is there a software quality metric related to side effects?

Side effects cannot be eliminated. Not if your program is going to do useful work. What you can do is be formal about side effects and create a place free of side effects and also a second place to ...
candied_orange's user avatar
4 votes

Does it make sense to compute cyclomatic complexity/lines of code ratio?

As noted in a previous reply, this statement in the accepted answer is clearly incorrect. The ratio has about the same prediction ability as either used separately. CC density has been found to ...
Nikos Houssos's user avatar
4 votes

When should I care about code metrics in Visual Studio?

Code metrics are most useful for large code bases where you may not be able oversee or even know about each part of the code. Usually these situations happen when you have to work with code you have ...
Jonathan van de Veen's user avatar
3 votes
Accepted

how to measure defects per KLOC

The general approach to measure these figures is: Establish a test plan with sufficient coverage. Execute the formal test plan (could be automated or manual tests), and register the failed test ...
Christophe's user avatar
  • 78.7k
3 votes

Number of lines of code executed per line of code: Are there significant differences per language?

Having fewer lines of code per feature is typically better as it increases the developer productivity. I want to dig into this statement, because you are asserting this as a supposedly evident truth. ...
Flater's user avatar
  • 53k
3 votes
Accepted

Number of lines of code executed per line of code: Are there significant differences per language?

I'm curious, if there are any language features that have an impact on the number of lines of code that are executed very rarely. Some languages are associated with source lines that are “hard to ...
J_H's user avatar
  • 7,600
2 votes
Accepted

Is there a software quality metric related to side effects?

You could look at some functional programming metrics. for example Number Of Lambda Functions With Side Effects Used In A Class (LSE) A function with no side effects is a pure function, by measuring ...
Ewan's user avatar
  • 77.6k
2 votes

Is there a software quality metric related to side effects?

Metrics are things one can easily measure. The difficulty with measuring side effects is to identify those you want to measure: Of course, it's easy to detect and measure use of global variables that ...
Christophe's user avatar
  • 78.7k
2 votes

How to calculate Cyclomatic Complexity exactly?

Your flow diagram can be simplified as: [this.noOfB = this.noOfA;] | \ | \ | [noOfB++] | / | / [-----------------] | \ ...
Jules's user avatar
  • 17.8k
2 votes
Accepted

counting identifiers and operators as code size metric

Indeed, the SLOC is used for simplicity and does not fully express the real complexity of code. Use of increment, ternary or comma operators, or multiple statements are a phenomenon that significantly ...
Christophe's user avatar
  • 78.7k
2 votes
Accepted

Summing cyclomatic complexity of function or files

Your assumption that the sum of CCs is the aggregate CC is correct, but perhaps not very useful. Cyclomatic complexity is based on the control flow graph. Usually, we only look at the control flow ...
amon's user avatar
  • 135k
2 votes
Accepted

Class Divisibility Metric

The metrics you are interested in are called cohesion metrics. There are 30 or so different ones that I know of. This paper discusses quite a few of them, and has references to the original papers. ...
kc2001's user avatar
  • 136
1 vote

Class Divisibility Metric

You can try JArchitect to detect which classes could be divided by using the LCOM/LCOMHS metrics. The classes with poor cohesion are the most candidate for a refactoring.
James from CppDepend Team's user avatar
1 vote

How to prove business benefit in software refactoring?

I'm confused by the statement "cost to refactor a software become onerous" the cost of refactoring is a fairly linear thing. It's the cost of adding new features into a mess that grows exponentially. ...
JimmyJames's user avatar
  • 27.8k
1 vote
Accepted

How to prove business benefit in software refactoring?

Although I haven't had the chance myself to put this into practice, the Consortium for IT Software Quality recently released their Automated Technical Debt Measure standard as a mean to measure and ...
Jesus Alonso Abad's user avatar
1 vote

How to prove business benefit in software refactoring?

I mean, usually they don't create tasks to refactor or create tests, cause it will be a waste of money, they say: "the software is already working". If it is already working, why do they employ you ...
David Arno's user avatar
  • 39.4k
1 vote

Experiments correlating code metrics to bug density

However the question was asked 8 years ago I would like to add some more information. I asked this question to myself 2 years ago when I was working on software complexity analysis for our project. I ...
Adil Aliyev's user avatar
1 vote

How can I quantify the amount of technical debt that exists in a project?

I work for a company that is looking into this exactly. Below are 3 actionable metrics that we recommend to look at when tackling technical debt. For more information on "how" and "when" to track them,...
Stefanie 's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible