kubernetes / kubectl
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,857 units with 32,236 lines of code in units (50.1% of code).
    • 1 very complex units (232 lines of code)
    • 21 complex units (2,359 lines of code)
    • 130 medium complex units (6,692 lines of code)
    • 287 simple units (8,474 lines of code)
    • 1,418 very simple units (14,479 lines of code)
<1% | 7% | 20% | 26% | 44%
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
go<1% | 7% | 20% | 26% | 44%
py0% | 0% | 0% | 70% | 29%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/cmd1% | 7% | 23% | 25% | 41%
pkg/polymorphichelpers0% | 21% | 34% | 12% | 32%
pkg/describe0% | 6% | 18% | 33% | 41%
pkg/generate0% | 22% | 14% | 19% | 43%
pkg/util0% | 0% | 8% | 27% | 63%
pkg/drain0% | 0% | 17% | 18% | 63%
pkg/rawhttp0% | 0% | 76% | 0% | 23%
pkg/apps0% | 0% | 74% | 0% | 25%
pkg/apply0% | 0% | 0% | 28% | 71%
pkg/explain0% | 0% | 0% | 32% | 67%
pkg/scale0% | 0% | 0% | 37% | 62%
pkg/proxy0% | 0% | 0% | 18% | 81%
pkg/validation0% | 0% | 0% | 60% | 39%
pkg/metricsutil0% | 0% | 0% | 12% | 87%
pkg/scheme0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/cmd/set/set_env.go
232 58 1
func isLess()
in pkg/cmd/get/sorter.go
114 49 2
func generateService()
in pkg/generate/versioned/service.go
140 44 1
func()
in pkg/cmd/util/editor/editoptions.go
187 43 1
func()
in pkg/cmd/run/run.go
144 40 1
119 39 3
func()
in pkg/cmd/apply/apply.go
147 38 1
func()
in pkg/cmd/config/create_authinfo.go
123 38 1
func()
in pkg/cmd/expose/expose.go
136 37 1
func()
in pkg/cmd/get/get.go
88 34 1
func mapBasedSelectorForObject()
in pkg/polymorphichelpers/mapbasedselectorforobject.go
86 34 1
func()
in pkg/cmd/label/label.go
130 33 1
func()
in pkg/cmd/clusterinfo/clusterinfo_dump.go
122 33 1
func describeVolumes()
in pkg/describe/describe.go
76 33 3
func logsForObjectWithClient()
in pkg/polymorphichelpers/logsforobject.go
108 33 5
func SelectorsForObject()
in pkg/polymorphichelpers/helpers.go
100 33 1
func()
in pkg/cmd/get/get.go
113 30 1
func modifyConfig()
in pkg/cmd/config/set.go
96 30 5
func()
in pkg/cmd/apiresources/apiresources.go
88 27 1
func()
in pkg/cmd/annotate/annotate.go
108 27 1