golang / vuln
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 22 units with 315 lines of code in units (60.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (53 lines of code)
    • 2 medium size units (71 lines of code)
    • 12 small units (169 lines of code)
    • 7 very small units (22 lines of code)
0% | 16% | 22% | 53% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 16% | 22% | 53% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
client0% | 20% | 27% | 51% | 1%
osv0% | 0% | 0% | 70% | 29%
internal/derrors0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in client/client.go
53 16 1
func()
in client/client.go
41 14 1
func NewClient()
in client/client.go
30 8 2
func()
in client/client.go
19 5 1
func()
in osv/json.go
18 8 1
func()
in osv/json.go
16 5 1
func()
in client/client.go
15 4 1
func()
in client/client.go
14 4 1
func()
in client/client.go
14 4 1
func()
in client/client.go
13 4 1
func()
in client/client.go
12 3 1
func()
in client/client.go
12 3 1
func()
in client/client.go
12 4 1
func()
in client/client.go
12 3 1
func()
in client/client.go
12 3 1
6 3 1
func Wrap()
in internal/derrors/derrors.go
5 2 3
5 1 1
3 1 1
func()
in client/client.go
1 1 1