awslabs / aws-simple-ec2-cli
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 149 units with 2,848 lines of code in units (88.8% of code).
    • 1 very long units (106 lines of code)
    • 8 long units (509 lines of code)
    • 34 medium size units (1,084 lines of code)
    • 58 small units (843 lines of code)
    • 48 very small units (306 lines of code)
3% | 17% | 38% | 29% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go3% | 17% | 38% | 29% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/question12% | 27% | 43% | 10% | 5%
pkg/ec2helper0% | 20% | 32% | 36% | 11%
cmd0% | 17% | 31% | 35% | 16%
pkg/cfn0% | 0% | 51% | 34% | 14%
pkg/table0% | 0% | 52% | 47% | 0%
pkg/ec2instanceconnecthelper0% | 0% | 52% | 47% | 0%
pkg/config0% | 0% | 41% | 46% | 13%
pkg/tag0% | 0% | 0% | 55% | 45%
ROOT0% | 0% | 0% | 0% | 100%
pkg/cli0% | 0% | 0% | 0% | 100%
pkg/iamhelper0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func AskConfirmationWithInput()
in pkg/question/question.go
106 28 3
func launchInteractive()
in cmd/launch.go
97 41 1
func AskImage()
in pkg/question/question.go
66 13 2
func getRunInstanceInput()
in pkg/ec2helper/ec2helper.go
65 19 2
func()
in pkg/ec2helper/ec2helper.go
61 10 1
func AskSecurityGroups()
in pkg/question/question.go
57 10 2
func()
in pkg/ec2helper/ec2helper.go
57 14 1
func AskIamProfile()
in pkg/question/question.go
55 8 1
func AskQuestion()
in pkg/question/question.go
51 21 1
func()
in pkg/cfn/cfn.go
49 11 1
func()
in pkg/ec2helper/ec2helper.go
47 4 1
func AskConfirmationWithTemplate()
in pkg/question/question.go
46 8 2
func()
in pkg/ec2helper/ec2helper.go
43 10 1
func AppendInstances()
in pkg/table/table.go
41 11 4
func OverrideConfigWithFlags()
in pkg/config/config.go
41 14 2
func AskInstanceTypeInstanceSelector()
in pkg/question/question.go
41 6 4
39 10 3
func AskInstanceIds()
in pkg/question/question.go
38 8 2
func AskRegion()
in pkg/question/question.go
37 6 1
func AskVpc()
in pkg/question/question.go
36 6 1