facebook / fresco
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 4,432 units with 35,554 lines of code in units (63.7% of code).
    • 1 very long units (111 lines of code)
    • 41 long units (2,734 lines of code)
    • 289 medium size units (8,453 lines of code)
    • 593 small units (8,405 lines of code)
    • 3,508 very small units (15,851 lines of code)
<1% | 7% | 23% | 23% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java<1% | 5% | 21% | 25% | 47%
c0% | 44% | 36% | 7% | 11%
cpp0% | 13% | 40% | 18% | 27%
kt0% | 11% | 28% | 14% | 45%
py0% | 0% | 43% | 27% | 28%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
drawee2% | 4% | 17% | 22% | 52%
imagepipeline0% | 9% | 30% | 24% | 35%
native-filters0% | 48% | 30% | 2% | 18%
vito0% | 8% | 18% | 24% | 48%
animated-gif0% | 19% | 22% | 10% | 47%
static-webp0% | 11% | 38% | 19% | 30%
imagepipeline-backends0% | 33% | 21% | 9% | 36%
animated-drawable0% | 7% | 22% | 31% | 39%
native-imagetranscoder0% | 7% | 49% | 26% | 17%
drawee-backends0% | 4% | 24% | 22% | 49%
tools0% | 11% | 15% | 22% | 50%
imagepipeline-base0% | 2% | 19% | 30% | 47%
fbcore0% | 0% | 7% | 25% | 66%
animated-base0% | 0% | 28% | 26% | 44%
imagepipeline-native0% | 0% | 43% | 29% | 26%
animated-gif-lite0% | 0% | 20% | 28% | 50%
ROOT0% | 0% | 43% | 27% | 28%
memory-types0% | 0% | 23% | 29% | 47%
drawee-span0% | 0% | 26% | 12% | 60%
middleware0% | 0% | 100% | 0% | 0%
animated-webp0% | 0% | 10% | 21% | 68%
imagepipeline-base-test0% | 0% | 5% | 26% | 67%
ui-common0% | 0% | 0% | 50% | 50%
imagepipeline-test0% | 0% | 0% | 19% | 80%
viewport0% | 0% | 0% | 0% | 100%
soloader0% | 0% | 0% | 0% | 100%
mockito-config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
111 49 3
94 20 4
93 20 6
91 26 4
86 18 1
82 16 4
81 18 5
79 7 7
77 13 2
77 9 2
74 9 2
74 6 7
74 6 3
72 21 1
72 18 4
71 10 0
68 13 5
67 4 2
67 11 4
67 14 5
65 2 2
65 9 3
64 9 1
64 13 4
63 12 7
61 13 1
60 50 1
60 9 1
59 6 6
58 1 28
57 5 3
56 10 1
56 7 3
56 7 3
55 8 6
54 6 2
54 12 6
54 15 0
53 6 8
52 14 2
51 5 3
51 7 5
50 7 2
50 1 23
50 12 4
49 1 3
49 1 22
49 13 1
49 9 1
49 12 3