aws / amazon-vpc-cni-k8s
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 821 units with 9,650 lines of code in units (36.2% of code).
    • 5 very long units (581 lines of code)
    • 25 long units (1,733 lines of code)
    • 87 medium size units (2,613 lines of code)
    • 142 small units (1,988 lines of code)
    • 562 very small units (2,735 lines of code)
6% | 17% | 27% | 20% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go6% | 17% | 27% | 20% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/ipamd8% | 14% | 38% | 26% | 12%
cmd/routed-eni-cni-plugin30% | 21% | 27% | 5% | 14%
pkg/networkutils12% | 27% | 25% | 14% | 19%
pkg/awsutils0% | 19% | 28% | 22% | 28%
cmd/egress-v4-cni-plugin0% | 59% | 20% | 15% | 3%
scripts0% | 67% | 25% | 0% | 6%
cmd/cni-metrics-helper0% | 16% | 57% | 10% | 15%
rpc0% | 16% | 0% | 17% | 65%
cmd/grpc-health-probe0% | 70% | 29% | 0% | 0%
pkg/cri0% | 70% | 0% | 0% | 29%
cmd/aws-k8s-agent0% | 0% | 92% | 0% | 7%
pkg/publisher0% | 0% | 20% | 29% | 49%
pkg/k8sapi0% | 0% | 40% | 59% | 0%
pkg/eniconfig0% | 0% | 28% | 40% | 31%
pkg/ec2wrapper0% | 0% | 9% | 57% | 33%
pkg/utils0% | 0% | 0% | 27% | 72%
rpc/mocks0% | 0% | 0% | 55% | 45%
pkg/apis0% | 0% | 0% | 16% | 83%
pkg/grpcwrapper0% | 0% | 0% | 36% | 63%
pkg/version0% | 0% | 0% | 100% | 0%
pkg/netlinkwrapper0% | 0% | 0% | 0% | 100%
pkg/ec2metadatawrapper0% | 0% | 0% | 0% | 100%
pkg/cninswrapper0% | 0% | 0% | 0% | 100%
pkg/procsyswrapper0% | 0% | 0% | 0% | 100%
pkg/typeswrapper0% | 0% | 0% | 0% | 100%
pkg/rpcwrapper0% | 0% | 0% | 0% | 100%
pkg/ipwrapper0% | 0% | 0% | 0% | 100%
pkg/nswrapper0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/ipamd/rpc_handler.go
122 34 1
func add()
in cmd/routed-eni-cni-plugin/cni.go
121 13 5
func()
in pkg/networkutils/network.go
117 12 1
func()
in pkg/ipamd/ipamd.go
116 29 1
func del()
in cmd/routed-eni-cni-plugin/cni.go
105 19 5
func setupENINetwork()
in pkg/networkutils/network.go
96 19 8
func()
in pkg/ipamd/ipamd.go
96 19 1
func()
in pkg/ipamd/datastore/data_store.go
92 18 1
func()
in cmd/routed-eni-cni-plugin/driver/driver.go
90 22 1
func()
in pkg/networkutils/network.go
83 7 1
func()
in pkg/awsutils/awsutils.go
80 18 1
func main()
in scripts/gen_vpc_ip_limits.go
78 16 0
func()
in pkg/awsutils/awsutils.go
77 18 1
73 15 0
func setupContainerVeth()
in cmd/egress-v4-cni-plugin/cni.go
73 11 4
func main()
in cmd/cni-metrics-helper/main.go
73 15 0
func()
in pkg/networkutils/network.go
70 20 1
func()
in cmd/routed-eni-cni-plugin/driver/driver.go
69 18 1
func cmdAdd()
in cmd/egress-v4-cni-plugin/cni.go
67 18 1
func()
in pkg/awsutils/awsutils.go
62 8 1