kubernetes / api
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 14,170 units with 246,598 lines of code in units (88.3% of code).
    • 213 very complex units (60,650 lines of code)
    • 505 complex units (66,394 lines of code)
    • 230 medium complex units (17,977 lines of code)
    • 308 simple units (11,713 lines of code)
    • 12,914 very simple units (89,864 lines of code)
24% | 26% | 7% | 4% | 36%
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
go24% | 26% | 7% | 4% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
core33% | 23% | 7% | 4% | 31%
apps29% | 23% | 3% | 2% | 40%
autoscaling21% | 32% | 3% | 6% | 36%
extensions21% | 29% | 6% | 3% | 40%
storage21% | 26% | 7% | 4% | 39%
flowcontrol14% | 27% | 10% | 5% | 42%
admission50% | 6% | 16% | 3% | 22%
admissionregistration21% | 30% | 11% | 3% | 32%
policy18% | 33% | 7% | 4% | 36%
batch23% | 28% | 6% | 7% | 34%
certificates30% | 18% | 12% | 3% | 35%
authorization14% | 34% | 7% | 5% | 37%
discovery25% | 17% | 15% | 8% | 33%
events38% | 15% | 14% | 0% | 30%
node22% | 26% | 5% | 6% | 38%
networking10% | 34% | 6% | 4% | 43%
rbac6% | 39% | 7% | 4% | 42%
scheduling26% | 16% | 11% | 0% | 45%
authentication13% | 34% | 7% | 5% | 39%
imagepolicy34% | 11% | 11% | 5% | 36%
coordination20% | 23% | 8% | 10% | 37%
apiserverinternal13% | 32% | 7% | 5% | 40%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in core/v1/generated.pb.go
1313 377 1
func()
in core/v1/generated.pb.go
1093 332 1
func()
in core/v1/generated.pb.go
841 255 1
func()
in policy/v1beta1/generated.pb.go
755 220 1
func()
in extensions/v1beta1/generated.pb.go
755 220 1
func()
in core/v1/generated.pb.go
748 218 1
func()
in core/v1/generated.pb.go
748 218 1
func()
in core/v1/generated.pb.go
725 204 1
func()
in core/v1/generated.pb.go
726 202 1
func()
in core/v1/generated.pb.go
609 174 1
func()
in core/v1/generated.pb.go
530 155 1
func()
in events/v1beta1/generated.pb.go
530 155 1
func()
in events/v1/generated.pb.go
530 155 1
func()
in admission/v1beta1/generated.pb.go
532 155 1
func()
in admission/v1/generated.pb.go
532 155 1
func()
in core/v1/generated.pb.go
479 137 1
func()
in core/v1/generated.pb.go
444 126 1
func()
in core/v1/generated.pb.go
436 125 1
func()
in core/v1/generated.pb.go
438 122 1
func()
in discovery/v1/generated.pb.go
412 116 1