mapillary / iD
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,502 units with 44,466 lines of code in units (66.8% of code).
    • 3 very complex units (469 lines of code)
    • 15 complex units (1,554 lines of code)
    • 151 medium complex units (6,972 lines of code)
    • 330 simple units (8,504 lines of code)
    • 3,003 very simple units (26,967 lines of code)
1% | 3% | 15% | 19% | 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
js1% | 3% | 15% | 19% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
modules/ui1% | 1% | 13% | 17% | 64%
modules/osm8% | 10% | 19% | 15% | 46%
modules/actions0% | 14% | 24% | 22% | 38%
modules/util0% | 10% | 9% | 16% | 62%
modules/renderer0% | 6% | 24% | 19% | 49%
modules/core0% | 6% | 22% | 13% | 57%
ROOT0% | 12% | 23% | 13% | 50%
modules/svg0% | 2% | 6% | 29% | 61%
modules/entities0% | 29% | 20% | 0% | 50%
modules/behavior0% | 3% | 10% | 16% | 69%
modules/validations0% | 1% | 18% | 16% | 64%
modules/services0% | 0% | 24% | 22% | 53%
modules/modes0% | 0% | 13% | 11% | 75%
modules/presets0% | 0% | 11% | 26% | 61%
modules/operations0% | 0% | 8% | 24% | 66%
data0% | 0% | 17% | 10% | 72%
modules/geo0% | 0% | 5% | 30% | 63%
modules0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
140 59 4
194 57 0
135 56 0
127 49 2
29 43 4
109 41 1
73 41 1
177 39 3
84 38 3
85 34 1
119 32 3
51 32 4
127 31 1
137 30 2
102 29 2
210 29 1
46 26 1
78 26 2
72 25 2
96 25 1
110 25 4
44 23 2
76 23 0
46 23 2
41 22 0
54 22 0
47 22 4
81 21 1
69 21 0
36 21 1
60 21 2
85 20 0
33 20 3
34 20 2
30 20 2
41 20 2
102 19 1
64 19 0
28 19 2
70 19 2
18 19 1
101 19 3
58 19 2
27 18 0
20 18 3
158 18 1
80 18 1
62 18 3
42 18 3
54 18 2