aws / copilot-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 3,907 units with 41,588 lines of code in units (68.7% of code).
    • 5 very long units (700 lines of code)
    • 44 long units (2,889 lines of code)
    • 453 medium size units (13,560 lines of code)
    • 707 small units (10,206 lines of code)
    • 2,698 very small units (14,233 lines of code)
1% | 6% | 32% | 24% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go1% | 7% | 31% | 24% | 35%
js0% | 0% | 61% | 20% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
internal/pkg/cli3% | 8% | 33% | 22% | 31%
internal/pkg/deploy2% | 13% | 33% | 20% | 29%
internal/pkg/describe0% | 13% | 32% | 19% | 33%
internal/pkg/term0% | 9% | 25% | 21% | 43%
internal/pkg/manifest0% | 5% | 20% | 41% | 31%
internal/pkg/aws0% | 1% | 26% | 28% | 44%
internal/pkg/stream0% | 18% | 26% | 17% | 37%
cf-custom-resources/lib0% | 0% | 61% | 20% | 17%
internal/pkg/addon0% | 0% | 48% | 24% | 27%
internal/pkg/docker0% | 0% | 50% | 17% | 31%
internal/pkg/ecs0% | 0% | 26% | 25% | 47%
internal/pkg/config0% | 0% | 37% | 35% | 26%
internal/pkg/template0% | 0% | 25% | 41% | 33%
internal/pkg/initialize0% | 0% | 30% | 26% | 43%
internal/pkg/logging0% | 0% | 50% | 16% | 32%
internal/pkg/workspace0% | 0% | 29% | 34% | 35%
internal/pkg/task0% | 0% | 34% | 16% | 48%
internal/pkg/exec0% | 0% | 17% | 22% | 59%
cmd/copilot0% | 0% | 68% | 23% | 8%
internal/pkg/repository0% | 0% | 18% | 18% | 63%
internal/pkg/graph0% | 0% | 42% | 34% | 24%
internal/pkg/apprunner0% | 0% | 0% | 33% | 66%
cmd/copilot/template0% | 0% | 0% | 21% | 78%
internal/pkg/ini0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func newInitOpts()
in internal/pkg/cli/init.go
179 10 1
func newPackageSvcOpts()
in internal/pkg/cli/svc_package.go
174 33 1
func()
in internal/pkg/cli/svc_deploy.go
119 27 1
func()
in internal/pkg/deploy/cloudformation/stack/lb_web_svc.go
114 20 1
func BuildTaskRunCmd()
in internal/pkg/cli/task_run.go
114 5 0
func()
in internal/pkg/cli/deploy/deploy.go
96 21 1
func()
in internal/pkg/deploy/cloudformation/stack/worker_svc.go
90 16 1
func()
in internal/pkg/term/selector/selector.go
89 22 1
func()
in internal/pkg/describe/lb_web_service.go
84 13 1
func newDeleteAppOpts()
in internal/pkg/cli/app_delete.go
83 9 1
func init()
in internal/pkg/term/prompt/prompt.go
83 29 0
func()
in internal/pkg/describe/backend_service.go
82 14 1
func buildEnvInitCmd()
in internal/pkg/cli/env_init.go
82 2 0
func()
in internal/pkg/deploy/cloudformation/stack/backend_svc.go
80 14 1
func()
in internal/pkg/deploy/cloudformation/stack/transformers.go
78 15 1
func()
in internal/pkg/deploy/cloudformation/stack/workload.go
75 13 1
func()
in internal/pkg/cli/env_init.go
74 16 1
func()
in internal/pkg/cli/svc_package.go
74 16 1
func PipelineSourceFromManifest()
in internal/pkg/deploy/pipeline.go
71 12 1
func()
in internal/pkg/cli/task_run.go
69 27 1