facebook / openbmc-qemu
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 36,427 units with 659,090 lines of code in units (61.7% of code).
    • 121 very complex units (30,576 lines of code)
    • 449 complex units (54,297 lines of code)
    • 2,022 medium complex units (128,177 lines of code)
    • 3,586 simple units (121,432 lines of code)
    • 30,249 very simple units (324,608 lines of code)
4% | 8% | 19% | 18% | 49%
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% | 8% | 19% | 18% | 48%
inc25% | 8% | 18% | 15% | 32%
cc14% | 20% | 33% | 10% | 20%
pl20% | 5% | 19% | 16% | 38%
h1% | 1% | 5% | 7% | 84%
py0% | 5% | 13% | 18% | 61%
cpp0% | 19% | 13% | 15% | 50%
m0% | 0% | 0% | 8% | 91%
inl0% | 0% | 0% | 0% | 100%
frag0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
hw4% | 8% | 19% | 18% | 49%
tcg21% | 6% | 18% | 13% | 39%
ROOT7% | 19% | 15% | 18% | 39%
disas16% | 17% | 19% | 9% | 35%
softmmu11% | <1% | 12% | 18% | 56%
linux-user5% | 14% | 18% | 16% | 46%
block1% | 9% | 31% | 19% | 38%
ui3% | 8% | 14% | 22% | 51%
scripts4% | 6% | 16% | 18% | 54%
bsd-user13% | 5% | 28% | 17% | 34%
net4% | 1% | 21% | 20% | 51%
semihosting46% | 0% | 0% | 4% | 49%
tools3% | 7% | 21% | 24% | 43%
include2% | 0% | 5% | 2% | 89%
fpu4% | 8% | 14% | 10% | 61%
migration0% | 5% | 21% | 23% | 49%
util0% | 3% | 15% | 17% | 63%
libdecnumber0% | 32% | 35% | 14% | 17%
audio0% | 7% | 13% | 25% | 53%
monitor0% | 9% | 16% | 22% | 50%
qga0% | 8% | 19% | 24% | 47%
nbd0% | 13% | 32% | 21% | 33%
fsdev0% | 21% | 20% | 24% | 33%
dump0% | 14% | 12% | 29% | 43%
accel0% | 2% | 9% | 14% | 73%
scsi0% | 13% | 28% | 23% | 33%
pc-bios0% | 3% | 8% | 22% | 65%
contrib0% | 2% | 29% | 19% | 48%
chardev0% | 0% | 17% | 26% | 55%
io0% | 0% | 14% | 25% | 59%
crypto0% | 0% | 12% | 28% | 59%
qobject0% | 0% | 25% | 19% | 55%
backends0% | 0% | 10% | 21% | 68%
qapi0% | 0% | 9% | 10% | 80%
storage-daemon0% | 0% | 44% | 0% | 55%
plugins0% | 0% | 10% | 14% | 75%
qom0% | 0% | 4% | 13% | 81%
subprojects0% | 0% | 17% | 0% | 82%
python0% | 0% | 1% | 16% | 82%
replay0% | 0% | 0% | 26% | 73%
trace0% | 0% | 0% | 34% | 65%
ebpf0% | 0% | 0% | 27% | 72%
authz0% | 0% | 0% | 16% | 83%
stubs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
699 393 2
927 225 3
277 196 1
500 182 3
613 182 1
512 160 4
230 158 3
196 157 1
469 157 3
181 148 1
510 148 4
258 146 4
522 142 2
170 139 1
430 134 4
357 132 4
168 130 1
451 130 2
592 130 2
236 125 2
488 121 2
141 120 1
293 115 4
594 113 2
210 109 3
133 107 1
420 105 1
294 104 4
232 104 4
314 102 3
377 101 4
320 98 2
361 96 2
510 96 2
110 89 1
370 88 1
383 87 4
180 87 2
244 87 0
296 86 4
119 86 1
279 84 4
297 80 4
261 80 3
407 78 4
256 77 3
131 77 3
368 77 2
303 76 4
233 75 3