kubernetes / apimachinery
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 2,876 units with 36,392 lines of code in units (85.6% of code).
    • 15 very complex units (4,361 lines of code)
    • 35 complex units (4,248 lines of code)
    • 88 medium complex units (4,937 lines of code)
    • 191 simple units (5,176 lines of code)
    • 2,547 very simple units (17,670 lines of code)
11% | 11% | 13% | 14% | 48%
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% | 11% | 13% | 14% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/apis23% | 18% | 9% | 5% | 43%
pkg/runtime3% | 2% | 16% | 23% | 54%
pkg/util0% | 5% | 19% | 23% | 51%
pkg/api0% | 7% | 19% | 21% | 50%
pkg/labels0% | 0% | 17% | 32% | 50%
pkg/watch0% | 0% | 7% | 3% | 88%
pkg/conversion0% | 0% | 12% | 18% | 68%
pkg/version0% | 0% | 0% | 94% | 5%
pkg/fields0% | 0% | 0% | 0% | 100%
pkg/types0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/apis/meta/v1/generated.pb.go
735 208 1
func()
in pkg/apis/testapigroup/v1/generated.pb.go
500 141 1
func()
in pkg/apis/meta/v1/generated.pb.go
361 102 1
func()
in pkg/apis/meta/v1/generated.pb.go
288 82 1
func()
in pkg/apis/meta/v1/generated.pb.go
281 80 1
func()
in pkg/apis/testapigroup/v1/generated.pb.go
279 79 1
func()
in pkg/apis/testapigroup/v1/generated.pb.go
243 69 1
func()
in pkg/apis/meta/v1/generated.pb.go
233 67 1
func()
in pkg/apis/meta/v1/generated.pb.go
229 65 1
func()
in pkg/apis/meta/v1/generated.pb.go
230 65 1
func()
in pkg/apis/meta/v1/generated.pb.go
219 61 1
func()
in pkg/apis/meta/v1/generated.pb.go
210 58 1
func()
in pkg/apis/meta/v1/generated.pb.go
191 54 1
func()
in pkg/apis/meta/v1/generated.pb.go
182 52 1
func()
in pkg/runtime/generated.pb.go
180 51 1
func RegisterConversions()
in pkg/apis/meta/v1/zz_generated.conversion.go
238 48 1
func()
in pkg/apis/meta/v1/generated.pb.go
165 46 1
func()
in pkg/apis/meta/v1/generated.pb.go
166 46 1
func()
in pkg/apis/testapigroup/v1/generated.pb.go
148 43 1
func()
in pkg/apis/meta/v1/generated.pb.go
145 40 1