whatsapp / StringPacks
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 178 units with 2,031 lines of code in units (75.9% of code).
    • 1 very long units (592 lines of code)
    • 0 long units (0 lines of code)
    • 16 medium size units (447 lines of code)
    • 21 small units (319 lines of code)
    • 140 very small units (673 lines of code)
29% | 0% | 22% | 15% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java41% | 0% | 14% | 13% | 29%
py0% | 0% | 39% | 20% | 40%
kt0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
library/src/main/java/com/whatsapp46% | 0% | 12% | 15% | 25%
library/scripts0% | 0% | 39% | 20% | 40%
sample/app/src/main/java/com0% | 0% | 33% | 0% | 66%
library/templates0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
592 286 0
40 8 2
36 11 4
36 11 2
33 7 4
30 8 1
28 4 1
28 5 1
26 12 2
26 5 1
26 2 0
25 6 2
23 4 1
23 7 1
23 3 2
22 6 3
22 3 4
20 5 1
19 7 2
19 4 1
19 2 3
17 7 2
17 3 2
17 5 3
16 6 1
16 4 1
15 4 1
15 3 1
15 2 1
15 5 1
14 3 4
14 5 2
14 4 1
13 2 1
11 6 1
11 1 0
11 2 3
11 4 1
10 3 3
10 2 2
10 2 2
10 1 2
10 3 1
10 3 0
10 3 1
10 3 0
9 4 1
9 5 2
9 2 2
9 1 2