mapillary / inplace_abn
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 120 units with 1,571 lines of code in units (46.0% of code).
    • 1 very long units (108 lines of code)
    • 3 long units (192 lines of code)
    • 16 medium size units (508 lines of code)
    • 24 small units (338 lines of code)
    • 76 very small units (425 lines of code)
6% | 12% | 32% | 21% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 16% | 23% | 22% | 28%
cpp0% | 0% | 78% | 13% | 8%
h0% | 0% | 0% | 50% | 50%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts46% | 30% | 15% | 5% | 2%
scripts/models0% | 30% | 20% | 28% | 20%
scripts/imagenet0% | 20% | 41% | 0% | 38%
src0% | 0% | 78% | 13% | 8%
inplace_abn0% | 0% | 21% | 39% | 39%
scripts/modules0% | 0% | 18% | 34% | 47%
include0% | 0% | 0% | 50% | 50%
scripts/dataset0% | 0% | 0% | 45% | 54%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
108 15 0
70 18 6
69 18 5
53 11 2
46 9 4
46 6 6
40 10 2
39 4 1
39 8 7
36 16 1
34 3 8
33 8 8
30 7 8
27 3 3
25 5 2
25 4 7
24 5 1
22 5 2
21 5 4
21 7 3
20 10 1
20 2 8
20 3 4
17 8 1
17 5 2
16 1 2
15 1 2
14 2 5
14 2 5
14 1 0
14 3 3
13 2 2
13 2 2
13 3 2
13 4 2
12 2 5
12 1 0
12 2 2
12 7 3
12 10 3
12 2 2
11 3 2
11 1 0
11 5 4
10 2 2
10 1 0
10 2 2
10 2 3
10 2 2
10 1 1