kubernetes / code-generator
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 503 units with 7,605 lines of code in units (79.1% of code).
    • 2 very complex units (459 lines of code)
    • 5 complex units (574 lines of code)
    • 22 medium complex units (1,280 lines of code)
    • 43 simple units (1,215 lines of code)
    • 431 very simple units (4,077 lines of code)
6% | 7% | 16% | 15% | 53%
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
go6% | 7% | 16% | 15% | 53%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cmd/client-gen10% | 8% | 8% | 9% | 63%
cmd/go-to-protobuf14% | 11% | 22% | 19% | 31%
cmd/conversion-gen0% | 13% | 30% | 28% | 27%
cmd/applyconfiguration-gen0% | 7% | 12% | 19% | 60%
cmd/informer-gen0% | 0% | 13% | 2% | 83%
cmd/lister-gen0% | 0% | 31% | 6% | 61%
cmd/register-gen0% | 0% | 43% | 0% | 56%
cmd/prerelease-lifecycle-gen0% | 0% | 17% | 45% | 37%
pkg/util0% | 0% | 0% | 36% | 63%
cmd/deepcopy-gen0% | 0% | 0% | 0% | 100%
cmd/defaulter-gen0% | 0% | 0% | 0% | 100%
cmd/openapi-gen0% | 0% | 0% | 0% | 100%
pkg/namer0% | 0% | 0% | 0% | 100%
cmd/set-gen0% | 0% | 0% | 0% | 100%
cmd/import-boss0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func Run()
in cmd/go-to-protobuf/protobuf/cmd.go
221 56 1
func()
in cmd/client-gen/generators/generator_for_type.go
238 54 1
func()
in cmd/client-gen/generators/fake/generator_fake_for_type.go
202 45 1
func()
in cmd/go-to-protobuf/protobuf/parser.go
85 38 1
func()
in cmd/conversion-gen/generators/conversion.go
134 31 1
func membersToFields()
in cmd/go-to-protobuf/protobuf/generator.go
81 29 4
func findReferenced()
in cmd/applyconfiguration-gen/generators/openapi.go
72 29 3
func parseClientExtensions()
in cmd/client-gen/generators/util/tags.go
76 24 1
func Packages()
in cmd/informer-gen/generators/packages.go
103 24 2
func memberTypeToProtobufField()
in cmd/go-to-protobuf/protobuf/generator.go
72 22 3
func Packages()
in cmd/conversion-gen/generators/conversion.go
106 22 2
func ParseClientGenTags()
in cmd/client-gen/generators/util/tags.go
54 19 1
func updateStructTags()
in cmd/go-to-protobuf/protobuf/parser.go
68 18 3
func getManualConversionFunctions()
in cmd/conversion-gen/generators/conversion.go
57 18 3
func assignGoTypeToProtoPackage()
in cmd/go-to-protobuf/protobuf/namer.go
53 17 5
func Packages()
in cmd/client-gen/generators/client_generator.go
68 17 2
func Packages()
in cmd/lister-gen/generators/lister.go
83 16 2
func Packages()
in cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go
67 15 2
func isProtoable()
in cmd/go-to-protobuf/protobuf/generator.go
35 14 2
func()
in cmd/conversion-gen/generators/conversion.go
36 14 1