kubernetes / kops
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 7,951 units with 127,775 lines of code in units (56.3% of code).
    • 28 very complex units (11,378 lines of code)
    • 90 complex units (12,502 lines of code)
    • 369 medium complex units (22,984 lines of code)
    • 724 simple units (22,667 lines of code)
    • 6,740 very simple units (58,244 lines of code)
8% | 9% | 17% | 17% | 45%
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
go8% | 9% | 17% | 17% | 45%
py0% | 0% | 36% | 18% | 44%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg14% | 10% | 14% | 14% | 47%
upup6% | 12% | 20% | 20% | 39%
cmd7% | 13% | 30% | 16% | 32%
protokube0% | 15% | 10% | 28% | 44%
nodeup0% | 6% | 28% | 25% | 39%
util0% | 2% | 15% | 23% | 58%
cloudmock0% | 0% | 14% | 15% | 69%
dns-controller0% | 0% | 52% | 21% | 26%
dnsprovider0% | 0% | 14% | 10% | 75%
channels0% | 0% | 16% | 34% | 49%
hack0% | 0% | 36% | 18% | 44%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func RegisterConversions()
in pkg/apis/kops/v1alpha2/zz_generated.conversion.go
1163 233 1
func RegisterConversions()
in pkg/apis/kops/v1alpha3/zz_generated.conversion.go
1113 223 1
func ValidateCluster()
in pkg/apis/kops/validation/legacy.go
316 140 2
func()
in upup/pkg/fi/cloudup/apply_cluster.go
528 111 1
func()
in upup/pkg/fi/cloudup/spotinsttasks/elastigroup.go
434 100 1
func()
in upup/pkg/fi/cloudup/bootstrapchannelbuilder/bootstrapchannelbuilder.go
663 91 1
func RunCreateCluster()
in cmd/kops/create_cluster.go
303 88 4
func autoConvert_v1alpha2_ClusterSpec_To_kops_ClusterSpec()
in pkg/apis/kops/v1alpha2/zz_generated.conversion.go
415 88 3
func autoConvert_kops_ClusterSpec_To_v1alpha2_ClusterSpec()
in pkg/apis/kops/v1alpha2/zz_generated.conversion.go
415 88 3
func autoConvert_v1alpha3_ClusterSpec_To_kops_ClusterSpec()
in pkg/apis/kops/v1alpha3/zz_generated.conversion.go
407 86 3
func autoConvert_kops_ClusterSpec_To_v1alpha3_ClusterSpec()
in pkg/apis/kops/v1alpha3/zz_generated.conversion.go
407 86 3
func()
in pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go
368 75 1
func()
in pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go
368 75 1
func()
in pkg/apis/kops/zz_generated.deepcopy.go
368 75 1
func()
in upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go
292 75 1
func()
in upup/pkg/fi/cloudup/spotinsttasks/ocean.go
315 72 1
func()
in pkg/model/awsmodel/network.go
439 67 1
func()
in pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go
312 66 1
func()
in pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go
312 66 1
func()
in pkg/apis/kops/zz_generated.deepcopy.go
312 66 1