aws / copilot-cli
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 15% duplication:
    • 46,591 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,220 duplicated lines
  • 784 duplicates
system15% (7,220 lines)
Duplication per Extension
go9% (3,621 lines)
yml27% (1,474 lines)
js50% (1,395 lines)
html78% (730 lines)
Duplication per Component (primary)
internal/pkg/cli12% (1,931 lines)
internal/pkg/template24% (1,516 lines)
cf-custom-resources/lib50% (1,395 lines)
site/overrides/layouts84% (730 lines)
internal/pkg/deploy9% (378 lines)
internal/pkg/aws8% (376 lines)
internal/pkg/describe12% (333 lines)
internal/pkg/manifest4% (122 lines)
internal/pkg/initialize20% (85 lines)
internal/pkg/term3% (84 lines)
internal/pkg/ecs11% (78 lines)
internal/pkg/config8% (40 lines)
internal/pkg/exec15% (36 lines)
internal/pkg/task10% (32 lines)
internal/pkg/apprunner23% (26 lines)
internal/pkg/logging8% (20 lines)
internal/pkg/stream4% (12 lines)
cmd/copilot/template18% (12 lines)
internal/pkg/workspace2% (7 lines)
internal/pkg/docker1% (7 lines)
site/overrides/partials0% (0 lines)
site/content/stylesheets0% (0 lines)
ROOT0% (0 lines)
cf-custom-resources0% (0 lines)
internal/pkg/ini0% (0 lines)
internal/pkg/repository0% (0 lines)
internal/pkg/graph0% (0 lines)
internal/pkg/addon0% (0 lines)
internal/pkg/version0% (0 lines)
cmd/copilot0% (0 lines)

Duplication Between Components (50+ lines)

G internal/pkg/cli internal/pkg/cli internal/pkg/initialize internal/pkg/initialize internal/pkg/cli--internal/pkg/initialize 114 internal/pkg/describe internal/pkg/describe internal/pkg/cli--internal/pkg/describe 114 internal/pkg/term internal/pkg/term internal/pkg/cli--internal/pkg/term 98 internal/pkg/deploy internal/pkg/deploy internal/pkg/ecs internal/pkg/ecs internal/pkg/deploy--internal/pkg/ecs 80 internal/pkg/template internal/pkg/template internal/pkg/deploy--internal/pkg/template 64 internal/pkg/aws internal/pkg/aws internal/pkg/aws--internal/pkg/deploy 60 internal/pkg/aws--internal/pkg/ecs 60 internal/pkg/apprunner internal/pkg/apprunner internal/pkg/apprunner--internal/pkg/ecs 52 internal/pkg/apprunner--internal/pkg/aws 60

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 784 duplicates...
Size#FoldersFilesLinesCode
266 x 2 site/overrides/layouts
site/overrides/layouts
home.html
home.ja.html
2:310 (61%)
2:310 (61%)
view
109 x 2 cf-custom-resources/lib
cf-custom-resources/lib
nlb-cert-validator.js
nlb-custom-domain.js
20:168 (21%)
15:163 (32%)
view
68 x 2 cf-custom-resources/lib
cf-custom-resources/lib
nlb-cert-validator.js
nlb-custom-domain.js
678:767 (13%)
404:493 (20%)
view
60 x 2 internal/pkg/template/templates/addons/aurora
internal/pkg/template/templates/addons/aurora/rdws
cf.yml
cf.yml
97:156 (38%)
108:167 (35%)
view
48 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
svc_deploy.go
755:826 (8%)
790:861 (6%)
view
46 x 2 internal/pkg/template/te...kloads/services/backend
internal/pkg/template/te...rkloads/services/worker
cf.yml
cf.yml
59:104 (38%)
54:99 (41%)
view
44 x 2 cf-custom-resources/lib
cf-custom-resources/lib
desired-count-delegation.js
env-controller.js
21:68 (35%)
30:77 (16%)
view
44 x 2 cf-custom-resources/lib
cf-custom-resources/lib
custom-domain.js
desired-count-delegation.js
26:73 (14%)
21:68 (35%)
view
44 x 2 cf-custom-resources/lib
cf-custom-resources/lib
alb-rule-priority-generator.js
env-controller.js
26:73 (36%)
30:77 (16%)
view
44 x 2 cf-custom-resources/lib
cf-custom-resources/lib
custom-domain.js
env-controller.js
26:73 (14%)
30:77 (16%)
view
44 x 2 cf-custom-resources/lib
cf-custom-resources/lib
alb-rule-priority-generator.js
desired-count-delegation.js
26:73 (36%)
21:68 (35%)
view
44 x 2 cf-custom-resources/lib
cf-custom-resources/lib
alb-rule-priority-generator.js
custom-domain.js
26:73 (36%)
26:73 (14%)
view
40 x 2 cf-custom-resources/lib
cf-custom-resources/lib
alb-rule-priority-generator.js
dns-delegation.js
11:65 (33%)
8:62 (16%)
view
37 x 2 cf-custom-resources/lib
cf-custom-resources/lib
desired-count-delegation.js
dns-delegation.js
21:60 (29%)
23:62 (15%)
view
37 x 2 cf-custom-resources/lib
cf-custom-resources/lib
dns-delegation.js
env-controller.js
23:62 (15%)
30:69 (14%)
view
37 x 2 cf-custom-resources/lib
cf-custom-resources/lib
custom-domain.js
dns-delegation.js
26:65 (12%)
23:62 (15%)
view
37 x 2 internal/pkg/template/templates/addons/aurora
internal/pkg/template/templates/addons/aurora/rdws
cf.yml
cf.yml
11:48 (23%)
14:51 (22%)
view
34 x 2 internal/pkg/deploy/cloudformation/stack
internal/pkg/deploy/cloudformation/stack
backend_svc.go
lb_web_svc.go
71:116 (28%)
131:177 (14%)
view
33 x 2 cf-custom-resources/lib
cf-custom-resources/lib
custom-domain-app-runner.js
nlb-custom-domain.js
49:86 (12%)
124:162 (9%)
view
33 x 2 cf-custom-resources/lib
cf-custom-resources/lib
custom-domain-app-runner.js
nlb-cert-validator.js
49:86 (12%)
129:167 (6%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 141 unit duplicates...
Size#FoldersFilesLinesCode
45 x 2 cf-custom-resources/lib
cf-custom-resources/lib
nlb-custom-domain.js
nlb-cert-validator.js
110:158 
115:163 
view
44 x 4 cf-custom-resources/lib
cf-custom-resources/lib
cf-custom-resources/lib
cf-custom-resources/lib
alb-rule-priority-generator.js
env-controller.js
desired-count-delegation.js
custom-domain.js
26:73 
30:77 
21:68 
26:73 
view
43 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
svc_deploy.go
755:799 
790:834 
view
34 x 2 internal/pkg/cli
internal/pkg/cli
job_init.go
svc_init.go
319:353 
402:436 
view
30 x 2 internal/pkg/cli
internal/pkg/cli
job_deploy.go
svc_deploy.go
182:213 
432:463 
view
25 x 2 internal/pkg/cli
internal/pkg/cli
job_deploy.go
svc_deploy.go
426:451 
487:513 
view
24 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
svc_deploy.go
693:722 
864:893 
view
23 x 2 cf-custom-resources/lib
cf-custom-resources/lib
nlb-custom-domain.js
nlb-cert-validator.js
423:446 
697:720 
view
23 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
svc_deploy.go
579:602 
753:776 
view
19 x 2 internal/pkg/cli
internal/pkg/cli
job_deploy.go
svc_deploy.go
215:235 
465:485 
view
19 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
svc_deploy.go
801:827 
836:862 
view
16 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
validate.go
648:665 
743:760 
view
16 x 2 internal/pkg/cli
internal/pkg/cli
svc_delete.go
job_delete.go
236:252 
235:251 
view
15 x 2 internal/pkg/aws/ecs
internal/pkg/aws/ecs
ecs.go
ecs.go
99:114 
427:442 
view
15 x 2 internal/pkg/cli/deploy
internal/pkg/cli
deploy.go
svc_deploy.go
736:753 
907:924 
view
12 x 2 internal/pkg/cli
internal/pkg/cli
pipeline_show.go
pipeline_status.go
93:106 
89:101 
view
11 x 2 internal/pkg/cli
internal/pkg/cli
validate.go
validate.go
779:790 
792:803 
view
10 x 3 cf-custom-resources/lib
cf-custom-resources/lib
cf-custom-resources/lib
dns-cert-validator.js
custom-domain.js
dns-delegation.js
473:484 
308:319 
252:263 
view
10 x 2 cf-custom-resources/lib
cf-custom-resources/lib
nlb-custom-domain.js
nlb-cert-validator.js
95:117 
100:122 
view
10 x 2 cf-custom-resources/lib
cf-custom-resources/lib
nlb-custom-domain.js
nlb-cert-validator.js
411:421 
685:695 
view