korosuke613 / playground
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 38 units with 295 lines of code in units (23.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (67 lines of code)
    • 8 small units (118 lines of code)
    • 27 very small units (110 lines of code)
0% | 0% | 22% | 40% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 0% | 71% | 0% | 28%
go0% | 0% | 15% | 48% | 36%
ts0% | 0% | 51% | 41% | 6%
java0% | 0% | 0% | 40% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
terraform0% | 0% | 34% | 55% | 10%
rust0% | 0% | 71% | 0% | 28%
java0% | 0% | 0% | 40% | 60%
docker0% | 0% | 0% | 77% | 22%
go0% | 0% | 0% | 0% | 100%
earthly0% | 0% | 0% | 0% | 100%
javascript0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 38 longest units
Unit# linesMcCabe index# params
23 2 0
22 1 2
22 9 1
18 1 2
17 1 2
16 1 1
15 4 2
15 4 2
14 2 3
12 3 1
11 3 1
10 2 0
7 2 1
7 2 2
7 1 3
6 2 1
5 1 0
5 1 1
4 1 1
4 1 1
4 1 1
3 1 0
3 1 2
3 1 0
3 1 0
3 1 2
3 1 2
3 1 1
3 1 0
3 1 0
3 1 1
3 1 1
3 1 0
3 1 0
3 1 0
3 1 0
3 1 0
3 1 2