Linux / Scripts
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,586 units with 32,010 lines of code in units (24.7% of code).
    • 13 very complex units (2,648 lines of code)
    • 27 complex units (3,104 lines of code)
    • 139 medium complex units (7,337 lines of code)
    • 229 simple units (6,133 lines of code)
    • 1,178 very simple units (12,788 lines of code)
8% | 9% | 22% | 19% | 39%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
c8% | 11% | 23% | 19% | 36%
pl13% | 6% | 19% | 17% | 42%
h0% | 19% | 18% | 6% | 55%
cc0% | 6% | 33% | 24% | 36%
py0% | 0% | 19% | 22% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
kconfig15% | 17% | 20% | 16% | 29%
ROOT10% | 11% | 21% | 16% | 39%
dtc3% | 0% | 27% | 23% | 45%
mod0% | 7% | 20% | 18% | 53%
gcc-plugins0% | 5% | 17% | 35% | 41%
selinux0% | 0% | 96% | 0% | 3%
genksyms0% | 0% | 58% | 13% | 27%
gdb0% | 0% | 11% | 24% | 63%
basic0% | 0% | 31% | 14% | 54%
clang-tools0% | 0% | 0% | 30% | 69%
tracing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
465 138 0
209 76 4
179 69 2
261 65 0
234 63 5
191 60 9
155 59 1
183 59 2
140 58 3
133 53 1
176 52 1
166 51 1
156 51 0
154 45 2
172 44 5
123 43 1
206 43 3
120 43 0
149 41 0
109 38 1
106 37 2
141 37 0
156 36 6
167 36 2
80 34 1
108 33 1
109 31 1
141 31 1
67 30 1
118 29 2
54 28 1
99 28 3
103 28 2
61 27 1
64 27 1
90 27 2
99 26 1
82 26 1
94 26 1
132 26 2
58 25 2
58 25 1
56 25 0
108 24 2
90 24 2
92 24 2
87 24 2
178 24 2
106 24 0
51 23 1