facebookincubator / OnlineSchemaChange
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 390 units with 4,739 lines of code in units (69.4% of code).
    • 1 very complex units (155 lines of code)
    • 2 complex units (158 lines of code)
    • 17 medium complex units (690 lines of code)
    • 39 simple units (847 lines of code)
    • 331 very simple units (2,889 lines of code)
3% | 3% | 14% | 17% | 60%
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
py3% | 3% | 14% | 17% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
core/lib/sqlparse12% | 12% | 21% | 14% | 38%
core/lib/payload0% | 0% | 15% | 21% | 63%
core/commands0% | 0% | 8% | 4% | 86%
core/lib0% | 0% | 0% | 19% | 80%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
155 55 2
84 33 2
74 26 1
32 22 2
50 21 1
59 21 1
32 17 2
34 16 3
40 16 3
42 16 1
37 15 1
31 14 1
78 14 3
50 13 2
47 13 1
27 12 1
58 12 1
15 11 2
38 11 1
20 11 1
27 10 1
21 10 2
43 10 1
26 9 1
15 9 2
24 9 2
38 9 1
40 9 2
12 8 2
14 8 1
17 8 1
31 8 1
33 8 1
24 8 2
23 8 2
27 8 1
25 8 1
22 8 1
14 7 2
14 7 2
22 7 1
14 7 1
29 7 2
12 7 1
33 7 1
23 7 1
21 6 1
19 6 1
15 6 1
16 6 1