facebookexperimental / usort
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 69 units with 837 lines of code in units (66.5% of code).
    • 1 very long units (105 lines of code)
    • 0 long units (0 lines of code)
    • 9 medium size units (294 lines of code)
    • 17 small units (251 lines of code)
    • 42 very small units (187 lines of code)
12% | 0% | 35% | 29% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 0% | 35% | 29% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
usort12% | 0% | 35% | 29% | 22%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
105 18 2
50 20 1
44 8 2
35 16 2
34 16 2
32 15 2
31 10 3
24 8 2
22 5 3
22 3 3
20 8 2
20 9 1
19 5 2
18 5 2
17 7 1
15 8 2
15 4 1
14 7 2
14 4 3
14 2 1
14 4 3
13 3 1
13 2 1
12 3 0
11 2 2
11 4 2
11 5 1
9 6 2
8 3 2
8 1 5
8 2 2
8 2 3
8 3 2
7 2 0
7 5 3
7 3 1
7 3 2
7 3 1
7 2 3
6 2 3
5 2 2
5 2 1
5 1 1
5 1 0
5 1 0
5 3 1
5 2 3
4 2 1
4 1 0
4 2 2