kubernetes / metrics
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 673 units with 9,075 lines of code in units (82.9% of code).
    • 9 very complex units (2,069 lines of code)
    • 10 complex units (1,155 lines of code)
    • 7 medium complex units (496 lines of code)
    • 17 simple units (685 lines of code)
    • 630 very simple units (4,670 lines of code)
22% | 12% | 5% | 7% | 51%
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
go22% | 12% | 5% | 7% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/apis/metrics/v1alpha135% | 12% | 6% | 6% | 39%
pkg/apis/metrics/v1beta135% | 12% | 6% | 6% | 39%
pkg/apis/external_metrics/v1beta132% | 12% | 8% | 6% | 39%
pkg/apis/custom_metrics/v1beta121% | 20% | 7% | 8% | 42%
pkg/apis/custom_metrics/v1beta215% | 26% | 6% | 7% | 44%
pkg/client/custom_metrics0% | 0% | 0% | 33% | 66%
pkg/client/clientset/versioned0% | 0% | 0% | 4% | 95%
pkg/client/clientset/deprecated0% | 0% | 0% | 4% | 95%
pkg/client/external_metrics0% | 0% | 0% | 37% | 62%
pkg/apis/metrics0% | 0% | 0% | 0% | 100%
pkg/apis/custom_metrics0% | 0% | 0% | 0% | 100%
pkg/client/custom_metrics/fake0% | 0% | 0% | 0% | 100%
pkg/apis/external_metrics0% | 0% | 0% | 0% | 100%
pkg/client/external_metrics/fake0% | 0% | 0% | 0% | 100%
pkg/client/custom_metrics/scheme0% | 0% | 0% | 0% | 100%
pkg/apis/custom_metrics/install0% | 0% | 0% | 0% | 100%
pkg/apis/metrics/install0% | 0% | 0% | 0% | 100%
pkg/apis/external_metrics/install0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/apis/external_metrics/v1beta1/generated.pb.go
294 83 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
277 79 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
277 79 1
func()
in pkg/apis/custom_metrics/v1beta1/generated.pb.go
236 69 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
201 59 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
210 58 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
210 58 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
182 53 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
182 53 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
116 33 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
116 33 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/custom_metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
117 33 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
116 33 1
func()
in pkg/apis/external_metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/custom_metrics/v1beta1/generated.pb.go
113 31 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
113 31 1
func skipGenerated()
in pkg/apis/metrics/v1alpha1/generated.pb.go
78 24 1