awslabs / amazon-ecs-for-open-application-model
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 167 units with 1,619 lines of code in units (62.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (62 lines of code)
    • 16 medium size units (443 lines of code)
    • 36 small units (530 lines of code)
    • 114 very small units (584 lines of code)
0% | 3% | 27% | 32% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 3% | 27% | 32% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
internal/pkg/workload0% | 100% | 0% | 0% | 0%
internal/pkg/deploy0% | 0% | 26% | 41% | 31%
internal/pkg/cli0% | 0% | 42% | 38% | 18%
internal/pkg/term0% | 0% | 20% | 7% | 71%
cmd/oam-ecs0% | 0% | 0% | 65% | 34%
internal/pkg/aws0% | 0% | 0% | 35% | 64%
templates0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func NewOamWorkload()
in internal/pkg/workload/workload.go
62 13 1
func HumanizeResourceEvents()
in internal/pkg/term/progress/deploy/cloudformation/deploy.go
43 14 4
func()
in internal/pkg/deploy/cloudformation/component.go
32 8 1
func()
in internal/pkg/deploy/cloudformation/env.go
32 8 1
func()
in internal/pkg/deploy/cloudformation/component.go
30 7 1
func()
in internal/pkg/deploy/cloudformation/env.go
30 7 1
func()
in internal/pkg/cli/app_deploy.go
28 7 1
func()
in internal/pkg/deploy/cloudformation/cloudformation.go
27 6 1
func()
in internal/pkg/deploy/cloudformation/changeset.go
26 4 1
func BuildDeployAppCmd()
in internal/pkg/cli/app_deploy.go
26 4 0
func()
in internal/pkg/term/progress/spinner.go
26 5 1
func BuildDeleteAppCmd()
in internal/pkg/cli/app_delete.go
25 3 0
func BuildShowAppCmd()
in internal/pkg/cli/app_show.go
25 3 0
func BuildDeployEnvironmentCmd()
in internal/pkg/cli/env_deploy.go
24 3 0
func()
in internal/pkg/deploy/cloudformation/changeset.go
23 6 1
func BuildShowEnvironmentCmd()
in internal/pkg/cli/env_show.go
23 2 0
func BuildDeleteEnvironmentCmd()
in internal/pkg/cli/env_delete.go
23 3 0
func()
in internal/pkg/deploy/cloudformation/cloudformation.go
20 6 1
func getValidFargateTaskSizes()
in internal/pkg/deploy/cloudformation/stack/template_functions.go
20 5 0
func createChangeSetInput()
in internal/pkg/deploy/cloudformation/changeset.go
19 3 3