aws / aws-node-termination-handler
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 122 units with 2,388 lines of code in units (7.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (178 lines of code)
    • 7 medium complex units (360 lines of code)
    • 17 simple units (553 lines of code)
    • 97 very simple units (1,297 lines of code)
0% | 7% | 15% | 23% | 54%
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% | 7% | 15% | 23% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cmd0% | 53% | 11% | 8% | 26%
pkg/node0% | 0% | 19% | 8% | 72%
pkg/monitor0% | 0% | 15% | 35% | 49%
pkg/webhook0% | 0% | 74% | 25% | 0%
pkg/ec2metadata0% | 0% | 23% | 31% | 45%
pkg/observability0% | 0% | 0% | 42% | 57%
pkg/config0% | 0% | 0% | 30% | 69%
pkg/interruptioneventstore0% | 0% | 0% | 11% | 88%
pkg/uptime0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func main()
in cmd/node-termination-handler.go
178 36 0
func()
in pkg/monitor/sqsevent/sqs-monitor.go
62 18 1
func removeTaint()
in pkg/node/node.go
51 13 3
func Post()
in pkg/webhook/webhook.go
73 13 3
func addTaint()
in pkg/node/node.go
50 12 4
func drainOrCordonIfNecessary()
in cmd/node-termination-handler.go
39 12 8
func()
in pkg/monitor/sqsevent/sqs-monitor.go
38 11 1
func()
in pkg/ec2metadata/ec2metadata.go
47 11 1
func()
in pkg/node/node.go
43 10 1
func ParseCliArgs()
in pkg/config/config.go
72 9 0
func()
in pkg/monitor/scheduledevent/scheduled-event-monitor.go
36 8 1
func()
in pkg/monitor/sqsevent/scheduled-change-event.go
45 8 1
func()
in pkg/monitor/sqsevent/sqs-monitor.go
25 8 1
func()
in pkg/monitor/sqsevent/asg-lifecycle-event.go
51 8 1
func InitK8sEventRecorder()
in pkg/observability/k8s-events.go
46 7 5
func uncordonAfterRebootPreDrain()
in pkg/monitor/scheduledevent/scheduled-event-monitor.go
24 7 2
func()
in pkg/monitor/sqsevent/sqs-monitor.go
25 7 1
func()
in pkg/ec2metadata/ec2metadata.go
17 7 1
func()
in pkg/ec2metadata/ec2metadata.go
17 7 1
func()
in pkg/interruptioneventstore/interruption-event-store.go
16 6 1