kubernetes / cloud-provider-vsphere
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 829 units with 10,481 lines of code in units (66.6% of code).
    • 6 very long units (869 lines of code)
    • 13 long units (855 lines of code)
    • 107 medium size units (3,188 lines of code)
    • 196 small units (2,911 lines of code)
    • 507 very small units (2,658 lines of code)
8% | 8% | 30% | 27% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go8% | 8% | 30% | 27% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/common18% | 15% | 35% | 19% | 12%
pkg/cloudprovider2% | 4% | 26% | 33% | 33%
cmd/vsphere-cloud-controller-manager76% | 0% | 12% | 10% | 0%
pkg/cli0% | 18% | 56% | 10% | 14%
pkg/nsxt0% | 0% | 50% | 33% | 15%
cmd/vcpctl0% | 0% | 57% | 23% | 19%
pkg/util0% | 0% | 0% | 17% | 82%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/common/config/config.go
173 45 1
func()
in pkg/common/connectionmanager/search.go
161 26 1
func()
in pkg/common/connectionmanager/zones.go
142 26 1
func()
in pkg/cloudprovider/vsphere/nodemanager.go
135 29 1
func main()
in cmd/vsphere-cloud-controller-manager/main.go
131 29 0
func()
in pkg/common/connectionmanager/search.go
127 20 1
func()
in pkg/common/config/config_ini_legacy.go
99 29 1
func()
in pkg/common/config/config_yaml.go
89 27 1
func()
in pkg/common/vclib/virtualmachine.go
84 17 1
func()
in pkg/cloudprovider/vsphere/loadbalancer/cleanup.go
76 23 1
func()
in pkg/common/connectionmanager/zones.go
70 17 1
func()
in pkg/cloudprovider/vsphere/loadbalancer/state.go
63 16 1
func()
in pkg/cloudprovider/vsphere/zones.go
56 11 1
func()
in pkg/common/vclib/datacenter.go
55 9 1
func()
in pkg/cloudprovider/vsphere/zones.go
55 11 1
func()
in pkg/common/vclib/virtualmachine.go
53 11 1
func()
in pkg/cli/user.go
52 9 1
func()
in pkg/common/connectionmanager/list.go
52 12 1
func()
in pkg/cloudprovider/vsphereparavirtual/cloud.go
51 11 1
func NewConnectorManager()
in pkg/nsxt/connector_manager.go
50 12 1