facebook / squangle
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 662 units with 5,265 lines of code in units (56.0% of code).
    • 2 very long units (253 lines of code)
    • 2 long units (126 lines of code)
    • 44 medium size units (1,348 lines of code)
    • 85 small units (1,226 lines of code)
    • 529 very small units (2,312 lines of code)
4% | 2% | 25% | 23% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp6% | 3% | 33% | 28% | 28%
h0% | 0% | 5% | 9% | 85%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mysql_client5% | 2% | 25% | 24% | 42%
logger0% | 0% | 24% | 8% | 67%
base0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
145 52 2
108 25 0
66 14 0
60 9 2
45 7 0
45 7 2
44 7 0
43 20 5
42 7 2
41 11 2
41 3 3
40 7 2
40 7 2
35 5 0
34 7 0
34 3 3
34 5 1
33 6 1
32 2 1
32 10 1
32 6 1
30 6 5
30 2 6
29 14 1
28 6 0
28 6 0
28 7 0
28 3 0
28 4 2
28 2 4
27 5 1
27 5 3
27 6 2
26 11 1
26 10 1
26 5 2
26 6 0
26 2 1
26 2 1
25 2 4
25 3 0
24 4 1
23 6 1
23 5 1
22 2 0
22 5 1
22 6 0
21 8 1
20 6 1
20 6 0