Linux / Drivers / Firmware
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,480 units with 27,448 lines of code in units (68.5% of code).
    • 0 very complex units (0 lines of code)
    • 7 complex units (1,006 lines of code)
    • 82 medium complex units (5,015 lines of code)
    • 217 simple units (7,328 lines of code)
    • 1,174 very simple units (14,099 lines of code)
0% | 3% | 18% | 26% | 51%
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
c0% | 3% | 18% | 26% | 51%
h0% | 0% | 0% | 30% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
efi0% | 6% | 25% | 32% | 35%
cirrus0% | 17% | 22% | 16% | 44%
ROOT0% | 1% | 17% | 28% | 51%
arm_scmi0% | 0% | 15% | 18% | 65%
tegra0% | 0% | 18% | 23% | 57%
google0% | 0% | 21% | 12% | 66%
imx0% | 0% | 10% | 40% | 48%
xilinx0% | 0% | 7% | 13% | 79%
psci0% | 0% | 0% | 38% | 61%
broadcom0% | 0% | 0% | 24% | 75%
smccc0% | 0% | 0% | 64% | 35%
meson0% | 0% | 0% | 59% | 40%
arm_ffa0% | 0% | 0% | 11% | 88%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
170 50 4
127 34 3
171 32 3
160 29 3
155 27 1
92 27 7
131 27 2
51 21 2
84 20 1
89 20 3
98 19 1
46 19 3
92 19 2
115 18 1
40 18 4
83 18 2
44 18 1
68 18 1
90 18 7
44 18 1
90 17 2
86 17 2
66 17 3
119 17 1
49 17 2
69 17 1
34 16 2
62 16 4
62 16 8
76 16 3
73 16 1
44 16 2
56 15 3
60 15 3
58 15 1
93 15 2
49 15 3
49 15 1
67 15 3
62 15 5
60 15 1
50 14 6
45 14 1
100 14 1
56 14 1
77 14 1
80 14 2
59 14 5
60 14 1
83 14 1