aws-samples / cdk-microservices-labs
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
  • 95% duplication:
    • 25,020 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 23,775 duplicated lines
  • 295 duplicates
system95% (23,775 lines)
Duplication per Extension
css100% (21,216 lines)
py57% (1,145 lines)
js98% (774 lines)
html96% (606 lines)
graphql8% (18 lines)
tsx9% (16 lines)
Duplication per Component (primary)
4-serverless-cicd-stack/static-service-cicd99% (7,576 lines)
5-serverless-xray-stack/spring-petclinic-static99% (7,532 lines)
3-serverless-microservice-stack/spring-petclinic-static99% (7,532 lines)
4-serverless-cicd-stack/visit-service-cicd81% (233 lines)
4-serverless-cicd-stack/customer-service-cicd81% (233 lines)
4-serverless-cicd-stack/vet-service-cicd81% (233 lines)
6-serverless-graphql-stack/backend15% (94 lines)
5-serverless-xray-stack/custom-resource-code100% (94 lines)
3-serverless-microservice-stack/custom-resource-code100% (94 lines)
2-ecs-microservice-stack/ecs_microservice46% (43 lines)
3-serverless-microservice-stack/serverless33% (39 lines)
1-ecs-monolith-stack/ecs_monolith47% (29 lines)
5-serverless-xray-stack/fagate_serverless17% (27 lines)
6-serverless-graphql-stack9% (16 lines)
5-serverless-xray-stack0% (0 lines)
1-ecs-monolith-stack0% (0 lines)
3-serverless-microservice-stack0% (0 lines)
2-ecs-microservice-stack/work0% (0 lines)
2-ecs-microservice-stack0% (0 lines)

Duplication Between Components (50+ lines)

G 3-serverless-microservice-stack/spring-petclinic-static 3-serverless-microservice-stack/spring-petclinic-static 5-serverless-xray-stack/spring-petclinic-static 5-serverless-xray-stack/spring-petclinic-static 3-serverless-microservice-stack/spring-petclinic-static--5-serverless-xray-stack/spring-petclinic-static 15064 4-serverless-cicd-stack/static-service-cicd 4-serverless-cicd-stack/static-service-cicd 3-serverless-microservice-stack/spring-petclinic-static--4-serverless-cicd-stack/static-service-cicd 15064 4-serverless-cicd-stack/static-service-cicd--5-serverless-xray-stack/spring-petclinic-static 15064 4-serverless-cicd-stack/customer-service-cicd 4-serverless-cicd-stack/customer-service-cicd 4-serverless-cicd-stack/visit-service-cicd 4-serverless-cicd-stack/visit-service-cicd 4-serverless-cicd-stack/customer-service-cicd--4-serverless-cicd-stack/visit-service-cicd 466 4-serverless-cicd-stack/vet-service-cicd 4-serverless-cicd-stack/vet-service-cicd 4-serverless-cicd-stack/customer-service-cicd--4-serverless-cicd-stack/vet-service-cicd 466 6-serverless-graphql-stack/backend 6-serverless-graphql-stack/backend 4-serverless-cicd-stack/customer-service-cicd--6-serverless-graphql-stack/backend 98 4-serverless-cicd-stack/visit-service-cicd--6-serverless-graphql-stack/backend 98 4-serverless-cicd-stack/vet-service-cicd--4-serverless-cicd-stack/visit-service-cicd 466 4-serverless-cicd-stack/vet-service-cicd--6-serverless-graphql-stack/backend 98 3-serverless-microservice-stack/custom-resource-code 3-serverless-microservice-stack/custom-resource-code 5-serverless-xray-stack/custom-resource-code 5-serverless-xray-stack/custom-resource-code 3-serverless-microservice-stack/custom-resource-code--5-serverless-xray-stack/custom-resource-code 188 1-ecs-monolith-stack/ecs_monolith 1-ecs-monolith-stack/ecs_monolith 2-ecs-microservice-stack/ecs_microservice 2-ecs-microservice-stack/ecs_microservice 1-ecs-monolith-stack/ecs_monolith--2-ecs-microservice-stack/ecs_microservice 58

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 295 duplicates...
Size#FoldersFilesLinesCode
7072 x 2 3-serverless-microservic...ng-petclinic-static/css
5-serverless-xray-stack/...ng-petclinic-static/css
petclinic.css
petclinic.css
1:7072 (100%)
1:7072 (100%)
view
7072 x 2 4-serverless-cicd-stack/...icd/static-resource/css
5-serverless-xray-stack/...ng-petclinic-static/css
petclinic.css
petclinic.css
1:7072 (100%)
1:7072 (100%)
view
7072 x 2 3-serverless-microservic...ng-petclinic-static/css
4-serverless-cicd-stack/...icd/static-resource/css
petclinic.css
petclinic.css
1:7072 (100%)
1:7072 (100%)
view
94 x 2 3-serverless-microservic...ck/custom-resource-code
5-serverless-xray-stack/custom-resource-code
init.py
init.py
7:114 (100%)
7:114 (100%)
view
46 x 2 4-serverless-cicd-stack/...source/scripts/pet-form
5-serverless-xray-stack/...static/scripts/pet-form
pet-form.controller.js
pet-form.controller.js
1:58 (100%)
1:58 (100%)
view
46 x 2 3-serverless-microservic...static/scripts/pet-form
5-serverless-xray-stack/...static/scripts/pet-form
pet-form.controller.js
pet-form.controller.js
1:58 (100%)
1:58 (100%)
view
46 x 2 3-serverless-microservic...static/scripts/pet-form
4-serverless-cicd-stack/...source/scripts/pet-form
pet-form.controller.js
pet-form.controller.js
1:58 (100%)
1:58 (100%)
view
44 x 2 3-serverless-microservic...c/scripts/owner-details
4-serverless-cicd-stack/...e/scripts/owner-details
owner-details.template.html
owner-details.template.html
1:61 (100%)
1:61 (100%)
view
44 x 2 4-serverless-cicd-stack/...e/scripts/owner-details
5-serverless-xray-stack/...c/scripts/owner-details
owner-details.template.html
owner-details.template.html
1:61 (100%)
1:61 (100%)
view
44 x 2 3-serverless-microservic...c/scripts/owner-details
5-serverless-xray-stack/...c/scripts/owner-details
owner-details.template.html
owner-details.template.html
1:61 (100%)
1:61 (100%)
view
41 x 2 4-serverless-cicd-stack/...ce-cicd/static-resource
5-serverless-xray-stack/spring-petclinic-static
index.html
index.html
1:59 (100%)
1:59 (100%)
view
41 x 2 3-serverless-microservic...spring-petclinic-static
5-serverless-xray-stack/spring-petclinic-static
index.html
index.html
1:59 (100%)
1:59 (100%)
view
41 x 2 3-serverless-microservic...spring-petclinic-static
4-serverless-cicd-stack/...ce-cicd/static-resource
index.html
index.html
1:59 (100%)
1:59 (100%)
view
38 x 2 4-serverless-cicd-stack/...ce-cicd/serverless_cicd
4-serverless-cicd-stack/...ce-cicd/serverless_cicd
serverless_cicd_stack.py
serverless_cicd_stack.py
86:125 (30%)
86:125 (30%)
view
38 x 2 4-serverless-cicd-stack/...ce-cicd/serverless_cicd
4-serverless-cicd-stack/...ce-cicd/serverless_cicd
serverless_cicd_stack.py
serverless_cicd_stack.py
86:125 (30%)
86:125 (30%)
view
38 x 2 4-serverless-cicd-stack/...ce-cicd/serverless_cicd
4-serverless-cicd-stack/...ce-cicd/serverless_cicd
serverless_cicd_stack.py
serverless_cicd_stack.py
86:125 (30%)
86:125 (30%)
view
29 x 2 4-serverless-cicd-stack/customer-service-cicd
4-serverless-cicd-stack/vet-service-cicd
setup.py
setup.py
4:45 (100%)
4:45 (100%)
view
29 x 2 4-serverless-cicd-stack/vet-service-cicd
4-serverless-cicd-stack/visit-service-cicd
setup.py
setup.py
4:45 (100%)
4:45 (100%)
view
29 x 2 4-serverless-cicd-stack/customer-service-cicd
4-serverless-cicd-stack/visit-service-cicd
setup.py
setup.py
4:45 (100%)
4:45 (100%)
view
28 x 2 3-serverless-microservic...atic/scripts/owner-form
5-serverless-xray-stack/...atic/scripts/owner-form
owner-form.controller.js
owner-form.controller.js
1:35 (100%)
1:35 (100%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
70 x 2 5-serverless-xray-stack/custom-resource-code
3-serverless-microservic...ck/custom-resource-code
init.py
init.py
0:0 
0:0 
view
24 x 4 6-serverless-graphql-sta...nd/custom-resource-code
4-serverless-cicd-stack/...cd/custom-resource-code
4-serverless-cicd-stack/...cd/custom-resource-code
4-serverless-cicd-stack/...cd/custom-resource-code
cfnresponse.py
cfnresponse.py
cfnresponse.py
cfnresponse.py
0:0 
0:0 
0:0 
0:0 
view
21 x 3 4-serverless-cicd-stack/...source/scripts/pet-form
5-serverless-xray-stack/...static/scripts/pet-form
3-serverless-microservic...static/scripts/pet-form
pet-form.controller.js
pet-form.controller.js
pet-form.controller.js
33:57 
33:57 
33:57 
view
16 x 6 6-serverless-graphql-sta...nd/custom-resource-code
4-serverless-cicd-stack/...cd/custom-resource-code
4-serverless-cicd-stack/...cd/custom-resource-code
4-serverless-cicd-stack/...cd/custom-resource-code
5-serverless-xray-stack/custom-resource-code
3-serverless-microservic...ck/custom-resource-code
index.py
index.py
index.py
index.py
init.py
init.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
16 x 3 4-serverless-cicd-stack/...urce/scripts/owner-form
5-serverless-xray-stack/...atic/scripts/owner-form
3-serverless-microservic...atic/scripts/owner-form
owner-form.controller.js
owner-form.controller.js
owner-form.controller.js
17:34 
17:34 
17:34 
view
13 x 3 4-serverless-cicd-stack/...resource/scripts/visits
5-serverless-xray-stack/...c-static/scripts/visits
3-serverless-microservic...c-static/scripts/visits
visits.controller.js
visits.controller.js
visits.controller.js
15:29 
15:29 
15:29 
view