microsoft / cobalt
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
  • 18% duplication:
    • 6,565 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,222 duplicated lines
  • 136 duplicates
system18% (1,222 lines)
Duplication per Extension
tf15% (745 lines)
yml35% (364 lines)
go12% (90 lines)
tfvars34% (23 lines)
Duplication per Component (primary)
infra/modules/providers11% (384 lines)
devops/providers/azure-devops35% (364 lines)
infra/templates/az-isolated-service-single-region29% (162 lines)
infra/templates/az-service-single-region28% (102 lines)
test-harness/terratest-extensions/modules13% (90 lines)
infra/templates/az-hello-world66% (84 lines)
infra/templates/gitlab-bootstrap-iac-cicd11% (36 lines)
devops/providers/gitlab0% (0 lines)
infra/templates/ado-bootstrap-iac-pipeline0% (0 lines)
infra/templates/backend-state-setup0% (0 lines)
test-harness0% (0 lines)

Duplication Between Components (50+ lines)

G infra/templates/az-hello-world infra/templates/az-hello-world infra/templates/az-service-single-region infra/templates/az-service-single-region infra/templates/az-hello-world--infra/templates/az-service-single-region 158 infra/templates/az-isolated-service-single-region infra/templates/az-isolated-service-single-region infra/templates/az-hello-world--infra/templates/az-isolated-service-single-region 114 infra/modules/providers infra/modules/providers infra/modules/providers--infra/templates/az-isolated-service-single-region 134 infra/templates/az-isolated-service-single-region--infra/templates/az-service-single-region 124

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 136 duplicates...
Size#FoldersFilesLinesCode
62 x 2 devops/providers/azure-devops/templates
devops/providers/azure-devops/templates
azure-pipeline-all-templates.yml
azure-pipelines.yml
10:76 (91%)
1:67 (100%)
view
44 x 2 infra/modules/providers/azure/service-plan
infra/templates/az-isolated-service-single-region
variables.tf
variables.tf
57:101 (42%)
104:149 (29%)
view
25 x 2 infra/templates/az-hello-world
infra/templates/az-service-single-region
commons.tf
commons.tf
1:30 (60%)
1:30 (58%)
view
23 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tf-apply.yml
tf-plan.yml
9:38 (57%)
10:39 (58%)
view
22 x 2 infra/templates/az-isolated-service-single-region
infra/templates/az-service-single-region
commons.tf
commons.tf
9:34 (34%)
5:30 (51%)
view
22 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tf-destroy.yml
tf-plan.yml
5:31 (61%)
10:37 (56%)
view
22 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tf-apply.yml
tf-destroy.yml
9:36 (55%)
5:31 (61%)
view
22 x 2 infra/templates/az-hello-world
infra/templates/az-isolated-service-single-region
commons.tf
commons.tf
5:30 (53%)
9:34 (34%)
view
21 x 2 infra/modules/providers/...lastic-cloud-enterprise
infra/modules/providers/.../elastic-search-service
variables.tf
variables.tf
1:22 (61%)
11:32 (23%)
view
19 x 2 infra/templates/az-hello-world
infra/templates/az-isolated-service-single-region
variables.tf
variables.tf
1:23 (57%)
1:23 (12%)
view
16 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
lint-tf.yml
tf-ws-create.yml
9:29 (61%)
10:29 (57%)
view
16 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tests-int.yml
tests-unit.yml
7:27 (69%)
7:27 (72%)
view
16 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tf-plan.yml
tf-ws-create.yml
19:39 (41%)
12:31 (57%)
view
16 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tf-apply.yml
tf-ws-create.yml
18:38 (40%)
12:31 (57%)
view
15 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
lint-tf.yml
tf-destroy.yml
11:29 (57%)
14:31 (41%)
view
15 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
tf-destroy.yml
tf-ws-create.yml
14:31 (41%)
12:29 (53%)
view
15 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
lint-tf.yml
tf-apply.yml
11:29 (57%)
18:36 (37%)
view
15 x 2 devops/providers/azure-d...es/infrastructure/tasks
devops/providers/azure-d...es/infrastructure/tasks
lint-tf.yml
tf-plan.yml
11:29 (57%)
19:37 (38%)
view
14 x 2 infra/templates/az-hello-world
infra/templates/az-service-single-region
variables.tf
variables.tf
1:17 (42%)
1:17 (11%)
view
14 x 2 infra/modules/providers/...cal-exec-capture-stdout
infra/modules/providers/...cal-exec-capture-stdout
main.tf
main.tf
18:42 (56%)
12:36 (70%)
view