facebookincubator / fizz
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,709 units with 19,842 lines of code in units (59.3% of code).
    • 8 very long units (1,857 lines of code)
    • 31 long units (1,989 lines of code)
    • 202 medium size units (6,134 lines of code)
    • 311 small units (4,478 lines of code)
    • 1,157 very small units (5,384 lines of code)
9% | 10% | 30% | 22% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp17% | 12% | 34% | 22% | 13%
py2% | 11% | 35% | 22% | 28%
h0% | 2% | 16% | 23% | 57%
c0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fizz/tool50% | 6% | 14% | 12% | 15%
fizz/server20% | 4% | 28% | 23% | 22%
build/fbcode_builder2% | 11% | 36% | 22% | 28%
fizz/record0% | 22% | 8% | 16% | 52%
fizz/client0% | 16% | 43% | 14% | 25%
fizz/protocol0% | 6% | 31% | 31% | 29%
fizz/crypto0% | 10% | 33% | 32% | 24%
fizz/extensions0% | 6% | 37% | 30% | 25%
fizz/experimental0% | 7% | 49% | 16% | 26%
fizz/util0% | 0% | 28% | 57% | 14%
build0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
501 41 1
438 59 1
329 36 1
128 13 3
125 22 1
118 19 0
115 12 1
103 9 1
96 14 0
91 21 8
85 12 16
78 1 1
78 7 0
76 25 4
73 19 2
73 12 6
71 11 2
66 14 2
65 31 1
65 17 2
64 1 2
63 1 1
62 22 1
62 7 1
59 15 11
59 17 1
58 6 2
57 1 2
57 14 1
56 1 0
55 16 4
54 3 1
53 25 1
53 8 3
53 10 3
52 15 1
52 16 1
52 8 2
51 13 0
50 12 4
50 6 3
50 2 7
50 7 4
49 23 1
49 13 1
49 10 6
49 1 0
47 5 0
47 8 2
47 6 4