kubernetes / cloud-provider-gcp
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 886 units with 12,064 lines of code in units (39.2% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (370 lines of code)
    • 34 medium complex units (1,892 lines of code)
    • 93 simple units (2,843 lines of code)
    • 756 very simple units (6,959 lines of code)
0% | 3% | 15% | 23% | 57%
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% | 3% | 15% | 23% | 57%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
providers/gce0% | 6% | 12% | 20% | 60%
cmd/gcp-controller-manager0% | 0% | 29% | 28% | 42%
pkg/controller0% | 0% | 15% | 38% | 46%
cmd/gke-exec-auth-plugin0% | 0% | 22% | 30% | 47%
cmd/cloud-controller-manager0% | 0% | 34% | 0% | 65%
cluster/addons0% | 0% | 62% | 0% | 37%
pkg/csrapproval0% | 0% | 37% | 0% | 62%
cluster/gce0% | 0% | 0% | 48% | 51%
pkg/credentialconfig0% | 0% | 0% | 41% | 58%
pkg/gcpcredential0% | 0% | 0% | 47% | 52%
pkg/nodeidentity0% | 0% | 0% | 53% | 46%
cmd/auth-provider-gcp0% | 0% | 0% | 15% | 84%
crd/client0% | 0% | 0% | 4% | 95%
crd/apis0% | 0% | 0% | 0% | 100%
pkg/util0% | 0% | 0% | 0% | 100%
cmd/gke-gcloud-auth-plugin0% | 0% | 0% | 0% | 100%
pkg/csrmetrics0% | 0% | 0% | 0% | 100%
pkg/tpmattest0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in providers/gce/gce_loadbalancer_external.go
148 40 1
func()
in providers/gce/gce_loadbalancer_internal.go
144 34 1
func generateCloudConfig()
in providers/gce/gce.go
78 29 1
func()
in providers/gce/gce_instances.go
88 22 1
func startNodeIpamController()
in cmd/cloud-controller-manager/nodeipamcontroller.go
69 20 4
func validateNodeServerCert()
in cmd/gcp-controller-manager/node_csr_approver.go
54 18 3
func()
in providers/gce/gce_loadbalancer_internal.go
63 18 1
func loadGCPConfig()
in cmd/gcp-controller-manager/gcp_config.go
86 17 2
func CreateGCECloud()
in providers/gce/gce.go
109 17 1
func()
in cmd/gcp-controller-manager/node_csr_approver.go
65 16 1
func validateTPMAttestation()
in cmd/gcp-controller-manager/node_csr_approver.go
74 16 3
func()
in cmd/gcp-controller-manager/node_syncer.go
59 16 1
func()
in providers/gce/gce_loadbalancer_external.go
48 16 1
func()
in cmd/gcp-controller-manager/service_account_verifier.go
61 15 1
func()
in cmd/gcp-controller-manager/service_account_verifier.go
56 15 1
func()
in pkg/controller/nodeipam/ipam/cloud_cidr_allocator.go
61 15 1
func()
in providers/gce/gce_loadbalancer_internal.go
53 15 1
func main()
in cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go
61 15 0
func()
in cmd/gcp-controller-manager/istiod_csr_approver.go
33 14 1
func()
in pkg/controller/nodeipam/ipam/range_allocator.go
50 14 1