kubernetes / component-base
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 511 units with 4,097 lines of code in units (74.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (161 lines of code)
    • 23 simple units (577 lines of code)
    • 485 very simple units (3,359 lines of code)
0% | 0% | 3% | 14% | 81%
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% | 3% | 14% | 81%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
logs0% | 0% | 16% | 18% | 65%
config0% | 0% | 8% | 19% | 72%
metrics0% | 0% | 0% | 8% | 91%
cli0% | 0% | 0% | 16% | 83%
featuregate0% | 0% | 0% | 29% | 70%
version0% | 0% | 0% | 0% | 100%
configz0% | 0% | 0% | 0% | 100%
traces0% | 0% | 0% | 0% | 100%
term0% | 0% | 0% | 0% | 100%
codec0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func datatypes()
in logs/datapol/datapol.go
54 20 1
func RegisterConversions()
in config/v1alpha1/zz_generated.conversion.go
73 15 1
34 13 2
func()
in featuregate/feature_gate.go
35 10 1
func configureAndRun()
in logs/kube-log-runner/kube-log-runner.go
42 10 0
func matchOutputFile()
in config/testing/helpers.go
34 10 3
func()
in cli/flag/map_string_string.go
32 9 1
func GetHistogramVecFromGatherer()
in metrics/testutil/metrics.go
28 9 3
func()
in metrics/testutil/metrics.go
17 9 1
func AddFlags()
in logs/logs.go
30 9 2
func GetRoundtripTestCases()
in config/testing/roundtrip.go
35 9 3
func ValidateLeaderElectionConfiguration()
in config/validation/validation.go
28 9 2
func()
in cli/flag/map_string_bool.go
26 8 1
func AddGoFlags()
in logs/logs.go
27 8 2
func()
in cli/flag/langle_separated_map_string_string.go
22 7 1
func()
in cli/flag/colon_separated_multimap_string_string.go
22 7 1
func bucketQuantile()
in metrics/testutil/metrics.go
23 7 2
func setup()
in config/testing/apigroup.go
16 7 1
func runFuncs()
in config/testing/apigroup.go
22 7 3
func()
in config/types.go
18 7 1