aws / amazon-ec2-instance-selector
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 137 units with 2,534 lines of code in units (84.7% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (221 lines of code)
    • 10 medium complex units (641 lines of code)
    • 17 simple units (423 lines of code)
    • 108 very simple units (1,249 lines of code)
0% | 8% | 25% | 16% | 49%
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% | 8% | 25% | 16% | 49%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/selector0% | 20% | 9% | 19% | 50%
cmd0% | 0% | 82% | 17% | 0%
pkg/cli0% | 0% | 15% | 21% | 62%
pkg/ec2pricing0% | 0% | 39% | 15% | 45%
pkg/selector/outputs0% | 0% | 32% | 0% | 67%
pkg/bytequantity0% | 0% | 62% | 0% | 37%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/selector/selector.go
111 32 1
func()
in pkg/selector/selector.go
110 27 1
func()
in pkg/selector/emr.go
58 20 1
func main()
in cmd/main.go
163 19 0
func()
in pkg/cli/cli.go
57 18 1
func()
in pkg/cli/cli.go
44 16 1
func ParseToByteQuantity()
in pkg/bytequantity/bytequantity.go
54 15 1
func()
in pkg/selector/aggregates.go
47 14 1
func()
in pkg/ec2pricing/ec2pricing.go
57 11 1
func parseOndemandUnitPrice()
in pkg/ec2pricing/ec2pricing.go
42 11 1
func TableOutputWide()
in pkg/selector/outputs/outputs.go
82 11 1
37 11 2
func()
in pkg/selector/eks.go
38 10 1
func()
in pkg/selector/selector.go
41 9 1
func()
in pkg/selector/aggregates.go
26 9 1
func isSupportedWithRangeUint64()
in pkg/selector/comparators.go
13 8 2
func()
in pkg/cli/flags.go
30 8 1
func()
in pkg/cli/flags.go
39 8 1
func getOutputFn()
in cmd/main.go
20 8 2
func isSupportedWithRangeInt64()
in pkg/selector/comparators.go
10 7 2