facebookincubator / FBOpenSSH
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 251 units with 5,333 lines of code in units (5.1% of code).
    • 6 very long units (1,240 lines of code)
    • 13 long units (766 lines of code)
    • 56 medium size units (1,746 lines of code)
    • 56 small units (836 lines of code)
    • 120 very small units (745 lines of code)
23% | 14% | 32% | 15% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c23% | 14% | 32% | 15% | 13%
cc0% | 0% | 26% | 55% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
openbsd-compat61% | 7% | 13% | 6% | 10%
regress94% | 0% | 5% | 0% | 0%
ROOT5% | 18% | 40% | 19% | 16%
regress/misc/fuzz-harness0% | 0% | 26% | 55% | 18%
openbsd-compat/regress0% | 0% | 70% | 0% | 30%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
328 116 8
321 92 4
191 70 1
175 48 1
115 16 8
110 1 4
85 7 6
62 16 8
62 11 8
62 12 6
59 9 2
59 9 2
57 7 2
57 7 2
57 3 7
53 16 7
51 2 4
51 6 2
51 5 6
49 8 3
48 9 5
44 1 4
44 8 2
43 1 9
42 2 4
41 2 2
39 5 5
39 12 2
39 10 7
38 1 2
38 7 3
38 4 5
38 4 6
37 1 4
37 3 3
34 6 5
34 2 4
34 1 5
34 3 2
34 3 2
34 4 2
33 10 7
33 2 2
33 5 4
32 4 3
32 7 6
31 2 2
30 2 2
29 6 8
29 10 2