awslabs / aws-simple-ec2-cli
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 149 units with 2,848 lines of code in units (88.8% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (203 lines of code)
    • 8 medium complex units (405 lines of code)
    • 26 simple units (824 lines of code)
    • 113 very simple units (1,416 lines of code)
0% | 7% | 14% | 28% | 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% | 7% | 14% | 28% | 49%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/question0% | 12% | 14% | 41% | 31%
cmd0% | 17% | 0% | 27% | 54%
pkg/ec2helper0% | 0% | 13% | 22% | 64%
pkg/cfn0% | 0% | 51% | 0% | 48%
pkg/table0% | 0% | 26% | 51% | 21%
pkg/config0% | 0% | 41% | 0% | 59%
pkg/ec2instanceconnecthelper0% | 0% | 0% | 43% | 56%
pkg/tag0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
pkg/cli0% | 0% | 0% | 0% | 100%
pkg/iamhelper0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func launchInteractive()
in cmd/launch.go
97 41 1
func AskConfirmationWithInput()
in pkg/question/question.go
106 28 3
func AskQuestion()
in pkg/question/question.go
51 21 1
func getRunInstanceInput()
in pkg/ec2helper/ec2helper.go
65 19 2
func OverrideConfigWithFlags()
in pkg/config/config.go
41 14 2
func()
in pkg/ec2helper/ec2helper.go
57 14 1
func AskImage()
in pkg/question/question.go
66 13 2
func()
in pkg/cfn/cfn.go
35 12 1
func AppendInstances()
in pkg/table/table.go
41 11 4
func()
in pkg/cfn/cfn.go
49 11 1
39 10 3
func AskSecurityGroups()
in pkg/question/question.go
57 10 2
func()
in pkg/ec2helper/ec2helper.go
61 10 1
func()
in pkg/ec2helper/ec2helper.go
43 10 1
func AskIamProfile()
in pkg/question/question.go
55 8 1
func AskConfirmationWithTemplate()
in pkg/question/question.go
46 8 2
func AskInstanceIds()
in pkg/question/question.go
38 8 2
func terminateInteractive()
in cmd/terminate.go
28 8 1
34 8 1
16 8 2