facebook / stetho
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 1,500 units with 11,618 lines of code in units (65.4% of code).
    • 0 very long units (0 lines of code)
    • 9 long units (568 lines of code)
    • 84 medium size units (2,514 lines of code)
    • 231 small units (3,325 lines of code)
    • 1,176 very small units (5,211 lines of code)
0% | 4% | 21% | 28% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 5% | 21% | 28% | 45%
js0% | 0% | 38% | 36% | 24%
py0% | 0% | 23% | 41% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
stetho/src/main0% | 4% | 23% | 27% | 44%
stetho-okhttp3/src/main0% | 38% | 0% | 0% | 61%
stetho-okhttp/src/main0% | 38% | 0% | 0% | 61%
stetho-sample/src/main0% | 0% | 14% | 39% | 45%
build-tools0% | 0% | 38% | 36% | 24%
scripts0% | 0% | 23% | 41% | 34%
stetho-timber/src/main0% | 0% | 100% | 0% | 0%
stetho-sample/src/debug0% | 0% | 18% | 48% | 33%
stetho-js-rhino/src/main0% | 0% | 0% | 44% | 55%
stetho-urlconnection/src/main0% | 0% | 0% | 25% | 74%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
79 14 1
79 23 1
73 10 3
62 24 2
56 11 1
56 11 1
55 3 2
55 12 5
53 8 2
49 2 2
48 6 2
47 14 2
46 5 2
45 10 1
44 10 0
43 11 1
43 21 2
42 7 5
41 12 1
39 7 0
38 7 2
37 11 1
36 6 6
36 10 1
36 7 3
35 14 2
35 11 1
35 8 1
35 5 1
34 4 2
34 6 1
33 6 0
33 11 2
32 8 1
31 7 2
31 6 3
30 8 4
30 3 3
30 8 2
30 3 1
30 2 2
30 4 3
30 5 0
30 11 5
30 3 2
30 11 2
29 9 2
29 3 3
29 4 1
28 1 1