aws / amazon-ec2-instance-selector
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 137 units with 2,534 lines of code in units (84.7% of code).
    • 4 very long units (590 lines of code)
    • 5 long units (308 lines of code)
    • 21 medium size units (693 lines of code)
    • 39 small units (570 lines of code)
    • 68 very small units (373 lines of code)
23% | 12% | 27% | 22% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go23% | 12% | 27% | 22% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/selector40% | 5% | 22% | 11% | 19%
cmd67% | 0% | 24% | 8% | 0%
pkg/selector/outputs0% | 32% | 37% | 9% | 19%
pkg/ec2pricing0% | 22% | 59% | 11% | 5%
pkg/cli0% | 8% | 22% | 57% | 11%
pkg/bytequantity0% | 62% | 0% | 0% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/selector/emr.go
206 1 1
func main()
in cmd/main.go
163 19 0
func()
in pkg/selector/selector.go
111 32 1
func()
in pkg/selector/selector.go
110 27 1
func TableOutputWide()
in pkg/selector/outputs/outputs.go
82 11 1
func()
in pkg/selector/emr.go
58 20 1
func()
in pkg/ec2pricing/ec2pricing.go
57 11 1
func()
in pkg/cli/cli.go
57 18 1
func ParseToByteQuantity()
in pkg/bytequantity/bytequantity.go
54 15 1
func()
in pkg/selector/aggregates.go
47 14 1
func()
in pkg/cli/cli.go
44 16 1
func parseOndemandUnitPrice()
in pkg/ec2pricing/ec2pricing.go
42 11 1
func()
in pkg/selector/selector.go
41 9 1
func TerraformSpotMixedInstancesPolicyHCLOutput()
in pkg/selector/outputs/outputs.go
39 2 1
func()
in pkg/cli/flags.go
39 8 1
func()
in pkg/ec2pricing/ec2pricing.go
38 6 1
func()
in pkg/selector/eks.go
38 10 1
func()
in pkg/ec2pricing/ec2pricing.go
37 5 1
37 11 2
func()
in pkg/ec2pricing/ec2pricing.go
34 4 1