Linux / Tools
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 16,035 units with 315,398 lines of code in units (62.2% of code).
    • 55 very complex units (12,683 lines of code)
    • 197 complex units (21,988 lines of code)
    • 1,116 medium complex units (67,513 lines of code)
    • 2,164 simple units (68,744 lines of code)
    • 12,503 very simple units (144,470 lines of code)
4% | 6% | 21% | 21% | 45%
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
c4% | 7% | 22% | 23% | 42%
h5% | <1% | 3% | 6% | 83%
pl5% | 10% | 31% | 16% | 35%
py0% | 2% | 12% | 9% | 75%
pm0% | 0% | 0% | 45% | 54%
cpp0% | 0% | 0% | 27% | 72%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
perf4% | 6% | 20% | 22% | 45%
testing2% | 4% | 21% | 22% | 49%
power4% | 9% | 24% | 16% | 44%
lib3% | 13% | 21% | 21% | 39%
objtool20% | 5% | 27% | 20% | 25%
bpf6% | 8% | 24% | 28% | 32%
iio28% | 11% | 29% | 18% | 12%
accounting62% | 0% | 0% | 6% | 30%
usb4% | 8% | 12% | 36% | 38%
vm0% | 25% | 20% | 19% | 33%
hv0% | 23% | 35% | 18% | 22%
tracing0% | 6% | 20% | 14% | 58%
firewire0% | 85% | 0% | 0% | 14%
pci0% | 54% | 45% | 0% | 0%
arch0% | 8% | 20% | 21% | 49%
gpio0% | 0% | 46% | 33% | 20%
thermal0% | 0% | 20% | 20% | 58%
bootconfig0% | 0% | 56% | 16% | 26%
io_uring0% | 0% | 25% | 26% | 47%
virtio0% | 0% | 15% | 5% | 79%
firmware0% | 0% | 74% | 3% | 22%
laptop0% | 0% | 25% | 29% | 45%
cgroup0% | 0% | 13% | 3% | 82%
spi0% | 0% | 39% | 40% | 20%
build0% | 0% | 7% | 0% | 92%
include0% | 0% | 1% | 7% | 90%
wmi0% | 0% | 0% | 53% | 46%
leds0% | 0% | 0% | 100% | 0%
counter0% | 0% | 0% | 100% | 0%
pcmcia0% | 0% | 0% | 0% | 100%
rcu0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
246 182 3
161 140 1
385 127 2
385 127 2
242 121 3
226 106 4
326 101 7
288 101 2
257 100 0
385 100 8
343 98 3
199 94 3
442 92 2
379 91 9
115 88 1
354 85 2
491 83 2
281 73 1
162 73 1
219 73 3
174 73 4
250 72 1
206 72 5
229 70 2
210 69 2
334 69 2
263 67 2
147 66 3
81 63 3
252 62 2
300 62 2
218 59 7
201 59 3
182 59 3
144 59 1
141 56 3
207 56 6
269 55 1
207 55 2
197 54 0
129 54 5
199 54 3
181 54 3
190 53 2
163 53 2
49 53 1
208 52 2
292 52 1
162 52 6
181 52 2