kubernetes / apiextensions-apiserver
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,843 units with 33,492 lines of code in units (88.1% of code).
    • 19 very complex units (7,976 lines of code)
    • 48 complex units (6,770 lines of code)
    • 62 medium complex units (3,661 lines of code)
    • 103 simple units (2,637 lines of code)
    • 1,611 very simple units (12,448 lines of code)
23% | 20% | 10% | 7% | 37%
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
go23% | 20% | 10% | 7% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/apis31% | 25% | 5% | 4% | 32%
pkg/apiserver6% | 10% | 29% | 18% | 33%
pkg/controller0% | 0% | 31% | 23% | 44%
pkg/registry0% | 0% | 21% | 10% | 68%
pkg/cmd0% | 0% | 39% | 0% | 60%
pkg/client0% | 0% | 0% | 3% | 96%
pkg/apihelpers0% | 0% | 0% | 13% | 86%
pkg/crdserverscheme0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
pkg/features0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
1671 479 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
1671 479 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
375 109 1
func ValidateCustomResourceDefinitionOpenAPISchema()
in pkg/apis/apiextensions/validation/validation.go
176 87 5
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
280 81 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
280 81 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
515 70 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
515 70 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
236 68 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
241 67 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
241 67 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
228 64 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
228 64 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
210 59 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
210 59 1
func()
in pkg/apiserver/customresource_handler.go
315 57 1
func()
in pkg/apis/apiextensions/deepcopy.go
243 57 1
func validateCustomResourceDefinitionSpec()
in pkg/apis/apiextensions/validation/validation.go
116 54 3
func()
in pkg/apis/apiextensions/v1beta1/deepcopy.go
225 53 1
func()
in pkg/apis/apiextensions/v1/deepcopy.go
211 50 1