facebookincubator / RapiD
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 3,587 units with 54,233 lines of code in units (78.8% of code).
    • 3 very complex units (616 lines of code)
    • 24 complex units (2,756 lines of code)
    • 176 medium complex units (9,089 lines of code)
    • 422 simple units (13,555 lines of code)
    • 2,962 very simple units (28,217 lines of code)
1% | 5% | 16% | 24% | 52%
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
js1% | 5% | 16% | 24% | 52%
py0% | 0% | 0% | 100% | 0%
cjs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
modules/presets52% | 0% | 15% | 11% | 20%
modules/osm7% | 10% | 21% | 15% | 45%
modules/services2% | 0% | 18% | 27% | 51%
modules/ui0% | 3% | 17% | 28% | 51%
modules/core0% | 19% | 25% | 12% | 41%
modules/actions0% | 19% | 19% | 22% | 38%
modules/renderer0% | 15% | 20% | 19% | 44%
modules/util0% | 11% | 15% | 17% | 55%
modules/svg0% | 2% | 5% | 27% | 64%
modules/validations0% | 3% | 15% | 21% | 59%
modules/behavior0% | 4% | 13% | 26% | 56%
modules/operations0% | 0% | 21% | 18% | 60%
modules/modes0% | 0% | 8% | 18% | 72%
scripts0% | 0% | 19% | 45% | 35%
modules/geo0% | 0% | 0% | 66% | 33%
ROOT0% | 0% | 0% | 0% | 100%
modules0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
344 120 0
139 59 4
133 54 2
127 49 2
99 48 2
145 45 1
222 44 1
27 43 4
98 42 1
177 39 3
133 37 3
210 36 0
109 35 1
131 34 3
85 34 1
45 33 0
55 32 4
53 31 3
296 30 1
84 30 1
137 30 2
64 28 4
99 27 1
55 27 2
95 26 1
78 26 2
132 26 4
72 25 2
48 24 2
78 24 1
79 24 3
67 23 3
70 23 2
174 22 1
48 22 0
47 22 4
106 22 0
58 22 1
40 22 2
102 22 1
69 21 1
36 21 1
77 21 1
63 21 2
47 20 2
172 20 1
34 20 0
138 20 1
33 20 3
34 20 2