kubernetes / cloud-provider-alibaba-cloud
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,195 units with 17,011 lines of code in units (60.4% of code).
    • 1 very complex units (222 lines of code)
    • 6 complex units (888 lines of code)
    • 51 medium complex units (2,868 lines of code)
    • 124 simple units (4,028 lines of code)
    • 1,013 very simple units (9,005 lines of code)
1% | 5% | 16% | 23% | 52%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go1% | 5% | 16% | 23% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/controller2% | 7% | 23% | 23% | 43%
pkg/provider0% | 2% | 9% | 26% | 61%
pkg/model0% | 0% | 8% | 5% | 85%
pkg/util0% | 0% | 0% | 22% | 77%
cmd/manager0% | 0% | 0% | 66% | 33%
pkg/apis0% | 0% | 0% | 0% | 100%
pkg/config0% | 0% | 0% | 0% | 100%
pkg/context0% | 0% | 0% | 0% | 100%
cmd/health0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func isNeedUpdate()
in pkg/controller/service/listeners.go
222 76 3
func()
in pkg/controller/service/listeners.go
163 43 1
func()
in pkg/provider/alibaba/alb/listener.go
189 42 1
func New()
in pkg/controller/ingress/reconcile/store/store.go
273 36 5
func()
in pkg/controller/service/loadbalancer.go
104 32 1
func diff()
in pkg/controller/service/vgroups.go
74 32 3
func()
in pkg/controller/pvtz/actuator.go
85 26 1
func()
in pkg/controller/ingress/reconcile/builder/albconfig_manager/model_builder.go
86 23 1
func()
in pkg/provider/alibaba/alb/server_group.go
107 23 1
func()
in pkg/controller/route/manager.go
66 21 1
func()
in pkg/controller/ingress/reconcile/applier/alb.go
80 21 1
func()
in pkg/controller/ingress/reconcile/applier/server_group.go
105 21 1
func()
in pkg/controller/ingress/reconcile/builder/albconfig_manager/model_build_listener_rules.go
96 21 1
func()
in pkg/controller/pvtz/actuator.go
63 20 1
func()
in pkg/controller/ingress/reconcile/applier/listener.go
85 18 1
func()
in pkg/controller/route/route_controller.go
50 16 1
func()
in pkg/controller/ingress/reconcile/backend/endpoint_resolver.go
50 16 1
func()
in pkg/controller/service/vgroups.go
66 16 1
func()
in pkg/controller/ingress/alb_controller.go
70 15 1
func()
in pkg/controller/ingress/reconcile/applier/server.go
44 15 1