kubernetes / cloud-provider-alibaba-cloud
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 1,195 units with 17,011 lines of code in units (60.4% of code).
    • 7 very long units (1,163 lines of code)
    • 42 long units (2,816 lines of code)
    • 176 medium size units (5,568 lines of code)
    • 242 small units (3,530 lines of code)
    • 728 very small units (3,934 lines of code)
6% | 16% | 32% | 20% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go6% | 16% | 32% | 20% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/controller9% | 18% | 35% | 19% | 16%
pkg/provider4% | 15% | 30% | 21% | 28%
cmd/manager0% | 66% | 25% | 0% | 8%
pkg/util0% | 0% | 29% | 41% | 28%
pkg/model0% | 0% | 14% | 25% | 60%
pkg/config0% | 0% | 54% | 28% | 16%
pkg/apis0% | 0% | 0% | 12% | 87%
pkg/context0% | 0% | 0% | 0% | 100%
cmd/health0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func New()
in pkg/controller/ingress/reconcile/store/store.go
273 36 5
func isNeedUpdate()
in pkg/controller/service/listeners.go
222 76 3
func()
in pkg/provider/alibaba/alb/listener.go
189 42 1
func()
in pkg/controller/service/listeners.go
163 43 1
func()
in pkg/provider/alibaba/alb/server_group.go
107 23 1
func()
in pkg/controller/ingress/reconcile/applier/server_group.go
105 21 1
func()
in pkg/controller/service/loadbalancer.go
104 32 1
func()
in pkg/controller/ingress/reconcile/builder/albconfig_manager/model_build_listener_rules.go
96 21 1
func()
in pkg/controller/ingress/reconcile/builder/albconfig_manager/model_builder.go
86 23 1
func()
in pkg/controller/ingress/reconcile/applier/listener.go
85 18 1
func()
in pkg/controller/pvtz/actuator.go
85 26 1
func()
in pkg/provider/alibaba/alb/listener.go
83 9 1
func()
in pkg/provider/alibaba/alb/listener.go
81 10 1
func()
in pkg/controller/ingress/reconcile/applier/alb.go
80 21 1
func()
in pkg/provider/alibaba/alb/rule.go
78 8 1
func()
in pkg/provider/alibaba/alb/server.go
78 13 1
func NewClientMgr()
in pkg/provider/alibaba/base/clientMgr.go
75 10 0
func buildServerGroupHealthCheckConfig()
in pkg/controller/ingress/reconcile/builder/albconfig_manager/model_build_server_group.go
74 15 1
func()
in pkg/controller/ingress/reconcile/builder/albconfig_manager/model_build_listener.go
74 12 1
func diff()
in pkg/controller/service/vgroups.go
74 32 3