golang / term
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 60 units with 820 lines of code in units (86.9% of code).
    • 1 very long units (122 lines of code)
    • 2 long units (142 lines of code)
    • 7 medium size units (194 lines of code)
    • 15 small units (217 lines of code)
    • 35 very small units (145 lines of code)
14% | 17% | 23% | 26% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go14% | 17% | 23% | 26% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT14% | 17% | 23% | 26% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in terminal.go
122 34 1
func bytesToKey()
in terminal.go
72 45 2
func()
in terminal.go
70 19 1
func()
in terminal.go
32 9 1
func()
in terminal.go
32 8 1
32 12 1
func()
in terminal.go
27 6 1
func()
in terminal.go
26 9 1
func writeWithCRLF()
in terminal.go
24 6 2
func readPassword()
in term_windows.go
21 4 1
func()
in terminal.go
20 5 1
func()
in terminal.go
20 6 1
func makeRaw()
in term_unix.go
18 3 1
func visualLength()
in terminal.go
17 7 1
func()
in terminal.go
16 5 1
func()
in terminal.go
16 2 1
func()
in terminal.go
15 3 1
func readPassword()
in term_unix.go
15 3 1
func()
in terminal.go
12 3 1
func()
in terminal.go
12 3 1