facebook / transform360
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 40 units with 2,000 lines of code in units (75.8% of code).
    • 3 very long units (703 lines of code)
    • 12 long units (820 lines of code)
    • 11 medium size units (331 lines of code)
    • 7 small units (111 lines of code)
    • 7 very small units (35 lines of code)
35% | 41% | 16% | 5% | 1%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp40% | 31% | 24% | 2% | 1%
c28% | 52% | 7% | 9% | 1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Transform360/Library40% | 31% | 24% | 2% | 1%
Transform_V139% | 40% | 9% | 10% | 0%
Transform3600% | 87% | 0% | 6% | 6%
Alternative Visuals
Longest Units
Top 40 longest units
Unit# linesMcCabe index# params
321 79 6
259 82 7
123 21 5
88 17 1
81 21 1
80 15 6
74 9 3
70 11 4
69 12 4
66 10 8
65 25 5
62 19 5
58 5 4
56 9 2
51 7 2
39 3 7
39 2 10
36 3 8
35 7 7
30 2 9
29 8 2
28 4 6
27 3 3
24 1 11
22 3 6
22 5 4
18 5 4
17 2 1
17 3 1
16 6 2
15 6 2
14 3 1
14 1 6
8 1 4
8 1 5
7 1 1
3 1 2
3 1 1
3 1 2
3 1 1