aws-samples / aws-serverless-saas-layers
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:
    • 5,787 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 5,729 duplicated lines
  • 2,264 duplicates
system98% (5,729 lines)
Duplication per Extension
yaml99% (2,506 lines)
js98% (2,473 lines)
py98% (750 lines)
Duplication per Component (primary)
Solution/Lab497% (844 lines)
Lab4/server100% (750 lines)
Solution/Lab399% (717 lines)
Lab1/server99% (630 lines)
Lab3/server100% (589 lines)
Solution/Lab199% (589 lines)
Solution/Lab298% (582 lines)
Lab2/server97% (446 lines)
Cloud9Setup99% (212 lines)
Lab4/client98% (95 lines)
Lab3/client98% (95 lines)
Lab1/client98% (90 lines)
Lab2/client98% (90 lines)

Duplication Between Components (50+ lines)

G Lab4/server Lab4/server Solution/Lab4 Solution/Lab4 Lab4/server--Solution/Lab4 1311 Solution/Lab3 Solution/Lab3 Lab4/server--Solution/Lab3 1246 Solution/Lab1 Solution/Lab1 Lab4/server--Solution/Lab1 812 Solution/Lab2 Solution/Lab2 Lab4/server--Solution/Lab2 849 Solution/Lab3--Solution/Lab4 1247 Lab3/server Lab3/server Lab3/server--Lab4/server 1160 Lab3/server--Solution/Lab4 962 Lab3/server--Solution/Lab3 1158 Lab3/server--Solution/Lab1 750 Lab3/server--Solution/Lab2 919 Lab1/server Lab1/server Lab1/server--Lab4/server 884 Lab1/server--Solution/Lab4 706 Lab1/server--Solution/Lab3 800 Lab1/server--Lab3/server 836 Lab1/server--Solution/Lab1 1082 Lab1/server--Solution/Lab2 694 Lab2/server Lab2/server Lab1/server--Lab2/server 717 Solution/Lab1--Solution/Lab4 824 Solution/Lab1--Solution/Lab3 904 Solution/Lab1--Solution/Lab2 798 Solution/Lab2--Solution/Lab4 969 Solution/Lab2--Solution/Lab3 1037 Lab2/server--Lab4/server 745 Lab2/server--Solution/Lab4 675 Lab2/server--Solution/Lab3 759 Lab2/server--Lab3/server 831 Lab2/server--Solution/Lab1 630 Lab2/server--Solution/Lab2 886 Lab3/client Lab3/client Lab3/client--Solution/Lab4 190 Lab3/client--Solution/Lab3 190 Lab3/client--Solution/Lab1 190 Lab3/client--Solution/Lab2 190 Lab4/client Lab4/client Lab3/client--Lab4/client 190 Lab4/client--Solution/Lab4 190 Lab4/client--Solution/Lab3 190 Lab4/client--Solution/Lab1 190 Lab4/client--Solution/Lab2 190 Lab1/client Lab1/client Lab1/client--Solution/Lab4 172 Lab1/client--Solution/Lab3 172 Lab1/client--Solution/Lab1 172 Lab1/client--Solution/Lab2 172 Lab1/client--Lab3/client 172 Lab1/client--Lab4/client 172 Lab2/client Lab2/client Lab1/client--Lab2/client 180 Lab2/client--Solution/Lab4 172 Lab2/client--Solution/Lab3 172 Lab2/client--Solution/Lab1 172 Lab2/client--Solution/Lab2 172 Lab2/client--Lab3/client 172 Lab2/client--Lab4/client 172

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 2,264 duplicates...
Size#FoldersFilesLinesCode
186 x 2 Lab3/server
Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:194 (100%)
1:194 (100%)
view
186 x 2 Lab4/server
Solution/Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:194 (100%)
1:194 (100%)
view
186 x 2 Lab3/server
Solution/Lab3/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:194 (100%)
1:194 (100%)
view
186 x 2 Lab3/server
Solution/Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:194 (100%)
1:194 (100%)
view
186 x 2 Solution/Lab3/server
Solution/Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:194 (100%)
1:194 (100%)
view
186 x 2 Lab4/server
Solution/Lab3/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:194 (100%)
1:194 (100%)
view
140 x 2 Lab4/server
Solution/Lab4/server
saas-sam-stack.yaml
saas-sam-stack.yaml
1:140 (100%)
1:140 (100%)
view
140 x 2 Lab3/server
Solution/Lab3/server
saas-sam-stack.yaml
saas-sam-stack.yaml
1:140 (100%)
1:140 (100%)
view
128 x 2 Lab4/server/layers/nodejs
Solution/Lab4/server/layers/nodejs
partition-manager.js
partition-manager.js
4:170 (100%)
4:170 (100%)
view
106 x 2 Cloud9Setup
Cloud9Setup
saas-cfn-cloud9-stack-eventengine.yaml
saas-cfn-cloud9-stack.yaml
1:116 (99%)
1:116 (100%)
view
98 x 2 Lab2/server
Solution/Lab2/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:103 (100%)
1:103 (100%)
view
94 x 2 Lab1/server
Solution/Lab1/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
1:99 (100%)
1:99 (100%)
view
90 x 2 Solution/Lab2/server
Solution/Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
10:103 (91%)
21:114 (48%)
view
90 x 2 Lab2/server
Solution/Lab3/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
10:103 (91%)
21:114 (48%)
view
90 x 2 Lab2/server
Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
10:103 (91%)
21:114 (48%)
view
90 x 2 Solution/Lab2/server
Solution/Lab3/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
10:103 (91%)
21:114 (48%)
view
90 x 2 Lab3/server
Solution/Lab2/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
21:114 (48%)
10:103 (91%)
view
90 x 2 Lab4/server
Solution/Lab2/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
21:114 (48%)
10:103 (91%)
view
90 x 2 Lab2/server
Solution/Lab4/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
10:103 (91%)
21:114 (48%)
view
90 x 2 Lab2/server
Lab3/server
saas-cfn-stack.yaml
saas-cfn-stack.yaml
10:103 (91%)
21:114 (48%)
view
Duplicated Units
The list of top 19 duplicated units.
See data for all 19 unit duplicates...
Size#FoldersFilesLinesCode
48 x 2 Solution/Lab4/server/layers/nodejs
Lab4/server/layers/nodejs
partition-manager.js
partition-manager.js
69:118 
69:118 
view
48 x 2 Solution/Lab4/server/layers/nodejs
Lab4/server/layers/nodejs
partition-manager.js
partition-manager.js
122:171 
122:171 
view
28 x 2 Solution/Lab1/server/order-manager/Utils
Lab1/server/order-manager/Utils
helper.js
helper.js
12:41 
12:41 
view
28 x 8 Solution/Lab1/server/product-manager/Utils
Solution/Lab3/server/layers/nodejs
Solution/Lab2/server/layers/nodejs
Solution/Lab4/server/layers/nodejs
Lab1/server/product-manager/Utils
Lab3/server/layers/nodejs
Lab2/server/layers/nodejs
Lab4/server/layers/nodejs
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
12:41 
12:41 
12:41 
12:41 
12:41 
12:41 
12:41 
12:41 
view
19 x 2 Solution/Lab3/server/order-manager
Lab4/server/order-manager
order-manager-dal.js
order-manager-dal.js
32:54 
34:56 
view
19 x 2 Solution/Lab3/server/product-manager
Lab4/server/product-manager
product-manager-dal.js
product-manager-dal.js
32:55 
34:57 
view
16 x 2 Solution/Lab1/server/order-manager
Lab1/server/order-manager
order-manager-dal.js
order-manager-dal.js
31:50 
31:50 
view
16 x 2 Solution/Lab1/server/product-manager
Lab1/server/product-manager
product-manager-dal.js
product-manager-dal.js
31:50 
31:50 
view
16 x 2 Solution/Lab2/server/order-manager
Lab2/server/order-manager
order-manager-dal.js
order-manager-dal.js
31:50 
33:52 
view
16 x 2 Solution/Lab2/server/product-manager
Lab2/server/product-manager
product-manager-dal.js
product-manager-dal.js
31:51 
33:53 
view
11 x 8 Solution/Lab1/client
Solution/Lab3/client
Solution/Lab2/client
Solution/Lab4/client
Lab1/client
Lab3/client
Lab2/client
Lab4/client
product-simulator.py
product-simulator.py
product-simulator.py
product-simulator.py
product-simulator.py
product-simulator.py
product-simulator.py
product-simulator.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
11 x 8 Solution/Lab1/client
Solution/Lab3/client
Solution/Lab2/client
Solution/Lab4/client
Lab1/client
Lab3/client
Lab2/client
Lab4/client
order-simulator.py
order-simulator.py
order-simulator.py
order-simulator.py
order-simulator.py
order-simulator.py
order-simulator.py
order-simulator.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
11 x 5 Solution/Lab3/server/layers/nodejs
Solution/Lab2/server/layers/nodejs
Solution/Lab4/server/layers/nodejs
Lab3/server/layers/nodejs
Lab4/server/layers/nodejs
token-manager.js
token-manager.js
token-manager.js
token-manager.js
token-manager.js
11:23 
11:23 
11:23 
11:23 
11:23 
view
9 x 10 Solution/Lab1/server/order-manager/Utils
Solution/Lab1/server/product-manager/Utils
Solution/Lab3/server/layers/nodejs
Solution/Lab2/server/layers/nodejs
Solution/Lab4/server/layers/nodejs
Lab1/server/order-manager/Utils
Lab1/server/product-manager/Utils
Lab3/server/layers/nodejs
Lab2/server/layers/nodejs
Lab4/server/layers/nodejs
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
helper.js
43:53 
43:53 
43:53 
43:53 
43:53 
43:53 
43:53 
43:53 
43:53 
43:53 
view
8 x 5 Solution/Lab3/server/layers/nodejs
Solution/Lab2/server/layers/nodejs
Solution/Lab4/server/layers/nodejs
Lab3/server/layers/nodejs
Lab4/server/layers/nodejs
log-manager.js
log-manager.js
log-manager.js
log-manager.js
log-manager.js
9:23 
9:24 
9:23 
9:23 
9:23 
view
6 x 3 Solution/Lab1/server/order-manager/Utils
Lab1/server/order-manager/Utils
Lab2/server/layers/nodejs
log-manager.js
log-manager.js
log-manager.js
8:17 
8:17 
9:21 
view
6 x 2 Solution/Lab4/server/layers/nodejs
Lab4/server/layers/nodejs
partition-manager.js
partition-manager.js
58:65 
58:65 
view
19 x 2 Solution/Lab4/server/layers/nodejs
Lab4/server/layers/nodejs
partition-manager.js
partition-manager.js
33:55 
33:55 
view
15 x 2 Solution/Lab4/server/layers/nodejs
Lab4/server/layers/nodejs
partition-manager.js
partition-manager.js
38:54 
38:54 
view