kubernetes / kube-openapi
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 855 units with 9,308 lines of code in units (81.8% of code).
    • 0 very complex units (0 lines of code)
    • 8 complex units (730 lines of code)
    • 22 medium complex units (1,087 lines of code)
    • 68 simple units (1,884 lines of code)
    • 757 very simple units (5,607 lines of code)
0% | 7% | 11% | 20% | 60%
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
go0% | 7% | 11% | 20% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/validation0% | 8% | 6% | 10% | 74%
pkg/handler0% | 45% | 0% | 21% | 32%
pkg/schemamutation0% | 32% | 26% | 29% | 11%
pkg/aggregator0% | 21% | 36% | 15% | 26%
pkg/generators0% | 0% | 15% | 36% | 48%
pkg/schemaconv0% | 0% | 42% | 21% | 35%
pkg/builder0% | 0% | 32% | 37% | 30%
pkg/builder30% | 0% | 29% | 27% | 42%
pkg/util0% | 0% | 0% | 37% | 62%
pkg/spec30% | 0% | 0% | 10% | 89%
pkg/handler30% | 0% | 0% | 29% | 70%
cmd/openapi2smd0% | 0% | 0% | 100% | 0%
pkg/common0% | 0% | 0% | 11% | 88%
cmd/openapi-gen0% | 0% | 0% | 0% | 100%
pkg/internal0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func PruneDefaultsSchema()
in pkg/handler/default_pruning.go
151 43 1
func()
in pkg/schemamutation/walker.go
137 39 1
func()
in pkg/validation/validate/schema_props.go
114 37 1
func()
in pkg/validation/validate/object_validator.go
69 33 1
func()
in pkg/validation/validate/type.go
74 33 1
func()
in pkg/validation/strfmt/format.go
75 30 1
func()
in pkg/validation/validate/type.go
28 27 1
func mergeSpecs()
in pkg/aggregator/aggregator.go
82 26 4
func()
in pkg/validation/validate/slice_validator.go
55 22 1
func()
in pkg/builder/openapi.go
71 20 1
func()
in pkg/builder3/openapi.go
60 18 1
func()
in pkg/aggregator/walker.go
48 17 1
func()
in pkg/generators/openapi.go
82 17 1
func()
in pkg/schemamutation/walker.go
63 17 1
func()
in pkg/generators/openapi.go
57 16 1
func()
in pkg/builder/openapi.go
57 16 1
func IsValueValidAgainstRange()
in pkg/validation/validate/values.go
48 14 5
func makeUnions()
in pkg/schemaconv/smd.go
44 13 1
func()
in pkg/schemaconv/smd.go
46 13 1
func()
in pkg/validation/validate/schema.go
54 13 1