aws-samples / aws-saas-factory-bootcamp
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
  • 45% duplication:
    • 10,794 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 4,883 duplicated lines
  • 1,731 duplicates
system45% (4,883 lines)
Duplication per Extension
yml56% (2,959 lines)
js38% (1,840 lines)
css49% (42 lines)
scss63% (42 lines)
Duplication per Component (primary)
resources56% (2,959 lines)
source/user-manager25% (348 lines)
source/web-client14% (292 lines)
Lab3/Part1100% (161 lines)
Lab2/Part3100% (161 lines)
Lab3/Part4100% (161 lines)
Lab3/Part5100% (161 lines)
Lab2/Part296% (151 lines)
Lab2/Part1100% (147 lines)
source/product-manager100% (147 lines)
source/shared-modules26% (136 lines)
source/order-manager15% (24 lines)
source/tenant-registration14% (21 lines)
source/auth-manager10% (8 lines)
source/tenant-manager4% (6 lines)

Duplication Between Components (50+ lines)

G Lab2/Part3 Lab2/Part3 Lab3/Part1 Lab3/Part1 Lab2/Part3--Lab3/Part1 322 Lab3/Part4 Lab3/Part4 Lab2/Part3--Lab3/Part4 280 Lab3/Part5 Lab3/Part5 Lab2/Part3--Lab3/Part5 280 source/product-manager source/product-manager Lab2/Part3--source/product-manager 268 Lab3/Part1--Lab3/Part4 280 Lab3/Part1--Lab3/Part5 280 Lab3/Part1--source/product-manager 268 Lab3/Part4--Lab3/Part5 322 Lab3/Part4--source/product-manager 218 Lab3/Part5--source/product-manager 218 Lab2/Part2 Lab2/Part2 Lab2/Part2--Lab2/Part3 302 Lab2/Part2--Lab3/Part1 302 Lab2/Part2--Lab3/Part4 242 Lab2/Part2--Lab3/Part5 242 Lab2/Part2--source/product-manager 278 Lab2/Part1 Lab2/Part1 Lab2/Part1--Lab2/Part3 268 Lab2/Part1--Lab3/Part1 268 Lab2/Part1--Lab3/Part4 218 Lab2/Part1--Lab3/Part5 218 Lab2/Part1--Lab2/Part2 278 Lab2/Part1--source/product-manager 294

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 1,731 duplicates...
Size#FoldersFilesLinesCode
161 x 2 Lab2/Part3/product-manager
Lab3/Part1/product-manager
server.js
server.js
1:200 (100%)
1:201 (100%)
view
161 x 2 Lab3/Part4/product-manager
Lab3/Part5/product-manager
server.js
server.js
1:200 (100%)
1:201 (100%)
view
147 x 2 Lab2/Part1/product-manager
source/product-manager
server.js
server.js
1:184 (100%)
1:184 (100%)
view
50 x 2 resources
resources
auth-service.yml
product-service.yml
4:53 (14%)
4:53 (12%)
view
50 x 2 resources
resources
product-service.yml
registration-service.yml
4:53 (12%)
4:53 (14%)
view
50 x 2 resources
resources
auth-service.yml
registration-service.yml
4:53 (14%)
4:53 (14%)
view
47 x 2 resources
resources
auth-service.yml
tenant-service.yml
4:50 (13%)
4:50 (12%)
view
47 x 2 resources
resources
order-service.yml
product-service.yml
4:50 (12%)
4:50 (12%)
view
47 x 2 resources
resources
registration-service.yml
tenant-service.yml
4:50 (13%)
4:50 (12%)
view
47 x 2 resources
resources
order-service.yml
registration-service.yml
4:50 (12%)
4:50 (13%)
view
47 x 2 resources
resources
order-service.yml
user-service.yml
4:50 (12%)
4:50 (11%)
view
47 x 2 resources
resources
tenant-service.yml
user-service.yml
4:50 (12%)
4:50 (11%)
view
47 x 2 resources
resources
order-service.yml
tenant-service.yml
4:50 (12%)
4:50 (12%)
view
47 x 2 resources
resources
registration-service.yml
user-service.yml
4:50 (13%)
4:50 (11%)
view
47 x 2 resources
resources
product-service.yml
tenant-service.yml
4:50 (12%)
4:50 (12%)
view
47 x 2 resources
resources
auth-service.yml
user-service.yml
4:50 (13%)
4:50 (11%)
view
47 x 2 resources
resources
auth-service.yml
order-service.yml
4:50 (13%)
4:50 (12%)
view
47 x 2 resources
resources
product-service.yml
user-service.yml
4:50 (12%)
4:50 (11%)
view
44 x 2 Lab2/Part1/product-manager
Lab3/Part1/product-manager
server.js
server.js
116:163 (29%)
132:179 (27%)
view
44 x 2 Lab2/Part3/product-manager
source/product-manager
server.js
server.js
131:178 (27%)
116:163 (29%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
20 x 2 source/shared-modules/token-manager
source/shared-modules/token-manager
token-manager.js
token-manager.js
296:318 
421:442 
view
9 x 2 source/web-client/app/scripts/controllers
source/web-client/app/scripts/controllers
user-enable.js
user-enable.js
33:42 
44:53 
view
8 x 2 source/shared-modules/token-manager
source/shared-modules/token-manager
token-manager.js
token-manager.js
123:131 
154:162 
view
6 x 2 source/user-manager
source/user-manager
server.js
server.js
215:221 
241:247 
view
6 x 2 source/user-manager
source/user-manager
server.js
server.js
255:261 
269:275 
view