facebook / fbshipit
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 359 units with 4,814 lines of code in units (88.6% of code).
    • 2 very long units (251 lines of code)
    • 13 long units (882 lines of code)
    • 48 medium size units (1,541 lines of code)
    • 63 small units (976 lines of code)
    • 233 very small units (1,164 lines of code)
5% | 18% | 32% | 20% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php5% | 18% | 32% | 20% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/shipit/phase11% | 27% | 30% | 16% | 13%
src/shipit8% | 11% | 17% | 19% | 43%
src/shipit/repo0% | 12% | 48% | 22% | 15%
src/importit/phase0% | 59% | 25% | 6% | 8%
src/importit/repo0% | 69% | 0% | 28% | 2%
src/shipit/filter0% | 9% | 52% | 26% | 11%
src/importit/filter0% | 0% | 65% | 26% | 8%
src/shipit/github0% | 0% | 0% | 25% | 74%
src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
148 6 3
103 22 0
100 6 2
81 4 5
77 12 0
72 6 1
71 3 0
69 1 0
66 10 2
63 1 0
62 15 1
59 10 2
58 20 2
53 5 3
51 5 3
50 1 0
49 8 1
45 1 0
44 8 1
44 4 1
43 4 2
42 4 3
42 5 3
39 7 3
39 7 1
38 4 2
38 1 0
38 12 2
38 6 3
37 11 1
36 10 1
36 3 2
34 5 0
34 3 3
33 7 2
33 5 2
32 3 1
32 4 4
31 3 2
31 2 3
31 3 1
30 4 2
29 5 3
29 5 1
29 4 1
29 6 3
29 1 2
26 3 3
26 6 1
26 4 0