aws / karpenter
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 385 units with 4,720 lines of code in units (57.3% of code).
    • 1 very long units (174 lines of code)
    • 3 long units (175 lines of code)
    • 51 medium size units (1,512 lines of code)
    • 104 small units (1,492 lines of code)
    • 226 very small units (1,367 lines of code)
3% | 3% | 32% | 31% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go3% | 3% | 32% | 31% | 29%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/cloudprovider9% | 6% | 34% | 24% | 25%
pkg/controllers0% | 2% | 38% | 39% | 19%
pkg/apis0% | 0% | 22% | 27% | 50%
cmd/controller0% | 0% | 65% | 26% | 8%
pkg/utils0% | 0% | 7% | 33% | 59%
website/assets0% | 0% | 0% | 100% | 0%
cmd/webhook0% | 0% | 0% | 33% | 66%
pkg/metrics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/cloudprovider/aws/fake/ec2api.go
174 2 1
func()
in pkg/cloudprovider/aws/fake/ec2api.go
67 2 1
func()
in pkg/cloudprovider/aws/fake/ec2api.go
57 11 1
func()
in pkg/controllers/provisioning/binpacking/packer.go
51 10 1
func()
in pkg/controllers/node/controller.go
47 11 1
func()
in pkg/cloudprovider/fake/cloudprovider.go
42 5 1
func()
in pkg/cloudprovider/aws/instance.go
41 4 1
func()
in pkg/cloudprovider/aws/launchtemplate.go
40 7 1
func NewInstanceType()
in pkg/cloudprovider/fake/instancetype.go
40 7 1
func()
in pkg/controllers/metrics/pod/controller.go
40 6 1
func()
in pkg/cloudprovider/aws/instance.go
39 6 1
func PackablesFor()
in pkg/controllers/provisioning/binpacking/packable.go
39 11 5
func()
in pkg/cloudprovider/aws/launchtemplate.go
38 8 1
func()
in pkg/controllers/provisioning/provisioner.go
38 8 1
func()
in pkg/controllers/node/emptiness.go
38 10 1
func()
in pkg/cloudprovider/aws/instance.go
36 8 1
func()
in pkg/controllers/metrics/node/controller.go
36 7 1
func()
in pkg/cloudprovider/aws/launchtemplate.go
35 2 1
func()
in pkg/cloudprovider/aws/apis/v1alpha1/zz_generated.deepcopy.go
35 9 1
func()
in pkg/cloudprovider/fake/cloudprovider.go
35 2 1