kubernetes / minikube
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 1,934 units with 31,423 lines of code in units (59.7% of code).
    • 13 very long units (1,668 lines of code)
    • 62 long units (4,189 lines of code)
    • 417 medium size units (12,779 lines of code)
    • 523 small units (7,647 lines of code)
    • 919 very small units (5,140 lines of code)
5% | 13% | 40% | 24% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go4% | 13% | 41% | 24% | 16%
js49% | 11% | 20% | 10% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/minikube10% | 16% | 37% | 18% | 16%
pkg/minikube2% | 11% | 42% | 25% | 18%
hack/jenkins31% | 17% | 17% | 22% | 10%
pkg/drivers6% | 8% | 40% | 31% | 12%
hack/benchmark21% | 23% | 40% | 5% | 8%
pkg/addons0% | 42% | 34% | 15% | 8%
pkg/provision0% | 34% | 36% | 12% | 16%
cmd/auto-pause0% | 34% | 25% | 34% | 5%
pkg/generate0% | 23% | 52% | 13% | 10%
hack/preload-images0% | 26% | 39% | 19% | 14%
hack/update0% | 9% | 42% | 35% | 12%
pkg/network0% | 31% | 53% | 9% | 4%
pkg/kapi0% | 0% | 85% | 6% | 7%
pkg/gvisor0% | 0% | 67% | 22% | 10%
hack/boilerplate0% | 0% | 100% | 0% | 0%
pkg/util0% | 0% | 40% | 25% | 33%
hack/kicbase_version0% | 0% | 84% | 12% | 3%
hack/metrics0% | 0% | 47% | 31% | 20%
pkg/perf0% | 0% | 40% | 57% | 2%
pkg/storage0% | 0% | 43% | 47% | 8%
cmd/performance0% | 0% | 44% | 16% | 39%
pkg/trace0% | 0% | 32% | 0% | 67%
hack/help_text0% | 0% | 100% | 0% | 0%
deploy/minikube0% | 0% | 0% | 73% | 26%
cmd/extract0% | 0% | 0% | 100% | 0%
cmd/drivers0% | 0% | 0% | 0% | 100%
pkg/version0% | 0% | 0% | 0% | 100%
cmd/storage-provisioner0% | 0% | 0% | 0% | 100%
cmd/gvisor0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function displayEnvironmentChart()
in hack/jenkins/test-flake-chart/flake_chart.js
228 14 2
func GenerateZshCompletion()
in cmd/minikube/cmd/completion.go
168 30 2
func execute()
in hack/benchmark/cpu_usage/auto_pause/chart.go
137 28 0
func()
in pkg/minikube/bootstrapper/kubeadm/kubeadm.go
127 30 1
function displayTestAndEnvironmentChart()
in hack/jenkins/test-flake-chart/flake_chart.js
119 4 3
func generateProfileCerts()
in pkg/minikube/bootstrapper/certs.go
117 17 4
func()
in pkg/drivers/kic/kic.go
115 19 1
func runStart()
in cmd/minikube/cmd/start.go
114 28 2
func CreateContainerNode()
in pkg/drivers/kic/oci/oci.go
113 30 1
func generateNewConfigFromFlags()
in cmd/minikube/cmd/start_flags.go
110 12 3
func clusterState()
in cmd/minikube/cmd/status.go
110 23 1
func GenerateKubeadmYAML()
in pkg/minikube/bootstrapper/bsutil/kubeadm.go
108 15 3
func()
in pkg/minikube/bootstrapper/kubeadm/kubeadm.go
102 21 1
func Start()
in pkg/minikube/node/start.go
98 26 2
func nodeStatus()
in cmd/minikube/cmd/status.go
96 19 3
func updateExistingConfigFromFlags()
in cmd/minikube/cmd/start_flags.go
94 19 2
func createPullSecret()
in pkg/addons/addons_gcpauth.go
92 25 2
func HostIP()
in pkg/minikube/cluster/ip.go
91 25 2
func selectDriver()
in cmd/minikube/cmd/start.go
90 27 1
func ListImages()
in pkg/minikube/machine/cache_images.go
89 22 2