facebook / openbmc-uboot
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 47,844 units with 948,325 lines of code in units (43.7% of code).
    • 99 very complex units (28,076 lines of code)
    • 432 complex units (60,217 lines of code)
    • 2,970 medium complex units (186,001 lines of code)
    • 5,732 simple units (195,156 lines of code)
    • 38,611 very simple units (478,875 lines of code)
2% | 6% | 19% | 20% | 50%
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
c2% | 6% | 19% | 20% | 50%
pl33% | 3% | 19% | 17% | 27%
h1% | 2% | 18% | 14% | 62%
py0% | 5% | 23% | 17% | 52%
cc0% | 8% | 35% | 14% | 41%
inc0% | 0% | 100% | 0% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
drivers2% | 5% | 18% | 21% | 51%
arch3% | 5% | 18% | 20% | 52%
lib7% | 9% | 25% | 23% | 34%
scripts16% | 9% | 21% | 17% | 35%
board1% | 5% | 14% | 13% | 64%
fs4% | 8% | 32% | 21% | 33%
cmd4% | 7% | 29% | 26% | 32%
tools3% | 8% | 24% | 21% | 42%
common3% | 7% | 23% | 23% | 41%
net0% | 19% | 20% | 22% | 37%
disk0% | 13% | 23% | 25% | 36%
post0% | 3% | 46% | 23% | 26%
include0% | 1% | 1% | 5% | 90%
env0% | 2% | 24% | 28% | 44%
doc0% | 0% | 21% | 16% | 61%
api0% | 0% | 18% | 18% | 62%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
861 332 0
587 171 2
922 150 1
644 144 1
436 118 9
436 118 9
430 114 4
408 106 1
453 104 4
705 103 2
494 102 0
515 99 7
432 94 1
261 93 2
180 91 3
463 91 7
550 90 14
327 89 4
373 89 5
270 89 1
445 88 4
178 86 2
168 84 1
297 84 4
276 83 8
186 82 1
260 79 4
477 77 1
378 77 8
359 76 1
209 76 4
476 75 3
204 74 2
258 74 1
251 73 4
464 73 3
260 73 1
352 73 7
244 73 4
339 72 4
404 71 4
234 71 4
163 71 4
219 70 1
269 69 2
296 68 8
226 68 1
283 67 2
343 67 5
261 65 0