kubernetes / cloud-provider-gcp
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 886 units with 12,064 lines of code in units (39.2% of code).
    • 3 very long units (401 lines of code)
    • 26 long units (1,717 lines of code)
    • 130 medium size units (3,831 lines of code)
    • 211 small units (3,114 lines of code)
    • 516 very small units (3,001 lines of code)
3% | 14% | 31% | 25% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go3% | 14% | 31% | 25% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
providers/gce6% | 8% | 30% | 23% | 30%
cmd/gcp-controller-manager0% | 32% | 31% | 21% | 14%
pkg/controller0% | 13% | 42% | 27% | 15%
cmd/cloud-controller-manager0% | 34% | 11% | 40% | 14%
cmd/gke-exec-auth-plugin0% | 13% | 44% | 30% | 10%
cluster/addons0% | 62% | 0% | 37% | 0%
pkg/csrapproval0% | 37% | 14% | 29% | 19%
cluster/gce0% | 0% | 100% | 0% | 0%
pkg/gcpcredential0% | 0% | 68% | 23% | 8%
pkg/credentialconfig0% | 0% | 41% | 24% | 33%
pkg/util0% | 0% | 40% | 36% | 23%
crd/client0% | 0% | 8% | 40% | 50%
pkg/nodeidentity0% | 0% | 53% | 32% | 14%
pkg/tpmattest0% | 0% | 100% | 0% | 0%
cmd/auth-provider-gcp0% | 0% | 15% | 55% | 29%
cmd/gke-gcloud-auth-plugin0% | 0% | 0% | 73% | 26%
crd/apis0% | 0% | 0% | 28% | 71%
pkg/csrmetrics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest 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 CreateGCECloud()
in providers/gce/gce.go
109 17 1
func newNodeAnnotator()
in cmd/gcp-controller-manager/node_annotator.go
98 13 3
func loops()
in cmd/gcp-controller-manager/loops.go
95 6 0
func()
in providers/gce/gce_instances.go
88 22 1
func loadGCPConfig()
in cmd/gcp-controller-manager/gcp_config.go
86 17 2
func generateCloudConfig()
in providers/gce/gce.go
78 29 1
func validateTPMAttestation()
in cmd/gcp-controller-manager/node_csr_approver.go
74 16 3
func run()
in cmd/gcp-controller-manager/main.go
73 9 1
func startNodeIpamController()
in cmd/cloud-controller-manager/nodeipamcontroller.go
69 20 4
func tpmAttest()
in cmd/gke-exec-auth-plugin/tpm.go
65 11 2
func()
in cmd/gcp-controller-manager/node_csr_approver.go
65 16 1
func()
in providers/gce/gce_loadbalancer_internal.go
63 18 1
func()
in cmd/gcp-controller-manager/service_account_verifier.go
61 15 1
func NewNodeIpamController()
in pkg/controller/nodeipam/node_ipam_controller.go
61 10 8
func()
in pkg/controller/nodeipam/ipam/cloud_cidr_allocator.go
61 15 1
func NewCIDRRangeAllocator()
in pkg/controller/nodeipam/ipam/range_allocator.go
61 11 4
func main()
in cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go
61 15 0
func()
in providers/gce/gce_loadbalancer_internal.go
60 12 1