facebook / TestSlide
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 455 units with 2,994 lines of code in units (61.1% of code).
    • 1 very long units (113 lines of code)
    • 3 long units (180 lines of code)
    • 13 medium size units (459 lines of code)
    • 51 small units (723 lines of code)
    • 387 very small units (1,519 lines of code)
3% | 6% | 15% | 24% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 6% | 15% | 24% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
testslide3% | 6% | 15% | 24% | 50%
util0% | 0% | 0% | 73% | 26%
pytest-testslide0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
113 2 2
74 26 3
55 14 1
51 10 2
49 6 2
44 13 3
43 5 1
43 10 3
43 6 1
40 6 3
34 8 2
30 10 4
30 7 1
29 17 1
29 11 2
24 9 2
21 8 2
20 10 1
20 4 2
19 2 2
19 3 2
18 2 2
18 7 2
18 2 3
17 4 1
17 4 0
17 3 1
16 7 2
16 5 3
16 3 1
16 8 3
16 2 3
16 14 2
15 11 3
15 4 3
15 7 2
15 3 1
14 5 3
14 3 2
14 4 0
14 3 1
14 2 1
14 3 3
14 7 1
13 8 2
13 6 3
13 1 0
13 9 3
13 7 1
13 5 3