kubernetes / cli-runtime
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 297 units with 3,821 lines of code in units (77.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 20 medium complex units (957 lines of code)
    • 36 simple units (911 lines of code)
    • 241 very simple units (1,953 lines of code)
0% | 0% | 25% | 23% | 51%
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% | 25% | 23% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/printers0% | 0% | 49% | 16% | 33%
pkg/genericclioptions0% | 0% | 28% | 6% | 65%
pkg/resource0% | 0% | 13% | 35% | 50%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func decorateTable()
in pkg/printers/tableprinter.go
80 25 2
func()
in pkg/genericclioptions/config_flags.go
63 20 1
func()
in pkg/genericclioptions/config_flags.go
59 20 1
func()
in pkg/printers/tableprinter.go
54 19 1
func printTable()
in pkg/printers/tableprinter.go
57 17 3
func()
in pkg/resource/visitor.go
52 15 1
func printRows()
in pkg/printers/tableprinter.go
37 15 4
func()
in pkg/genericclioptions/jsonpath_flags.go
44 15 1
func()
in pkg/genericclioptions/template_flags.go
41 15 1
func()
in pkg/resource/builder.go
71 14 1
func()
in pkg/resource/builder.go
41 13 1
func()
in pkg/genericclioptions/print_flags.go
29 13 1
func()
in pkg/resource/builder.go
40 12 1
func addColumns()
in pkg/printers/tableprinter.go
45 12 4
func()
in pkg/printers/yaml.go
43 12 1
func exists()
in pkg/printers/jsonpath.go
44 12 2
func()
in pkg/genericclioptions/builder_flags.go
46 12 1
func()
in pkg/resource/builder.go
31 11 1
func()
in pkg/resource/builder.go
46 11 1
func()
in pkg/printers/name.go
34 11 1