aws-samples / aws-serverless-saas-workshop
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
  • 98% duplication:
    • 85,748 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 84,359 duplicated lines
  • 77,479 duplicates
system98% (84,359 lines)
Duplication per Extension
yaml99% (33,512 lines)
ts96% (18,611 lines)
py99% (16,302 lines)
html99% (11,614 lines)
scss96% (3,982 lines)
toml94% (218 lines)
yml100% (96 lines)
js100% (24 lines)
Duplication per Component (primary)
Solution/Lab698% (9,705 lines)
Solution/Lab598% (9,240 lines)
Solution/Lab498% (7,934 lines)
Solution/Lab398% (7,685 lines)
Lab6/server99% (6,122 lines)
Lab5/server99% (5,637 lines)
Solution/Lab298% (4,565 lines)
Lab4/server100% (4,379 lines)
Lab3/server99% (4,125 lines)
Lab5/client97% (3,585 lines)
Lab6/client97% (3,585 lines)
Lab3/client97% (3,518 lines)
Lab4/client97% (3,518 lines)
Solution/Lab198% (3,076 lines)
Lab2/server99% (2,675 lines)
Lab2/client97% (1,836 lines)
Lab1/server99% (1,137 lines)
Lab1/event-engine-assets100% (1,027 lines)
Lab1/client95% (912 lines)
Cloud9Setup22% (98 lines)

Duplication Between Components (50+ lines)

G Solution/Lab5 Solution/Lab5 Solution/Lab6 Solution/Lab6 Solution/Lab5--Solution/Lab6 18412 Solution/Lab4 Solution/Lab4 Solution/Lab4--Solution/Lab5 15810 Solution/Lab4--Solution/Lab6 15781 Solution/Lab3 Solution/Lab3 Solution/Lab3--Solution/Lab5 15147 Solution/Lab3--Solution/Lab6 15123 Solution/Lab3--Solution/Lab4 15239 Lab6/server Lab6/server Lab6/server--Solution/Lab5 11261 Lab6/server--Solution/Lab6 12236 Lab6/server--Solution/Lab4 8838 Lab6/server--Solution/Lab3 8174 Lab5/server Lab5/server Lab5/server--Solution/Lab5 11266 Lab5/server--Solution/Lab6 11198 Lab5/server--Solution/Lab4 8867 Lab5/server--Solution/Lab3 8204 Lab5/server--Lab6/server 11225 Solution/Lab2 Solution/Lab2 Solution/Lab2--Solution/Lab5 9770 Solution/Lab2--Solution/Lab6 9769 Solution/Lab2--Solution/Lab4 9701 Solution/Lab2--Solution/Lab3 9754 Lab4/server Lab4/server Lab4/server--Solution/Lab5 8799 Lab4/server--Solution/Lab6 8777 Lab4/server--Solution/Lab4 8768 Lab4/server--Solution/Lab3 8194 Lab4/server--Lab6/server 8779 Lab4/server--Lab5/server 8807 Lab3/server Lab3/server Lab3/server--Solution/Lab5 8120 Lab3/server--Solution/Lab6 8098 Lab3/server--Solution/Lab4 8115 Lab3/server--Solution/Lab3 8246 Lab3/server--Lab6/server 8116 Lab3/server--Lab5/server 8144 Lab3/server--Lab4/server 8134 Lab5/client Lab5/client Lab5/client--Solution/Lab5 7170 Lab5/client--Solution/Lab6 7170 Lab5/client--Solution/Lab3 6943 Lab6/client Lab6/client Lab5/client--Lab6/client 7170 Lab6/client--Solution/Lab5 7170 Lab6/client--Solution/Lab6 7170 Lab6/client--Solution/Lab4 6943 Lab6/client--Solution/Lab3 6943 Lab4/client Lab4/client Lab4/client--Solution/Lab6 6943 Lab4/client--Solution/Lab4 7036 Lab4/client--Solution/Lab3 7036 Lab4/client--Lab5/client 6943 Lab4/client--Lab6/client 6943 Lab3/client Lab3/client Lab3/client--Solution/Lab5 6943 Lab3/client--Solution/Lab4 7036 Lab3/client--Solution/Lab3 7036 Lab3/client--Lab5/client 6943 Lab3/client--Lab4/client 7036

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 77,479 duplicates...
Size#FoldersFilesLinesCode
1107 x 2 Lab6/server/nested_templates
Solution/Lab6/server/nested_templates
apigateway.yaml
apigateway.yaml
4:1122 (100%)
4:1122 (100%)
view
1041 x 2 Lab6/server
Solution/Lab6/server
tenant-template.yaml
tenant-template.yaml
4:1069 (100%)
4:1069 (100%)
view
1027 x 2 Lab1/event-engine-assets
Solution/Lab1/event-engine-assets
packaged.yaml
packaged.yaml
1:1030 (100%)
1:1030 (100%)
view
928 x 2 Lab5/server
Solution/Lab5/server
tenant-template.yaml
tenant-template.yaml
4:955 (100%)
4:955 (100%)
view
928 x 2 Lab5/server/nested_templates
Solution/Lab5/server/nested_templates
apigateway.yaml
apigateway.yaml
4:941 (100%)
4:941 (100%)
view
890 x 2 Lab3/server
Solution/Lab3/server
tenant-template.yaml
tenant-template.yaml
4:920 (100%)
4:920 (100%)
view
861 x 2 Lab4/server
Solution/Lab4/server
tenant-template.yaml
tenant-template.yaml
4:889 (100%)
4:889 (100%)
view
859 x 2 Lab1/server
Solution/Lab1/server
template.yaml
template.yaml
4:886 (100%)
4:886 (100%)
view
749 x 2 Lab2/server/nested_templates
Solution/Lab2/server/nested_templates
apigateway.yaml
apigateway.yaml
4:762 (100%)
4:762 (100%)
view
745 x 2 Solution/Lab3/server/nested_templates
Solution/Lab4/server/nested_templates
apigateway.yaml
apigateway.yaml
4:758 (100%)
4:758 (100%)
view
745 x 2 Lab4/server/nested_templates
Solution/Lab3/server/nested_templates
apigateway.yaml
apigateway.yaml
4:758 (100%)
4:758 (100%)
view
745 x 2 Lab4/server/nested_templates
Solution/Lab4/server/nested_templates
apigateway.yaml
apigateway.yaml
4:758 (100%)
4:758 (100%)
view
745 x 2 Lab3/server/nested_templates
Lab4/server/nested_templates
apigateway.yaml
apigateway.yaml
4:758 (100%)
4:758 (100%)
view
745 x 2 Lab3/server/nested_templates
Solution/Lab3/server/nested_templates
apigateway.yaml
apigateway.yaml
4:758 (100%)
4:758 (100%)
view
745 x 2 Lab3/server/nested_templates
Solution/Lab4/server/nested_templates
apigateway.yaml
apigateway.yaml
4:758 (100%)
4:758 (100%)
view
721 x 2 Lab6/server/nested_templates
Solution/Lab6/server/nested_templates
lambdafunctions.yaml
lambdafunctions.yaml
4:757 (100%)
4:757 (100%)
view
702 x 2 Lab5/server/nested_templates
Solution/Lab5/server/nested_templates
lambdafunctions.yaml
lambdafunctions.yaml
4:738 (100%)
4:738 (100%)
view
587 x 2 Lab2/server/nested_templates
Solution/Lab3/server/nested_templates
apigateway.yaml
apigateway.yaml
4:597 (78%)
4:597 (78%)
view
587 x 2 Lab2/server/nested_templates
Solution/Lab4/server/nested_templates
apigateway.yaml
apigateway.yaml
4:597 (78%)
4:597 (78%)
view
587 x 2 Solution/Lab2/server/nested_templates
Solution/Lab3/server/nested_templates
apigateway.yaml
apigateway.yaml
4:597 (78%)
4:597 (78%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 191 unit duplicates...
Size#FoldersFilesLinesCode
87 x 6 Solution/Lab5/server/layers
Solution/Lab4/server/layers
Solution/Lab6/server/layers
Lab5/server/layers
Lab4/server/layers
Lab6/server/layers
auth_manager.py
auth_manager.py
auth_manager.py
auth_manager.py
auth_manager.py
auth_manager.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
77 x 4 Solution/Lab5/server/TenantPipeline/lib
Solution/Lab6/server/TenantPipeline/lib
Lab5/server/TenantPipeline/lib
Lab6/server/TenantPipeline/lib
serverless-saas-stack.ts
serverless-saas-stack.ts
serverless-saas-stack.ts
serverless-saas-stack.ts
19:123 
19:123 
19:123 
19:123 
view
87 x 2 Solution/Lab6/server/Resources
Lab6/server/Resources
shared_service_authorizer.py
shared_service_authorizer.py
0:0 
0:0 
view
83 x 2 Solution/Lab5/server/Resources
Lab5/server/Resources
shared_service_authorizer.py
shared_service_authorizer.py
0:0 
0:0 
view
80 x 2 Solution/Lab5/server/Resources
Lab5/server/Resources
tenant_authorizer.py
tenant_authorizer.py
0:0 
0:0 
view
77 x 2 Solution/Lab4/server/Resources
Lab4/server/Resources
shared_service_authorizer.py
shared_service_authorizer.py
0:0 
0:0 
view
58 x 2 Solution/Lab6/server/custom_resources
Lab6/server/custom_resources
update_usage_plan.py
update_usage_plan.py
0:0 
0:0 
view
47 x 4 Solution/Lab5/server/TenantManagementService
Solution/Lab6/server/TenantManagementService
Lab5/server/TenantManagementService
Lab6/server/TenantManagementService
user-management.py
user-management.py
user-management.py
user-management.py
0:0 
0:0 
0:0 
0:0 
view
46 x 6 Solution/Lab5/server/layers
Solution/Lab4/server/layers
Solution/Lab6/server/layers
Lab5/server/layers
Lab4/server/layers
Lab6/server/layers
auth_manager.py
auth_manager.py
auth_manager.py
auth_manager.py
auth_manager.py
auth_manager.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
44 x 4 Solution/Lab5/server/TenantManagementService
Solution/Lab6/server/TenantManagementService
Lab5/server/TenantManagementService
Lab6/server/TenantManagementService
user-management.py
user-management.py
user-management.py
user-management.py
0:0 
0:0 
0:0 
0:0 
view
41 x 4 Solution/Lab5/server/TenantManagementService
Solution/Lab6/server/TenantManagementService
Lab5/server/TenantManagementService
Lab6/server/TenantManagementService
tenant-management.py
tenant-management.py
tenant-management.py
tenant-management.py
0:0 
0:0 
0:0 
0:0 
view
41 x 4 Solution/Lab5/server/TenantManagementService
Solution/Lab6/server/TenantManagementService
Lab5/server/TenantManagementService
Lab6/server/TenantManagementService
user-management.py
user-management.py
user-management.py
user-management.py
0:0 
0:0 
0:0 
0:0 
view
40 x 4 Solution/Lab5/server/TenantManagementService
Solution/Lab6/server/TenantManagementService
Lab5/server/TenantManagementService
Lab6/server/TenantManagementService
tenant-management.py
tenant-management.py
tenant-management.py
tenant-management.py
0:0 
0:0 
0:0 
0:0 
view
39 x 2 Solution/Lab3/server/TenantManagementService
Lab3/server/TenantManagementService
user-management.py
user-management.py
0:0 
0:0 
view
39 x 2 Solution/Lab4/server/TenantManagementService
Lab4/server/TenantManagementService
user-management.py
user-management.py
0:0 
0:0 
view
38 x 2 Solution/Lab6/server/TenantManagementService
Lab6/server/TenantManagementService
tenant-management.py
tenant-management.py
0:0 
0:0 
view
36 x 3 Solution/Lab5/server/TenantManagementService
Solution/Lab6/server/TenantManagementService
Lab5/server/TenantManagementService
user-management.py
user-management.py
user-management.py
0:0 
0:0 
0:0 
view
41 x 2 Solution/Lab2/server/Resources
Lab2/server/Resources
shared_service_authorizer.py
shared_service_authorizer.py
0:0 
0:0 
view
35 x 4 Solution/Lab3/server/TenantManagementService
Solution/Lab4/server/TenantManagementService
Lab3/server/TenantManagementService
Lab4/server/TenantManagementService
user-management.py
user-management.py
user-management.py
user-management.py
0:0 
0:0 
0:0 
0:0 
view
34 x 2 Solution/Lab4/server/TenantManagementService
Lab4/server/TenantManagementService
user-management.py
user-management.py
0:0 
0:0 
view