aws / amazon-vpc-cni-k8s
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 821 units with 9,650 lines of code in units (36.2% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (238 lines of code)
    • 31 medium complex units (2,109 lines of code)
    • 60 simple units (1,901 lines of code)
    • 728 very simple units (5,402 lines of code)
0% | 2% | 21% | 19% | 55%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go0% | 2% | 21% | 19% | 55%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/ipamd0% | 8% | 19% | 25% | 46%
cmd/routed-eni-cni-plugin0% | 0% | 51% | 24% | 23%
pkg/networkutils0% | 0% | 30% | 34% | 34%
pkg/awsutils0% | 0% | 13% | 20% | 65%
cmd/egress-v4-cni-plugin0% | 0% | 59% | 26% | 14%
cmd/cni-metrics-helper0% | 0% | 33% | 24% | 41%
scripts0% | 0% | 67% | 0% | 32%
rpc0% | 0% | 16% | 0% | 83%
cmd/grpc-health-probe0% | 0% | 70% | 0% | 29%
pkg/cri0% | 0% | 70% | 0% | 29%
cmd/aws-k8s-agent0% | 0% | 0% | 92% | 7%
pkg/utils0% | 0% | 0% | 10% | 89%
pkg/eniconfig0% | 0% | 0% | 28% | 71%
pkg/netlinkwrapper0% | 0% | 0% | 0% | 100%
pkg/ec2wrapper0% | 0% | 0% | 0% | 100%
pkg/publisher0% | 0% | 0% | 0% | 100%
pkg/ec2metadatawrapper0% | 0% | 0% | 0% | 100%
pkg/apis0% | 0% | 0% | 0% | 100%
pkg/k8sapi0% | 0% | 0% | 0% | 100%
pkg/cninswrapper0% | 0% | 0% | 0% | 100%
pkg/procsyswrapper0% | 0% | 0% | 0% | 100%
rpc/mocks0% | 0% | 0% | 0% | 100%
pkg/typeswrapper0% | 0% | 0% | 0% | 100%
pkg/grpcwrapper0% | 0% | 0% | 0% | 100%
pkg/rpcwrapper0% | 0% | 0% | 0% | 100%
pkg/ipwrapper0% | 0% | 0% | 0% | 100%
pkg/nswrapper0% | 0% | 0% | 0% | 100%
pkg/version0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/ipamd/rpc_handler.go
122 34 1
func()
in pkg/ipamd/ipamd.go
116 29 1
func()
in cmd/routed-eni-cni-plugin/driver/driver.go
90 22 1
func()
in pkg/networkutils/network.go
70 20 1
func setupENINetwork()
in pkg/networkutils/network.go
96 19 8
func()
in pkg/ipamd/rpc_handler.go
60 19 1
func()
in pkg/ipamd/ipamd.go
96 19 1
func del()
in cmd/routed-eni-cni-plugin/cni.go
105 19 5
func()
in pkg/awsutils/awsutils.go
77 18 1
func()
in pkg/awsutils/awsutils.go
80 18 1
func()
in pkg/ipamd/datastore/data_store.go
92 18 1
func cmdAdd()
in cmd/egress-v4-cni-plugin/cni.go
67 18 1
func()
in cmd/routed-eni-cni-plugin/driver/driver.go
69 18 1
func cmdDel()
in cmd/egress-v4-cni-plugin/cni.go
56 16 1
func main()
in scripts/gen_vpc_ip_limits.go
78 16 0
func()
in pkg/ipamd/ipamd.go
50 15 1
func()
in pkg/ipamd/datastore/data_store.go
43 15 1
73 15 0
func main()
in cmd/cni-metrics-helper/main.go
73 15 0
func()
in pkg/awsutils/awsutils.go
53 14 1