bottlerocket-os / bottlerocket-update-operator
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 160 units with 1,644 lines of code in units (55.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (243 lines of code)
    • 15 simple units (369 lines of code)
    • 140 very simple units (1,032 lines of code)
0% | 0% | 14% | 22% | 62%
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% | 14% | 22% | 62%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/controller0% | 0% | 29% | 37% | 32%
pkg/agent0% | 0% | 21% | 21% | 56%
ROOT0% | 0% | 73% | 0% | 26%
pkg/intent0% | 0% | 10% | 18% | 71%
pkg/platform0% | 0% | 0% | 25% | 74%
pkg/nodestream0% | 0% | 0% | 34% | 65%
pkg/internal0% | 0% | 0% | 0% | 100%
pkg/k8sutil0% | 0% | 0% | 0% | 100%
pkg/sigcontext0% | 0% | 0% | 0% | 100%
pkg/logging0% | 0% | 0% | 0% | 100%
pkg/workgroup0% | 0% | 0% | 0% | 100%
pkg/marker0% | 0% | 0% | 0% | 100%
pkg/bottlerocket0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/agent/agent.go
75 17 1
func()
in pkg/controller/manager.go
67 15 1
func()
in pkg/intent/intent.go
22 14 1
func main()
in main.go
44 13 0
func()
in pkg/controller/manager.go
35 12 1
func()
in pkg/controller/manager.go
38 10 1
func()
in pkg/platform/api/platform.go
21 8 1
func()
in pkg/platform/api/api.go
26 8 1
func New()
in pkg/agent/agent.go
37 7 3
func()
in pkg/platform/api/platform.go
21 7 1
func newPolicyCheck()
in pkg/controller/policy.go
36 7 2
func()
in pkg/controller/policy.go
28 7 1
func()
in pkg/nodestream/config.go
26 6 1
func activeIntent()
in pkg/agent/agent.go
6 6 1
func()
in pkg/agent/agent.go
30 6 1
func()
in pkg/platform/updog/updog.go
30 6 1
func()
in pkg/intent/intent.go
18 6 1
func()
in pkg/intent/intent.go
14 6 1
func Equivalent()
in pkg/intent/intent.go
9 6 2
func()
in pkg/controller/manager.go
29 6 1