facebook / fatal
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 665 units with 4,123 lines of code in units (19.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 19 medium size units (538 lines of code)
    • 107 small units (1,463 lines of code)
    • 539 very small units (2,122 lines of code)
0% | 0% | 13% | 35% | 51%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h0% | 0% | 13% | 33% | 52%
cpp0% | 0% | 0% | 70% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fatal/type0% | 0% | 13% | 42% | 43%
fatal/container0% | 0% | 9% | 32% | 57%
fatal/string0% | 0% | 16% | 22% | 60%
fatal/benchmark0% | 0% | 32% | 23% | 43%
fatal/math0% | 0% | 22% | 17% | 59%
fatal/debug0% | 0% | 14% | 36% | 48%
fatal/codec0% | 0% | 19% | 33% | 46%
fatal/functional0% | 0% | 0% | 50% | 49%
fatal/lesson0% | 0% | 0% | 32% | 67%
fatal/utility0% | 0% | 0% | 76% | 23%
fatal/time0% | 0% | 0% | 92% | 7%
fatal/log0% | 0% | 0% | 0% | 100%
fatal0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
44 8 0
39 3 3
38 11 1
35 10 4
34 7 2
34 7 2
31 7 1
29 7 4
28 6 3
25 7 3
24 7 3
24 5 4
23 4 0
23 20 3
22 19 3
22 4 2
21 3 0
21 4 1
21 18 3
20 17 3
20 5 1
19 3 2
19 4 1
19 16 3
19 7 1
19 4 1
18 5 1
18 4 1
18 3 0
18 15 3
17 3 0
17 3 1
17 2 0
17 14 3
17 3 0
16 3 0
16 4 1
16 4 4
16 4 4
16 13 3
15 2 4
15 1 1
15 4 1
15 5 3
15 4 0
15 2 1
15 4 3
15 12 3
15 5 3
15 5 3