kubernetes / kubeadm
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 402 units with 6,137 lines of code in units (49.3% of code).
    • 0 very long units (0 lines of code)
    • 17 long units (1,204 lines of code)
    • 68 medium size units (2,010 lines of code)
    • 110 small units (1,622 lines of code)
    • 207 very small units (1,301 lines of code)
0% | 19% | 32% | 26% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 19% | 32% | 26% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kinder/pkg/cluster0% | 22% | 36% | 22% | 18%
kinder/cmd/kinder0% | 30% | 38% | 23% | 7%
kinder/hack/orderimports0% | 51% | 15% | 20% | 12%
kinder/ci/tools0% | 42% | 23% | 18% | 14%
kinder/pkg/build0% | 20% | 32% | 22% | 25%
kinder/pkg/cri0% | 0% | 29% | 21% | 48%
kinder/pkg/extract0% | 0% | 31% | 50% | 17%
kinder/pkg/kubeadm0% | 0% | 32% | 54% | 13%
kinder/pkg/exec0% | 0% | 26% | 26% | 48%
kinder/hack0% | 0% | 40% | 60% | 0%
kinder/images/base0% | 0% | 0% | 100% | 0%
kinder/pkg/loadbalancer0% | 0% | 0% | 100% | 0%
kinder0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func sortDecl()
in kinder/hack/orderimports/orderimports.go
99 23 3
func getKubeadmConfig()
in kinder/pkg/cluster/manager/actions/kubeadm-config.go
92 24 4
func kubeadmInitWithPhases()
in kinder/pkg/cluster/manager/actions/kubeadm-init.go
89 18 5
func()
in kinder/pkg/build/alter/alter.go
87 20 1
func processWorkflows()
in kinder/ci/tools/update-workflows/pkg/workflows.go
83 17 4
func NewCommand()
in kinder/cmd/kinder/do/do.go
82 1 0
func processTestInfra()
in kinder/ci/tools/update-workflows/pkg/testinfra.go
74 13 4
func createNodes()
in kinder/pkg/cluster/manager/create.go
69 16 2
func SetupExternalCA()
in kinder/pkg/cluster/manager/actions/setup-external-ca.go
67 15 2
func processFile()
in kinder/hack/orderimports/orderimports.go
65 18 4
func NewCommand()
in kinder/cmd/kinder/build/nodevariant/nodevariant.go
64 1 0
func SmokeTest()
in kinder/pkg/cluster/manager/actions/smoke-test.go
61 12 2
func CluterInfo()
in kinder/pkg/cluster/manager/actions/cluster-info.go
59 11 1
func NewCommand()
in kinder/cmd/kinder/create/cluster/createcluster.go
54 1 0
func configureKubelet()
in kinder/pkg/build/bits/initBits.go
54 11 1
func KubeadmConfig()
in kinder/pkg/cluster/manager/actions/kubeadm-config.go
54 9 6
func kubeadmJoinControlPlaneWithPhases()
in kinder/pkg/cluster/manager/actions/kubeadm-join.go
51 9 4
func createDiscoveryFile()
in kinder/pkg/cluster/manager/actions/kubeadm-config.go
50 12 3
func extractFromLocalDir()
in kinder/pkg/extract/extract.go
48 15 5
func CreateCluster()
in kinder/pkg/cluster/manager/create.go
46 9 2