kubernetes / client-go
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 10,729 units with 80,544 lines of code in units (69.5% of code).
    • 2 very complex units (1,438 lines of code)
    • 5 complex units (632 lines of code)
    • 67 medium complex units (3,365 lines of code)
    • 162 simple units (4,340 lines of code)
    • 10,493 very simple units (70,769 lines of code)
1% | <1% | 4% | 5% | 87%
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% | <1% | 4% | 5% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
applyconfigurations4% | 0% | 0% | 0% | 95%
informers4% | 0% | 0% | 0% | 95%
tools0% | 3% | 17% | 21% | 57%
kubernetes0% | <1% | 0% | <1% | 99%
util0% | 3% | 31% | 15% | 49%
testing0% | 10% | 0% | 18% | 70%
rest0% | 0% | 23% | 20% | 55%
transport0% | 0% | 27% | 22% | 50%
plugin0% | 0% | 16% | 34% | 48%
dynamic0% | 0% | 20% | 28% | 50%
metadata0% | 0% | 19% | 29% | 50%
restmapper0% | 0% | 33% | 25% | 40%
discovery0% | 0% | 9% | 29% | 61%
listers0% | 0% | 0% | 13% | 86%
scale0% | 0% | 0% | 22% | 77%
pkg0% | 0% | 0% | 15% | 84%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func ForKind()
in applyconfigurations/utils.go
1237 617 1
func()
in informers/generic.go
201 99 1
func NewForConfigAndClient()
in kubernetes/clientset.go
196 50 2
func ModifyConfig()
in tools/clientcmd/config.go
151 49 3
func validateAuthInfo()
in tools/clientcmd/validation.go
68 30 2
func ObjectReaction()
in testing/fixture.go
95 26 1
func WaitForCertificate()
in util/certificate/csr/csr.go
122 26 4
func RegisterConversions()
in tools/clientcmd/api/v1/zz_generated.conversion.go
123 25 1
func()
in plugin/pkg/client/auth/exec/exec.go
84 25 1
func()
in tools/remotecommand/v1.go
83 24 1
func TLSConfigFor()
in transport/transport.go
57 23 1
func()
in util/jsonpath/jsonpath.go
65 21 1
func()
in tools/watch/retrywatcher.go
97 21 1
func()
in util/jsonpath/jsonpath.go
51 20 1
func()
in rest/request.go
70 20 1
func()
in util/jsonpath/parser.go
74 19 1
func()
in tools/clientcmd/client_config.go
65 18 1
func()
in rest/request.go
68 18 1
func()
in rest/request.go
77 18 1
func()
in restmapper/shortcut.go
45 17 1