facebook / SPARTA
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 634 units with 3,444 lines of code in units (45.8% of code).
    • 1 very long units (135 lines of code)
    • 5 long units (303 lines of code)
    • 11 medium size units (331 lines of code)
    • 52 small units (720 lines of code)
    • 565 very small units (1,955 lines of code)
3% | 8% | 9% | 20% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h3% | 8% | 9% | 20% | 56%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
include3% | 8% | 9% | 20% | 56%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
135 25 0
69 24 2
65 11 1
61 12 1
55 8 1
53 13 0
42 14 2
37 11 2
36 8 2
35 11 2
34 1 0
34 9 1
26 6 2
23 5 1
22 6 1
21 7 1
21 7 1
20 4 2
20 4 2
20 5 2
19 4 2
19 3 2
17 4 2
17 4 1
17 6 1
17 4 1
16 4 1
16 3 4
16 5 1
16 4 1
16 5 2
16 5 2
15 5 1
15 5 1
15 5 0
15 6 1
14 3 1
14 7 1
14 1 0
14 4 1
13 4 1
13 4 0
13 2 1
13 3 1
13 5 0
13 1 4
13 4 1
12 3 2
12 3 2
12 4 1