aws / amazon-vpc-resource-controller-k8s
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 553 units with 5,749 lines of code in units (64.0% of code).
    • 1 very long units (244 lines of code)
    • 10 long units (657 lines of code)
    • 44 medium size units (1,354 lines of code)
    • 90 small units (1,274 lines of code)
    • 408 very small units (2,220 lines of code)
4% | 11% | 23% | 22% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go4% | 11% | 23% | 22% | 38%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT97% | 0% | 0% | 0% | 2%
pkg/provider0% | 25% | 20% | 29% | 24%
controllers/custom0% | 35% | 33% | 7% | 23%
scripts0% | 100% | 0% | 0% | 0%
controllers/core0% | 34% | 31% | 27% | 6%
pkg/aws0% | 6% | 40% | 40% | 12%
pkg/handler0% | 42% | 23% | 0% | 33%
pkg/pool0% | 23% | 43% | 29% | 2%
pkg/node0% | 0% | 59% | 21% | 19%
webhooks/core0% | 0% | 38% | 45% | 16%
pkg/utils0% | 0% | 50% | 25% | 23%
pkg/k8s0% | 0% | 25% | 40% | 33%
pkg/resource0% | 0% | 41% | 42% | 15%
pkg/worker0% | 0% | 19% | 21% | 59%
pkg/config0% | 0% | 88% | 0% | 11%
apis/vpcresources0% | 0% | 0% | 36% | 63%
pkg/condition0% | 0% | 0% | 53% | 46%
controllers/apps0% | 0% | 0% | 79% | 20%
mocks/amazon-vcp-resource-controller-k8s0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in main.go
244 18 0
func()
in pkg/provider/branch/trunk/trunk.go
82 17 1
func()
in controllers/custom/builder.go
79 17 1
func main()
in scripts/gen_vpc_limits.go
74 12 0
func()
in pkg/provider/branch/provider.go
73 12 1
func()
in pkg/provider/ip/eni/eni.go
68 17 1
func()
in controllers/core/pod_controller.go
61 15 1
func()
in pkg/provider/branch/trunk/trunk.go
57 10 1
func()
in pkg/handler/warm.go
56 11 1
func()
in pkg/aws/ec2/api/helper.go
56 14 1
func()
in pkg/pool/pool.go
51 10 1
func()
in pkg/provider/ip/eni/eni.go
48 10 1
func()
in pkg/node/manager/manager.go
47 9 1
func()
in pkg/pool/pool.go
46 12 1
func()
in pkg/aws/ec2/api/helper.go
45 13 1
func()
in pkg/utils/helper.go
45 14 1
func NewResourceManager()
in pkg/resource/manager.go
45 6 3
func()
in pkg/aws/ec2/api/wrapper.go
44 5 1
func()
in pkg/node/manager/manager.go
40 5 1
func()
in pkg/provider/branch/provider.go
40 7 1