aws-samples / aws-iot-chat-example
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
  • 10% duplication:
    • 2,671 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 271 duplicated lines
  • 24 duplicates
system10% (271 lines)
Duplication per Extension
js10% (245 lines)
yml7% (26 lines)
Duplication per Component (primary)
client/src/components9% (74 lines)
api/src/user57% (45 lines)
client/src/reducers12% (39 lines)
api/src/policy45% (27 lines)
api7% (26 lines)
client/src/lib3% (24 lines)
api/src/chat37% (21 lines)
client/src/actions5% (15 lines)
api/src/helpers0% (0 lines)
client/src/store0% (0 lines)
client/src/config0% (0 lines)
client/src0% (0 lines)
client/public0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 24 duplicates...
Size#FoldersFilesLinesCode
15 x 2 client/src/components/Auth
client/src/components/Auth
Login.js
Register.js
80:94 (15%)
61:75 (17%)
view
12 x 2 api/src/user
api/src/user
get.js
getMe.js
28:42 (63%)
24:38 (66%)
view
10 x 2 api
api
serverless.yml
serverless.yml
199:208 (2%)
224:233 (2%)
view
10 x 2 client/src/components/Auth
client/src/components/Auth
Login.js
Register.js
100:109 (10%)
83:92 (11%)
view
9 x 2 api/src/policy
api/src/policy
attachConnect.js
attachPublicSubscribe.js
22:32 (90%)
22:32 (90%)
view
9 x 2 api/src/policy
api/src/policy
attachPublicReceive.js
attachPublicSubscribe.js
22:32 (90%)
22:32 (90%)
view
9 x 2 api/src/policy
api/src/policy
attachConnect.js
attachPublicReceive.js
22:32 (90%)
22:32 (90%)
view
8 x 2 api/src/chat
api/src/user
list.js
list.js
20:29 (72%)
20:29 (72%)
view
8 x 2 client/src/actions
client/src/reducers
authActions.js
authReducer.js
21:28 (7%)
15:22 (9%)
view
7 x 2 api/src/chat
api/src/user
create.js
create.js
66:73 (15%)
39:46 (26%)
view
7 x 2 client/src/actions
client/src/reducers
chatActions.js
chatReducer.js
17:23 (14%)
15:21 (7%)
view
6 x 2 api
api
serverless.yml
serverless.yml
224:229 (1%)
302:307 (1%)
view
6 x 2 client/src/components/Auth
client/src/components/Routers
Login.js
RootRouter.js
59:67 (6%)
37:45 (19%)
view
6 x 2 client/src/lib
client/src/lib
api-gateway.js
api-gateway.js
92:98 (5%)
104:110 (5%)
view
6 x 2 client/src/lib
client/src/lib
api-gateway.js
api-gateway.js
68:74 (5%)
80:86 (5%)
view
6 x 2 client/src/reducers
client/src/reducers
roomReducer.js
roomsReducer.js
21:27 (40%)
23:29 (33%)
view
6 x 2 client/src/reducers
client/src/reducers
authReducer.js
authReducer.js
42:47 (7%)
73:78 (7%)
view
6 x 2 client/src/components/Chat
client/src/components/Chat
Chat.js
RoomMenu.js
84:89 (10%)
42:47 (23%)
view
6 x 2 client/src/lib
client/src/lib
api-gateway.js
api-gateway.js
68:74 (5%)
92:98 (5%)
view
6 x 2 client/src/lib
client/src/lib
api-gateway.js
api-gateway.js
68:74 (5%)
104:110 (5%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
6 x 3 client/src/components/Auth
client/src/components/Routers
client/src/components
Login.js
RootRouter.js
App.js
59:65 
37:43 
82:88 
view