kubernetes / cloud-provider-aws
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 406 units with 6,848 lines of code in units (85.3% of code).
    • 4 very long units (884 lines of code)
    • 20 long units (1,355 lines of code)
    • 73 medium size units (2,277 lines of code)
    • 85 small units (1,256 lines of code)
    • 224 very small units (1,076 lines of code)
12% | 19% | 33% | 18% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go12% | 19% | 33% | 18% | 15%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/providers/v114% | 19% | 34% | 17% | 14%
pkg/providers/v20% | 27% | 26% | 31% | 14%
cmd/ecr-credential-provider0% | 34% | 22% | 26% | 15%
cmd/aws-cloud-controller-manager0% | 0% | 66% | 33% | 0%
pkg/providers/v2/mocks0% | 0% | 0% | 0% | 100%
pkg/apis/config/v1alpha10% | 0% | 0% | 0% | 100%
hack0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/providers/v1/aws.go
326 70 1
func()
in pkg/providers/v1/aws_loadbalancer.go
215 50 1
func()
in pkg/providers/v1/aws_loadbalancer.go
206 40 1
func()
in pkg/providers/v1/aws.go
137 29 1
func newAWSCloud()
in pkg/providers/v1/aws.go
94 24 2
func()
in pkg/providers/v1/aws.go
94 22 1
func()
in pkg/providers/v1/aws_loadbalancer.go
90 17 1
func()
in pkg/providers/v1/aws.go
83 24 1
func()
in pkg/providers/v1/aws_loadbalancer.go
81 16 1
func()
in pkg/providers/v1/aws_loadbalancer.go
75 20 1
func()
in pkg/providers/v1/aws.go
74 15 1
func()
in pkg/providers/v1/aws.go
74 18 1
func()
in pkg/providers/v1/aws.go
70 13 1
func()
in pkg/providers/v1/aws.go
68 16 1
func()
in pkg/providers/v1/aws.go
65 16 1
func newCloud()
in pkg/providers/v2/cloud.go
58 10 1
func()
in pkg/providers/v1/aws_fakes.go
57 23 1
func()
in pkg/providers/v1/aws.go
57 13 1
func()
in cmd/ecr-credential-provider/main.go
56 12 1
func()
in pkg/providers/v1/aws.go
53 11 1