golang / xerrors
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 29 units with 341 lines of code in units (82.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (85 lines of code)
    • 4 medium size units (124 lines of code)
    • 4 small units (50 lines of code)
    • 20 very small units (82 lines of code)
0% | 24% | 36% | 14% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 24% | 36% | 14% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 24% | 36% | 14% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func FormatError()
in adaptor.go
85 23 3
func()
in adaptor.go
36 13 1
func Errorf()
in fmt.go
34 13 2
29 7 1
func As()
in wrap.go
25 10 2
func Is()
in wrap.go
17 8 2
func()
in frame.go
11 3 1
func()
in frame.go
11 4 1
11 3 1
10 3 2
func()
in wrap.go
7 2 1
func Unwrap()
in wrap.go
7 2 1
func Caller()
in frame.go
5 1 1
func()
in adaptor.go
5 3 1
func()
in adaptor.go
5 3 1
func()
in errors.go
5 1 1
func()
in fmt.go
5 1 1
func()
in fmt.go
5 1 1
func()
in adaptor.go
4 1 1
func Opaque()
in wrap.go
3 1 1