google / renameio
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 19 units with 201 lines of code in units (81.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (88 lines of code)
    • 4 small units (60 lines of code)
    • 12 very small units (53 lines of code)
0% | 0% | 43% | 29% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 43% | 29% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 45% | 30% | 24%
maybe0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 19 longest units
Unit# linesMcCabe index# params
func NewPendingFile()
in tempfile.go
35 14 2
func tempDir()
in tempfile.go
29 6 2
func Symlink()
in tempfile.go
24 7 2
func openTempFile()
in tempfile.go
17 4 3
func WriteFile()
in writefile.go
15 3 4
func()
in tempfile.go
14 4 1
func()
in tempfile.go
14 4 1
6 1 1
6 1 1
func()
in tempfile.go
6 2 1
func WithTempDir()
in option.go
5 1 1
func IgnoreUmask()
in option.go
5 1 0
5 1 0
5 1 0
func WriteFile()
in maybe/maybe_unix.go
3 1 3
func WriteFile()
in maybe/maybe_windows.go
3 1 3
func()
in option.go
3 1 1
func TempDir()
in tempfile.go
3 1 1
func TempFile()
in tempfile.go
3 1 2