kubernetes / ingress-gce
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 2,309 units with 29,865 lines of code in units (77.5% of code).
    • 2 very complex units (455 lines of code)
    • 3 complex units (330 lines of code)
    • 62 medium complex units (3,807 lines of code)
    • 228 simple units (7,125 lines of code)
    • 2,014 very simple units (18,148 lines of code)
1% | 1% | 12% | 23% | 60%
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
go1% | 1% | 12% | 23% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/fuzz21% | 5% | 10% | 20% | 41%
cmd/glbc0% | 21% | 0% | 36% | 42%
pkg/metrics0% | 18% | 11% | 14% | 55%
pkg/loadbalancers0% | 0% | 46% | 19% | 33%
pkg/neg0% | 0% | 22% | 23% | 53%
pkg/controller0% | 0% | 28% | 30% | 40%
pkg/backends0% | 0% | 28% | 31% | 39%
pkg/psc0% | 0% | 27% | 9% | 62%
pkg/l4lb0% | 0% | 18% | 33% | 48%
pkg/composite0% | 0% | 3% | 62% | 33%
pkg/firewalls0% | 0% | 22% | 13% | 63%
pkg/flags0% | 0% | 65% | 0% | 34%
pkg/apis0% | 0% | 2% | 5% | 92%
pkg/context0% | 0% | 29% | 44% | 26%
cmd/fuzzer0% | 0% | 57% | 0% | 42%
pkg/utils0% | 0% | 4% | 10% | 85%
pkg/experimental0% | 0% | 3% | 15% | 80%
cmd/404-server-with-metrics0% | 0% | 35% | 0% | 64%
pkg/instances0% | 0% | 12% | 29% | 58%
pkg/healthchecks0% | 0% | 6% | 50% | 42%
pkg/backendconfig0% | 0% | 0% | 14% | 85%
pkg/translator0% | 0% | 0% | 24% | 75%
cmd/e2e-test0% | 0% | 0% | 23% | 76%
pkg/crd0% | 0% | 0% | 43% | 56%
pkg/ratelimit0% | 0% | 0% | 53% | 46%
pkg/cmconfig0% | 0% | 0% | 39% | 60%
pkg/sync0% | 0% | 0% | 73% | 26%
cmd/workload-controller0% | 0% | 0% | 61% | 38%
pkg/storage0% | 0% | 0% | 35% | 64%
cmd/workload-daemon0% | 0% | 0% | 90% | 9%
pkg/annotations0% | 0% | 0% | 14% | 85%
pkg/serviceattachment0% | 0% | 0% | 2% | 97%
pkg/common0% | 0% | 0% | 7% | 92%
cmd/echo0% | 0% | 0% | 13% | 86%
pkg/svcneg0% | 0% | 0% | 3% | 96%
pkg/frontendconfig0% | 0% | 0% | 4% | 95%
pkg/ingparams0% | 0% | 0% | 4% | 95%
cmd/404-server0% | 0% | 0% | 0% | 100%
pkg/events0% | 0% | 0% | 0% | 100%
pkg/klog0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func GCLBForVIP()
in pkg/fuzz/gcp.go
229 63 3
func RegionalGCLBForVIP()
in pkg/fuzz/gcp.go
226 63 4
func()
in pkg/fuzz/gcp.go
109 40 1
func featuresForIngress()
in pkg/metrics/features.go
95 31 2
func main()
in cmd/glbc/main.go
126 27 0
func renderConfig()
in pkg/backends/features/cdn.go
109 25 1
func()
in pkg/loadbalancers/l7.go
46 23 1
func ensureNetworkEndpointGroup()
in pkg/neg/syncers/utils.go
93 22 13
func toZoneNetworkEndpointMap()
in pkg/neg/syncers/utils.go
65 22 6
func()
in pkg/backends/syncer.go
48 20 1
func()
in pkg/fuzz/gcp.go
57 20 1
func NewLoadBalancerController()
in pkg/controller/controller.go
173 20 2
func()
in pkg/loadbalancers/target_proxies.go
78 20 1
func mapsEqual()
in pkg/loadbalancers/url_maps.go
61 20 2
func()
in pkg/apis/backendconfig/v1/zz_generated.deepcopy.go
82 19 1
func()
in pkg/loadbalancers/forwarding_rules.go
64 19 1
func Validate()
in cmd/fuzzer/app/validate.go
76 18 0
func()
in pkg/psc/controller.go
98 18 1
func()
in pkg/neg/manager.go
79 18 1
func()
in pkg/neg/syncers/transaction.go
79 18 1