kubernetes / kubelet
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,020 units with 13,837 lines of code in units (86.6% of code).
    • 6 very complex units (1,620 lines of code)
    • 21 complex units (2,829 lines of code)
    • 38 medium complex units (2,648 lines of code)
    • 24 simple units (780 lines of code)
    • 931 very simple units (5,960 lines of code)
11% | 20% | 19% | 5% | 43%
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
go11% | 20% | 19% | 5% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/apis/deviceplugin/v1beta112% | 12% | 25% | 4% | 44%
pkg/apis/podresources/v116% | 17% | 18% | 9% | 38%
pkg/apis/deviceplugin/v1alpha16% | 23% | 16% | 3% | 40%
config/v1beta161% | 0% | 0% | 0% | 38%
pkg/apis/podresources/v1alpha10% | 32% | 18% | 4% | 44%
pkg/apis/pluginregistration/v10% | 45% | 12% | 7% | 34%
pkg/apis/pluginregistration/v1alpha10% | 30% | 19% | 6% | 44%
pkg/apis/pluginregistration/v1beta10% | 30% | 19% | 6% | 44%
pkg/apis/credentialprovider/v1alpha10% | 0% | 0% | 21% | 78%
config/v1alpha10% | 0% | 0% | 0% | 100%
pkg/apis/credentialprovider0% | 0% | 0% | 0% | 100%
pkg/apis0% | 0% | 0% | 0% | 100%
pkg/apis/credentialprovider/install0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/apis/deviceplugin/v1beta1/api.pb.go
371 103 1
func()
in pkg/apis/deviceplugin/v1alpha/api.pb.go
371 103 1
func()
in pkg/apis/podresources/v1/api.pb.go
225 65 1
func()
in config/v1beta1/zz_generated.deepcopy.go
279 59 1
func()
in pkg/apis/podresources/v1/api.pb.go
193 56 1
func()
in pkg/apis/deviceplugin/v1beta1/api.pb.go
181 51 1
func()
in pkg/apis/pluginregistration/v1alpha1/api.pb.go
177 49 1
func()
in pkg/apis/pluginregistration/v1beta1/api.pb.go
177 49 1
func()
in pkg/apis/pluginregistration/v1/api.pb.go
165 44 1
func()
in pkg/apis/podresources/v1/api.pb.go
149 42 1
func()
in pkg/apis/deviceplugin/v1beta1/api.pb.go
149 42 1
func()
in pkg/apis/podresources/v1alpha1/api.pb.go
150 41 1
func()
in pkg/apis/podresources/v1/api.pb.go
147 41 1
func()
in pkg/apis/deviceplugin/v1beta1/api.pb.go
145 40 1
func()
in pkg/apis/deviceplugin/v1alpha/api.pb.go
145 40 1
func()
in pkg/apis/deviceplugin/v1alpha/api.pb.go
145 40 1
func()
in pkg/apis/podresources/v1/api.pb.go
136 39 1
func()
in pkg/apis/deviceplugin/v1beta1/api.pb.go
132 37 1
func()
in pkg/apis/deviceplugin/v1beta1/api.pb.go
133 37 1
func()
in pkg/apis/deviceplugin/v1alpha/api.pb.go
133 37 1