Skip to main content

All Questions

0 votes
3 answers
672 views

Reducing Cognitive Complexity of Single-Responsibility "Arrow-Code"

Prompted by Sonar, I am looking to reduce the complexity of a function (one that some might call arrow code). I am loosely familiar with some of the principles of reducing arrow code complexity (...
j.k's user avatar
  • 111
4 votes
2 answers
1k views

Summing cyclomatic complexity of function or files

Is the sum of the cyclomatic complexity of all section in a file the total cyclomatic complexity for this file? If it is, is the sum of a set of related files the total cyclomatic complexity for this ...
cervh's user avatar
  • 83
0 votes
3 answers
1k views

Code pattern to have the least possible code complexity (Javascript)

I've been looking for the ideal coding patterns used to score well in a Cyclomatic Complexity. Of course, code will be subject to change according to what is being developed but regardless the ...
Matthew Barbara's user avatar
8 votes
3 answers
4k views

Cyclomatic Complexity spread over non-reusable functions

I am frequently writing parser and mappers of some sort. This means that the switch statement gets used a lot and often many if statements for checking for valid input. This of course creates a lot ...
Johnny's user avatar
  • 91
8 votes
1 answer
2k views

Complexity of a web application

I am currently writing my Master's Thesis on maintainability of a web application. I found some methods like the "Maintainability Index" by Coleman et.al. or the "Software Maintainability Index" by ...
Dominik G's user avatar
  • 255
11 votes
4 answers
4k views

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

In general, maintainability index relies on many factors. For example, in Visual Studio, it rely on cyclomatic complexity, depth of inheritance, class coupling and lines of code; those four values ...
Arseni Mourzenko's user avatar