kubernetes / cloud-provider-openstack
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 696 units with 13,423 lines of code in units (70.4% of code).
    • 9 very long units (1,565 lines of code)
    • 33 long units (2,275 lines of code)
    • 163 medium size units (5,075 lines of code)
    • 191 small units (2,842 lines of code)
    • 300 very small units (1,666 lines of code)
11% | 16% | 37% | 21% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go11% | 16% | 37% | 21% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/openstack31% | 15% | 32% | 12% | 7%
pkg/ingress22% | 17% | 41% | 12% | 5%
pkg/autohealing13% | 10% | 54% | 12% | 9%
pkg/csi0% | 18% | 35% | 25% | 19%
pkg/identity0% | 36% | 37% | 22% | 3%
cmd/client-keystone-auth0% | 54% | 29% | 15% | 0%
cmd/manila-csi-plugin0% | 67% | 23% | 0% | 10%
pkg/client0% | 24% | 55% | 5% | 14%
pkg/util0% | 0% | 39% | 42% | 18%
pkg/kms0% | 0% | 36% | 45% | 18%
cmd/cinder-csi-plugin0% | 0% | 67% | 26% | 6%
cmd/barbican-kms-plugin0% | 0% | 90% | 0% | 9%
cmd/k8s-keystone-auth0% | 0% | 100% | 0% | 0%
cmd/openstack-cloud-controller-manager0% | 0% | 0% | 100% | 0%
pkg/metrics0% | 0% | 0% | 26% | 73%
pkg/version0% | 0% | 0% | 0% | 100%
cmd/magnum-auto-healer0% | 0% | 0% | 0% | 100%
cmd/octavia-ingress-controller0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/openstack/loadbalancer.go
391 99 1
func()
in pkg/ingress/controller/controller.go
210 38 1
func()
in pkg/openstack/loadbalancer.go
182 36 1
func()
in pkg/openstack/loadbalancer.go
159 40 1
func()
in pkg/openstack/loadbalancer.go
155 50 1
func()
in pkg/autohealing/cloudprovider/openstack/provider.go
129 29 1
func()
in pkg/openstack/loadbalancer.go
121 32 1
func()
in pkg/openstack/loadbalancer.go
113 32 1
func NewController()
in pkg/ingress/controller/controller.go
105 16 1
func()
in pkg/openstack/loadbalancer.go
94 21 1
func nodeAddresses()
in pkg/openstack/instances.go
93 20 3
func NewKeystoneAuth()
in pkg/identity/keystone/keystone.go
90 21 1
func main()
in cmd/client-keystone-auth/main.go
83 8 0
func()
in pkg/openstack/loadbalancer.go
83 19 1
func()
in pkg/ingress/controller/openstack/octavia.go
82 17 1
func nodePublishEphemeral()
in pkg/csi/cinder/nodeserver.go
80 18 2
func()
in pkg/csi/cinder/controllerserver.go
77 21 1
func()
in pkg/csi/manila/controllerserver.go
76 19 1
func()
in pkg/openstack/loadbalancer.go
74 19 1
func()
in pkg/csi/manila/controllerserver.go
74 16 1