kubernetes / kompose
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 198 units with 4,698 lines of code in units (86.6% of code).
    • 1 very complex units (200 lines of code)
    • 4 complex units (490 lines of code)
    • 21 medium complex units (1,285 lines of code)
    • 29 simple units (911 lines of code)
    • 143 very simple units (1,812 lines of code)
4% | 10% | 27% | 19% | 38%
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
go4% | 10% | 27% | 19% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/loader16% | 0% | 48% | 16% | 18%
pkg/transformer0% | 18% | 11% | 22% | 47%
cmd0% | 0% | 80% | 6% | 12%
pkg/app0% | 0% | 69% | 0% | 30%
pkg/utils0% | 0% | 28% | 0% | 71%
pkg/testutils0% | 0% | 0% | 38% | 61%
pkg/kobject0% | 0% | 0% | 44% | 56%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func mergeComposeObject()
in pkg/loader/compose/v3.go
200 66 2
func()
in pkg/transformer/openshift/openshift.go
122 39 1
func()
in pkg/transformer/kubernetes/k8sutils.go
134 36 1
func()
in pkg/transformer/kubernetes/kubernetes.go
130 31 1
func()
in pkg/transformer/kubernetes/kubernetes.go
104 26 1
func ValidateFlags()
in pkg/app/app.go
70 25 3
func PrintList()
in pkg/transformer/kubernetes/k8sutils.go
99 25 2
func runCompletionZsh()
in cmd/completion.go
144 24 2
func checkUnsupportedKey()
in pkg/loader/compose/compose.go
76 22 1
func parseHealthCheckReadiness()
in pkg/loader/compose/v3.go
62 19 1
36 18 1
func libComposeToKomposeMapping()
in pkg/loader/compose/v1v2.go
93 18 1
func loadPorts()
in pkg/loader/compose/v1v2.go
63 17 2
func dockerComposeToKomposeMapping()
in pkg/loader/compose/v3.go
90 16 1
func parseKomposeLabels()
in pkg/loader/compose/v3.go
37 16 2
func()
in pkg/transformer/kubernetes/kubernetes.go
45 16 1
func parseWindowsVolume()
in pkg/transformer/utils.go
53 15 1
func loadEnvVars()
in pkg/loader/compose/utils.go
38 13 1
func parseHealthCheck()
in pkg/loader/compose/v3.go
52 13 2
func parseVolume()
in pkg/transformer/utils.go
34 13 1