facebook / openbmc-linux
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 473,893 units with 9,568,212 lines of code in units (56.7% of code).
    • 951 very complex units (262,457 lines of code)
    • 4,547 complex units (590,536 lines of code)
    • 30,835 medium complex units (2,016,601 lines of code)
    • 61,951 simple units (2,172,378 lines of code)
    • 375,609 very simple units (4,526,240 lines of code)
2% | 6% | 21% | 22% | 47%
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% | 21% | 23% | 46%
h<1% | 1% | 2% | 5% | 90%
pl7% | 6% | 20% | 17% | 47%
py0% | 2% | 13% | 10% | 73%
cc0% | 7% | 35% | 14% | 42%
pm0% | 0% | 0% | 45% | 54%
cpp0% | 0% | 0% | 27% | 72%
uc0% | 0% | 0% | 0% | 100%
inl0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
drivers2% | 6% | 21% | 23% | 46%
arch3% | 4% | 14% | 19% | 59%
fs3% | 9% | 26% | 23% | 36%
net2% | 8% | 23% | 22% | 42%
sound2% | 4% | 21% | 23% | 48%
tools4% | 7% | 21% | 20% | 46%
scripts8% | 10% | 21% | 19% | 39%
lib4% | 11% | 16% | 16% | 51%
kernel1% | 3% | 15% | 22% | 57%
security2% | 8% | 21% | 23% | 43%
crypto4% | 2% | 15% | 16% | 60%
mm<1% | 5% | 21% | 22% | 49%
block<1% | 3% | 17% | 23% | 54%
virt0% | 5% | 14% | 22% | 57%
ipc0% | 9% | 26% | 20% | 43%
init0% | 3% | 25% | 29% | 41%
include0% | <1% | 1% | 4% | 94%
usr0% | 0% | 35% | 10% | 54%
certs0% | 0% | 20% | 22% | 56%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1142 1135 2
1014 1006 2
1009 1001 2
832 827 2
767 767 2
726 718 2
701 694 2
683 676 2
677 670 2
635 628 2
612 604 2
502 495 2
470 462 2
1751 413 1
1749 411 1
1758 393 1
398 391 2
1300 366 3
361 351 2
550 338 3
329 322 2
329 322 2
1239 319 6
1182 307 5
639 303 3
862 300 1
793 283 4
677 256 0
263 256 2
892 253 2
928 246 3
251 243 2
246 239 2
568 236 5
342 235 8
542 230 5
685 229 5
507 219 3
220 213 2
1236 212 1
501 210 4
231 208 1
931 207 3
218 207 2
680 205 5
210 203 2
212 197 2
734 195 1
202 195 2
634 194 4