facebook / mysql-5.6
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 25,982 units with 435,099 lines of code in units (33.1% of code).
    • 120 very complex units (38,948 lines of code)
    • 293 complex units (40,157 lines of code)
    • 1,232 medium complex units (85,698 lines of code)
    • 2,153 simple units (77,099 lines of code)
    • 22,184 very simple units (193,197 lines of code)
8% | 9% | 19% | 17% | 44%
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
cc10% | 11% | 21% | 19% | 37%
c15% | 12% | 24% | 19% | 28%
cpp5% | 6% | 26% | 16% | 44%
java2% | 2% | 4% | 8% | 82%
pl7% | 15% | 21% | 16% | 38%
py3% | 14% | 17% | 19% | 44%
pm0% | 13% | 14% | 15% | 56%
h0% | <1% | 3% | 7% | 88%
inc0% | 0% | 13% | 24% | 61%
hpp0% | 0% | 1% | 4% | 94%
js0% | 0% | 17% | 13% | 69%
php0% | 0% | 0% | 25% | 74%
t0% | 0% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sql10% | 9% | 20% | 17% | 41%
storage9% | 9% | 19% | 15% | 45%
client20% | 16% | 22% | 16% | 24%
zlib25% | 15% | 21% | 18% | 18%
plugin6% | 10% | 16% | 21% | 45%
strings13% | 23% | 20% | 19% | 23%
xtrabackup28% | 0% | 15% | 5% | 50%
mysys4% | 8% | 26% | 23% | 36%
mysys_ssl25% | 22% | 8% | 18% | 25%
extra2% | 1% | 17% | 12% | 65%
sql-common11% | 11% | 17% | 29% | 30%
dbug16% | 0% | 7% | 26% | 48%
regex25% | 0% | 44% | 11% | 18%
arcanist6% | 18% | 19% | 19% | 35%
libmysql4% | 6% | 26% | 22% | 39%
mysql-test0% | 5% | 15% | 21% | 56%
libmysqld0% | 10% | 14% | 20% | 54%
fbson0% | 5% | 26% | 22% | 45%
libevent0% | 7% | 17% | 4% | 71%
unittest0% | 0% | 9% | 10% | 80%
vio0% | 0% | 16% | 39% | 43%
packaging0% | 0% | 73% | 0% | 26%
win0% | 0% | 49% | 21% | 29%
scripts0% | 0% | 0% | 66% | 33%
utils0% | 0% | 0% | 41% | 58%
cmake0% | 0% | 0% | 58% | 41%
include0% | 0% | 0% | 4% | 95%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
783 227 4
960 197 5
660 195 5
631 188 2
1008 188 4
795 178 2
594 172 2
750 171 4
590 171 2
703 168 9
595 165 4
177 156 1
655 154 7
553 154 12
362 144 2
680 139 9
318 136 3
538 132 6
366 128 2
562 124 2
330 119 6
183 117 8
40 115 1
524 111 3
411 110 3
401 109 1
455 106 4
395 106 8
345 106 6
366 105 6
593 103 9
221 99 6
319 99 6
510 98 9
271 98 7
119 97 1
263 96 2
372 96 7
398 96 9
268 96 0
126 94 1
297 93 2
211 93 3
257 92 2
213 92 4
244 91 1
332 90 3
195 86 1
430 86 3
456 86 8