kubernetes / controller-manager
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 97 units with 911 lines of code in units (69.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 6 simple units (158 lines of code)
    • 91 very simple units (753 lines of code)
0% | 0% | 0% | 17% | 82%
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% | 0% | 0% | 17% | 82%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/clientbuilder0% | 0% | 0% | 31% | 68%
config/v1alpha10% | 0% | 0% | 25% | 74%
pkg/leadermigration0% | 0% | 0% | 19% | 80%
app0% | 0% | 0% | 25% | 74%
config/v1beta10% | 0% | 0% | 0% | 100%
options0% | 0% | 0% | 0% | 100%
config0% | 0% | 0% | 0% | 100%
pkg/healthz0% | 0% | 0% | 0% | 100%
pkg/informerfactory0% | 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/leadermigration/options/options.go
27 8 1
func getOrCreateServiceAccount()
in pkg/clientbuilder/client_builder_dynamic.go
19 7 3
func RegisterConversions()
in config/v1alpha1/zz_generated.conversion.go
33 7 1
func()
in pkg/clientbuilder/client_builder_dynamic.go
41 6 1
18 6 3
20 6 1
func()
in options/generic.go
18 5 1
func NewLeaderMigrator()
in pkg/leadermigration/migrator.go
19 5 2
func ValidateLeaderMigrationConfiguration()
in pkg/leadermigration/config/config.go
16 5 1
21 5 3
21 5 3
func RegisterConversions()
in config/v1beta1/zz_generated.conversion.go
23 5 1
func()
in options/generic.go
19 4 1
func ReadLeaderMigrationConfiguration()
in pkg/leadermigration/config/config.go
15 4 1
func validateControllerLeaderConfiguration()
in pkg/leadermigration/config/config.go
12 4 2
func WaitForAPIServer()
in app/helper.go
22 4 2
func Enabled()
in pkg/leadermigration/util.go
3 3 1
func()
in pkg/clientbuilder/client_builder_dynamic.go
24 3 1
16 3 3
func NewBaseHandler()
in app/serve.go
14 3 2