aws / amazon-eks-pod-identity-webhook
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 31 units with 715 lines of code in units (62.8% of code).
    • 1 very long units (144 lines of code)
    • 3 long units (244 lines of code)
    • 5 medium size units (157 lines of code)
    • 8 small units (102 lines of code)
    • 14 very small units (68 lines of code)
20% | 34% | 21% | 14% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go20% | 34% | 21% | 14% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT100% | 0% | 0% | 0% | 0%
pkg/handler0% | 62% | 5% | 20% | 11%
pkg/cert0% | 0% | 82% | 11% | 6%
hack/self-hosted0% | 0% | 65% | 18% | 16%
pkg0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in main.go
144 12 0
func()
in pkg/handler/handler.go
86 16 1
func()
in pkg/handler/handler.go
84 15 1
func()
in pkg/handler/handler.go
74 7 1
func readKey()
in hack/self-hosted/main.go
40 7 1
func()
in pkg/cert/store.go
35 4 1
34 2 4
func()
in pkg/cert/store.go
25 4 1
func Logging()
in pkg/handler/middleware.go
23 2 0
func getContainersToSkip()
in pkg/handler/handler.go
16 4 2
func ShutdownFromContext()
in pkg/handler/shutdown.go
13 3 3
func()
in pkg/handler/handler.go
13 3 1
func loadX509KeyPairData()
in pkg/cert/store.go
13 3 2
func InstrumentRoute()
in pkg/handler/middleware.go
12 1 0
func NewModifier()
in pkg/handler/handler.go
12 2 1
func logContext()
in pkg/handler/handler.go
12 2 4
func keyIDFromPublicKey()
in hack/self-hosted/main.go
11 2 1
func main()
in hack/self-hosted/main.go
10 2 0
func NewSecretCertStore()
in pkg/cert/store.go
7 1 3
func monitor()
in pkg/handler/middleware.go
6 1 4