github / octobox
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 586 units with 3,490 lines of code in units (38.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 14 medium size units (355 lines of code)
    • 61 small units (858 lines of code)
    • 511 very small units (2,277 lines of code)
0% | 0% | 10% | 24% | 65%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 0% | 11% | 21% | 67%
js0% | 0% | 6% | 35% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
app0% | 0% | 8% | 27% | 63%
lib0% | 0% | 24% | 9% | 66%
db0% | 0% | 0% | 21% | 78%
config0% | 0% | 0% | 60% | 40%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
36 30 0
32 16 0
30 15 2
30 6 0
26 6 1
25 5 1
23 7 0
23 16 2
22 4 1
22 10 1
22 1 0
22 1 1
21 1 1
21 4 0
20 11 1
20 8 0
20 3 0
20 3 0
20 3 0
19 5 0
19 3 1
18 7 1
18 10 0
17 4 0
17 7 8
17 1 0
16 7 3
16 7 1
16 5 0
16 2 0
15 1 0
15 5 1
14 3 0
14 7 0
14 1 1
14 1 1
14 1 0
14 4 0
14 2 0
14 4 2
14 5 0
14 1 0
13 5 1
13 2 2
13 3 1
13 2 1
13 3 2
13 2 0
13 2 1
13 2 1