aws / eks-anywhere
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 2,677 units with 27,804 lines of code in units (59.5% of code).
    • 8 very long units (914 lines of code)
    • 55 long units (3,899 lines of code)
    • 192 medium size units (5,971 lines of code)
    • 425 small units (6,082 lines of code)
    • 1,997 very small units (10,938 lines of code)
3% | 14% | 21% | 21% | 39%
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% | 21% | 21% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
release/pkg13% | 47% | 25% | 8% | 5%
pkg/providers6% | 7% | 18% | 19% | 47%
cmd/eksctl-anywhere10% | 12% | 34% | 13% | 29%
pkg/executables0% | 10% | 21% | 38% | 30%
internal/pkg0% | 19% | 24% | 18% | 37%
pkg/clustermanager0% | 17% | 22% | 22% | 38%
controllers/controllers0% | 11% | 21% | 30% | 35%
pkg/api0% | 4% | 15% | 27% | 51%
pkg/validations0% | 21% | 14% | 23% | 40%
cmd/eks-a-tool0% | 37% | 9% | 4% | 48%
pkg/cluster0% | 14% | 13% | 39% | 32%
pkg/clusterapi0% | 14% | 9% | 20% | 55%
pkg/addonmanager0% | 0% | 47% | 27% | 25%
pkg/diagnostics0% | 0% | 28% | 20% | 50%
pkg/workflows0% | 0% | 22% | 20% | 56%
pkg/git0% | 0% | 11% | 18% | 69%
controllers0% | 0% | 72% | 0% | 27%
pkg/networking0% | 0% | 16% | 17% | 65%
release/api0% | 0% | 11% | 10% | 78%
pkg/crypto0% | 0% | 21% | 33% | 45%
pkg/clustermarshaller0% | 0% | 76% | 23% | 0%
cmd/integration_test0% | 0% | 22% | 21% | 56%
pkg/semver0% | 0% | 38% | 16% | 44%
pkg/retrier0% | 0% | 39% | 0% | 60%
pkg/awsiamauth0% | 0% | 26% | 58% | 14%
release/cmd0% | 0% | 47% | 33% | 19%
pkg/logger0% | 0% | 35% | 0% | 64%
pkg/bootstrapper0% | 0% | 9% | 22% | 68%
pkg/templater0% | 0% | 28% | 32% | 39%
pkg/files0% | 0% | 0% | 63% | 36%
pkg/networkutils0% | 0% | 0% | 76% | 23%
pkg/task0% | 0% | 0% | 32% | 67%
pkg/filewriter0% | 0% | 0% | 24% | 75%
pkg/features0% | 0% | 0% | 28% | 71%
pkg/types0% | 0% | 0% | 20% | 80%
pkg/clients0% | 0% | 0% | 0% | 100%
pkg/eksctl0% | 0% | 0% | 0% | 100%
pkg/version0% | 0% | 0% | 0% | 100%
release0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/providers/vsphere/validator.go
127 46 1
func()
in release/pkg/generate_spec.go
117 26 1
func()
in release/pkg/assets_eksd.go
117 12 1
func()
in release/pkg/prepare_release.go
116 26 1
func buildTemplateMapCP()
in pkg/providers/vsphere/vsphere.go
112 8 4
func()
in release/pkg/generate_spec.go
109 17 1
func()
in release/pkg/assets_capi.go
108 16 1
func generateClusterConfig()
in cmd/eksctl-anywhere/cmd/generateclusterconfig.go
108 16 1
func()
in release/pkg/assets_cluster_controller.go
100 16 1
func()
in release/pkg/assets_capa.go
100 14 1
func()
in pkg/executables/govc.go
94 21 1
func ValidateImmutableFields()
in pkg/validations/upgradevalidations/immutableFields.go
94 36 5
func()
in release/pkg/generate_spec.go
94 15 1
func()
in controllers/controllers/resource/template.go
89 18 1
func()
in release/pkg/assets_eksd.go
89 10 1
func()
in pkg/providers/vsphere/vsphere.go
88 17 1
func()
in release/pkg/assets_capv.go
87 12 1
func autofill()
in cmd/eks-a-tool/cmd/vsphereautofill.go
87 15 1
func()
in release/pkg/assets_capd.go
86 12 1
func()
in release/pkg/assets_capt.go
83 11 1