kubernetes / legacy-cloud-providers
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 2,109 units with 33,583 lines of code in units (87.9% of code).
    • 3 very complex units (976 lines of code)
    • 19 complex units (2,557 lines of code)
    • 108 medium complex units (6,449 lines of code)
    • 237 simple units (6,907 lines of code)
    • 1,742 very simple units (16,694 lines of code)
2% | 7% | 19% | 20% | 49%
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
go2% | 7% | 19% | 20% | 49%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
azure4% | 11% | 31% | 21% | 30%
aws5% | 9% | 25% | 22% | 37%
openstack10% | 12% | 10% | 25% | 41%
gce0% | 6% | 12% | 20% | 61%
vsphere0% | 11% | 32% | 22% | 32%
vsphere/vclib0% | 0% | 22% | 22% | 55%
azure/clients0% | 0% | 1% | 14% | 84%
azure/auth0% | 0% | 34% | 28% | 36%
azure/retry0% | 0% | 0% | 28% | 71%
gce/gcpcredential0% | 0% | 0% | 19% | 80%
azure/mockvmsets0% | 0% | 0% | 0% | 100%
azure/metrics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in azure/azure_loadbalancer.go
357 84 1
func()
in openstack/openstack_loadbalancer.go
293 80 1
func()
in aws/aws.go
326 70 1
func()
in aws/aws_loadbalancer.go
215 50 1
func()
in azure/azure_loadbalancer.go
182 50 1
func()
in gce/gce_loadbalancer_external.go
159 46 1
func()
in vsphere/vsphere.go
197 43 1
func()
in aws/aws_loadbalancer.go
206 40 1
func()
in openstack/openstack_loadbalancer.go
101 39 1
func()
in azure/azure.go
147 38 1
func()
in gce/gce_loadbalancer_internal.go
146 36 1
func()
in azure/azure_loadbalancer.go
80 34 1
func()
in azure/azure_loadbalancer.go
103 34 1
func()
in openstack/openstack_loadbalancer.go
115 31 1
func()
in azure/azure_vmss.go
115 31 1
142 31 1
func()
in aws/aws.go
137 29 1
func()
in azure/azure_loadbalancer.go
81 29 1
75 28 1
func()
in azure/azure_standard.go
99 28 1