mapillary / seamseg
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 335 units with 4,314 lines of code in units (80.6% of code).
    • 1 very long units (104 lines of code)
    • 12 long units (827 lines of code)
    • 41 medium size units (1,323 lines of code)
    • 68 small units (1,038 lines of code)
    • 213 very small units (1,022 lines of code)
2% | 19% | 30% | 24% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 21% | 29% | 23% | 22%
cpp0% | 0% | 54% | 35% | 9%
h0% | 0% | 0% | 20% | 79%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts9% | 60% | 25% | 0% | 4%
scripts/data_preparation0% | 41% | 29% | 10% | 18%
seamseg/models0% | 17% | 49% | 28% | 4%
seamseg/algos0% | 0% | 36% | 41% | 22%
seamseg/utils0% | 0% | 32% | 26% | 40%
src/roi_sampling0% | 0% | 56% | 43% | 0%
seamseg/modules0% | 0% | 17% | 53% | 29%
seamseg/data0% | 0% | 15% | 28% | 56%
src/nms0% | 0% | 61% | 21% | 17%
scripts/utility0% | 0% | 90% | 0% | 9%
src/bbx0% | 0% | 42% | 32% | 25%
include0% | 0% | 0% | 26% | 73%
include/utils0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
seamseg/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
104 17 1
98 23 4
92 17 1
91 17 1
75 8 3
66 8 3
62 7 3
61 14 4
60 14 4
59 11 1
58 12 1
54 11 6
51 16 8
50 8 8
48 11 5
48 9 6
47 11 8
47 9 6
45 12 7
45 12 3
45 15 5
42 10 2
42 7 2
41 10 5
38 6 8
36 6 7
35 12 7
34 20 3
32 14 3
32 14 3
32 14 3
31 5 7
30 1 4
30 1 4
30 1 4
30 8 7
29 8 3
28 6 3
27 7 4
26 1 15
25 10 1
24 7 1
24 6 5
24 4 5
24 1 7
24 2 7
23 9 6
23 5 5
23 4 2
23 4 3