mapillary / mapillary-js
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,828 units with 23,393 lines of code in units (74.2% of code).
    • 22 very long units (4,493 lines of code)
    • 41 long units (2,944 lines of code)
    • 184 medium size units (5,599 lines of code)
    • 314 small units (4,619 lines of code)
    • 1,267 very small units (5,738 lines of code)
19% | 12% | 23% | 19% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts19% | 12% | 23% | 19% | 24%
js0% | 0% | 20% | 40% | 38%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/component24% | 9% | 21% | 20% | 24%
src/viewer21% | 22% | 22% | 18% | 14%
src/graph19% | 29% | 27% | 3% | 19%
src/render24% | 0% | 16% | 21% | 37%
src/state0% | 3% | 23% | 25% | 47%
src/api0% | 7% | 36% | 24% | 31%
src/tile0% | 8% | 41% | 26% | 22%
src/geo0% | 0% | 37% | 29% | 33%
doc/src0% | 0% | 20% | 41% | 38%
src/util0% | 0% | 15% | 31% | 52%
src/error0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
560 47 0
383 23 0
354 27 0
323 25 0
277 14 0
269 28 0
216 9 0
199 7 2
186 23 1
183 10 0
155 6 0
155 27 0
151 33 2
148 72 2
137 31 3
133 13 0
125 27 3
118 9 0
111 25 2
105 11 2
103 8 0
102 17 1
94 11 2
94 1 2
93 20 3
90 1 2
86 19 3
86 5 0
86 4 0
86 1 2
85 5 0
82 1 2
82 1 2
78 9 2
78 22 2
78 1 2
77 10 3
77 19 2
77 13 2
74 17 1
74 14 6
74 1 2
73 18 4
70 1 2
68 19 2
68 8 2
66 23 3
66 4 0
66 1 2
65 6 3