facebookincubator / BOLT
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 187,023 units with 2,373,304 lines of code in units (53.6% of code).
    • 945 very complex units (228,191 lines of code)
    • 2,290 complex units (230,841 lines of code)
    • 10,143 medium complex units (504,832 lines of code)
    • 16,546 simple units (423,824 lines of code)
    • 157,099 very simple units (985,616 lines of code)
9% | 9% | 21% | 17% | 41%
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
cpp11% | 10% | 23% | 18% | 36%
h1% | 2% | 5% | 8% | 81%
c2% | 4% | 19% | 22% | 51%
hpp12% | 16% | 18% | 15% | 35%
inc8% | 12% | 13% | 18% | 47%
py1% | 5% | 20% | 20% | 52%
cc1% | <1% | 10% | 16% | 71%
mm3% | 7% | 36% | 22% | 30%
pl0% | 4% | 9% | 27% | 58%
pm0% | 0% | 24% | 22% | 52%
js0% | 0% | 12% | 32% | 55%
go0% | 0% | 8% | <1% | 91%
jl0% | 0% | 0% | 42% | 58%
inl0% | 0% | 0% | 21% | 78%
cs0% | 0% | 0% | 14% | 85%
py30% | 0% | 0% | 31% | 68%
ts0% | 0% | 0% | 16% | 83%
pyi0% | 0% | 0% | 0% | 100%
ipp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
llvm12% | 11% | 22% | 17% | 35%
clang11% | 9% | 20% | 16% | 42%
lldb8% | 9% | 21% | 18% | 42%
openmp10% | 9% | 22% | 17% | 39%
flang5% | 6% | 18% | 18% | 51%
lld9% | 9% | 21% | 21% | 38%
bolt8% | 13% | 30% | 17% | 29%
clang-tools-extra1% | 6% | 17% | 19% | 55%
compiler-rt1% | 2% | 14% | 19% | 63%
mlir<1% | 4% | 20% | 22% | 52%
libunwind11% | 14% | 19% | 14% | 40%
polly<1% | 3% | 18% | 23% | 54%
libc0% | 7% | 12% | 19% | 60%
libcxxabi0% | 8% | 1% | 15% | 74%
libcxx0% | <1% | 10% | 15% | 72%
libclc0% | 0% | 13% | 3% | 82%
pstl0% | 0% | 5% | 12% | 82%
utils0% | 0% | 53% | 0% | 46%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1508 907 1
1846 879 2
776 732 3
2084 700 6
494 642 6
811 604 4
1966 474 1
1152 451 1
966 441 3
1325 441 1
1074 397 7
718 389 2
1209 388 10
258 388 3
425 382 1
431 377 2
399 365 1
697 354 7
328 325 2
886 323 1
924 323 2
403 318 1
1562 316 1
172 314 3
314 307 1
311 306 3
306 301 1
831 298 1
268 297 2
350 296 2
267 295 2
80 287 1
1001 287 1
881 284 5
541 283 1
590 275 2
694 271 3
666 271 3
732 268 8
465 268 6
393 266 1
995 266 11
409 266 3
552 261 1
717 260 6
517 256 1
695 256 1
591 255 3
434 255 4
903 254 1