kubernetes / kops
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 7,951 units with 127,775 lines of code in units (56.3% of code).
    • 143 very long units (27,301 lines of code)
    • 285 long units (19,197 lines of code)
    • 1,136 medium size units (34,365 lines of code)
    • 1,630 small units (24,105 lines of code)
    • 4,757 very small units (22,807 lines of code)
21% | 15% | 26% | 18% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go21% | 14% | 26% | 18% | 17%
py0% | 36% | 18% | 12% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg26% | 13% | 21% | 18% | 19%
upup21% | 15% | 28% | 17% | 17%
cmd26% | 22% | 33% | 12% | 5%
nodeup22% | 28% | 30% | 12% | 6%
protokube15% | 11% | 36% | 15% | 21%
dns-controller18% | 33% | 21% | 18% | 7%
cloudmock1% | 6% | 40% | 33% | 18%
util0% | 12% | 40% | 28% | 18%
dnsprovider0% | 11% | 14% | 31% | 42%
channels0% | 19% | 33% | 34% | 11%
hack0% | 36% | 18% | 12% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func RegisterConversions()
in pkg/apis/kops/v1alpha2/zz_generated.conversion.go
1163 233 1
func RegisterConversions()
in pkg/apis/kops/v1alpha3/zz_generated.conversion.go
1113 223 1
func()
in upup/pkg/fi/cloudup/bootstrapchannelbuilder/bootstrapchannelbuilder.go
663 91 1
func()
in upup/pkg/fi/cloudup/apply_cluster.go
528 111 1
func()
in pkg/model/awsmodel/network.go
439 67 1
func()
in upup/pkg/fi/cloudup/spotinsttasks/elastigroup.go
434 100 1
func()
in pkg/model/awsmodel/api_loadbalancer.go
417 55 1
func autoConvert_v1alpha2_ClusterSpec_To_kops_ClusterSpec()
in pkg/apis/kops/v1alpha2/zz_generated.conversion.go
415 88 3
func autoConvert_kops_ClusterSpec_To_v1alpha2_ClusterSpec()
in pkg/apis/kops/v1alpha2/zz_generated.conversion.go
415 88 3
func autoConvert_v1alpha3_ClusterSpec_To_kops_ClusterSpec()
in pkg/apis/kops/v1alpha3/zz_generated.conversion.go
407 86 3
func autoConvert_kops_ClusterSpec_To_v1alpha3_ClusterSpec()
in pkg/apis/kops/v1alpha3/zz_generated.conversion.go
407 86 3
func()
in pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go
368 75 1
func()
in pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go
368 75 1
func()
in pkg/apis/kops/zz_generated.deepcopy.go
368 75 1
func ValidateCluster()
in pkg/apis/kops/validation/legacy.go
316 140 2
func()
in upup/pkg/fi/cloudup/spotinsttasks/ocean.go
315 72 1
func()
in pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go
312 66 1
func()
in pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go
312 66 1
func()
in pkg/apis/kops/zz_generated.deepcopy.go
312 66 1
func RunCreateCluster()
in cmd/kops/create_cluster.go
303 88 4