awslabs / aws-streaming-media-analytics
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
  • 18% duplication:
    • 2,036 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 385 duplicated lines
  • 19 duplicates
system18% (385 lines)
Duplication per Extension
js17% (271 lines)
py64% (70 lines)
yaml29% (30 lines)
jsx10% (14 lines)
Duplication per Component (primary)
lambda-functions/add-partition-function48% (64 lines)
lambda-functions/recentvideoview-appsync-function88% (64 lines)
lambda-functions/activeuser-appsync-function94% (64 lines)
web/reactplayer4% (62 lines)
lambda-functions/totalvideoview-appsync-function80% (61 lines)
lambda-functions/cloudfront-logs-processor-function67% (35 lines)
lambda-functions/fastly-logs-processor-function62% (35 lines)
lambda-functions/deploy-function0% (0 lines)
cloudformation0% (0 lines)
cloudformation/modules0% (0 lines)

Duplication Between Components (50+ lines)

G lambda-functions/activeuser-appsync-function lambda-functions/activeuser-appsync-function lambda-functions/recentvideoview-appsync-function lambda-functions/recentvideoview-appsync-function lambda-functions/activeuser-appsync-function--lambda-functions/recentvideoview-appsync-function 128 lambda-functions/totalvideoview-appsync-function lambda-functions/totalvideoview-appsync-function lambda-functions/activeuser-appsync-function--lambda-functions/totalvideoview-appsync-function 122 lambda-functions/recentvideoview-appsync-function--lambda-functions/totalvideoview-appsync-function 122 lambda-functions/cloudfront-logs-processor-function lambda-functions/cloudfront-logs-processor-function lambda-functions/fastly-logs-processor-function lambda-functions/fastly-logs-processor-function lambda-functions/cloudfront-logs-processor-function--lambda-functions/fastly-logs-processor-function 70

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 19 longest duplicates.
See data for all 19 duplicates...
Size#FoldersFilesLinesCode
38 x 2 lambda-functions/activeuser-appsync-function
lambda-functions/recentvideoview-appsync-function
index.js
index.js
37:92 (65%)
41:98 (61%)
view
36 x 2 lambda-functions/recentvideoview-appsync-function
lambda-functions/totalvideoview-appsync-function
index.js
index.js
59:98 (58%)
60:100 (58%)
view
36 x 2 lambda-functions/activeuser-appsync-function
lambda-functions/totalvideoview-appsync-function
index.js
index.js
52:92 (62%)
60:100 (58%)
view
23 x 2 lambda-functions/add-partition-function
lambda-functions/add-partition-function
index.js
index.js
83:105 (17%)
116:138 (17%)
view
18 x 2 lambda-functions/add-partition-function
lambda-functions/add-partition-function
index.js
index.js
52:69 (13%)
121:138 (13%)
view
18 x 2 lambda-functions/add-partition-function
lambda-functions/add-partition-function
index.js
index.js
52:69 (13%)
88:105 (13%)
view
17 x 2 lambda-functions/cloudfr...logs-processor-function
lambda-functions/fastly-logs-processor-function
prep-data.py
prep-data.py
56:143 (32%)
60:84 (30%)
view
16 x 2 lambda-functions/activeuser-appsync-function
lambda-functions/recentvideoview-appsync-function
index.js
index.js
1:30 (27%)
1:30 (25%)
view
15 x 2 lambda-functions/activeuser-appsync-function
lambda-functions/totalvideoview-appsync-function
index.js
index.js
1:29 (25%)
1:29 (24%)
view
15 x 2 lambda-functions/recentvideoview-appsync-function
lambda-functions/totalvideoview-appsync-function
index.js
index.js
1:29 (24%)
1:29 (24%)
view
11 x 2 web/reactplayer/public/test-harness/js
web/reactplayer/src/sdk
aws-exports.js
aws-exports.js
4:15 (78%)
4:15 (73%)
view
11 x 2 lambda-functions/cloudfr...logs-processor-function
lambda-functions/fastly-logs-processor-function
prep-data.py
prep-data.py
25:38 (21%)
24:37 (19%)
view
10 x 2 lambda-functions/activeuser-appsync-function
lambda-functions/totalvideoview-appsync-function
template.yaml
template.yaml
1:11 (100%)
1:11 (71%)
view
10 x 2 lambda-functions/activeuser-appsync-function
lambda-functions/recentvideoview-appsync-function
template.yaml
template.yaml
1:11 (100%)
1:11 (100%)
view
10 x 2 lambda-functions/recentvideoview-appsync-function
lambda-functions/totalvideoview-appsync-function
template.yaml
template.yaml
1:11 (100%)
1:11 (71%)
view
7 x 2 web/reactplayer/src/Components
web/reactplayer/src/Components
MetricsCaptured.js
VideoJSPlayer.js
18:25 (25%)
151:158 (4%)
view
7 x 2 web/reactplayer/src/Components
web/reactplayer/src/Components
ActiveUser.jsx
GetVideo.jsx
49:55 (15%)
51:57 (14%)
view
7 x 2 lambda-functions/cloudfr...logs-processor-function
lambda-functions/fastly-logs-processor-function
prep-data.py
prep-data.py
12:23 (13%)
11:22 (12%)
view
6 x 2 web/reactplayer/src/sdk
web/reactplayer/src/sdk
QoSSDK.js
QoSSDK.js
99:104 (1%)
126:132 (1%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
7 x 2 web/reactplayer/src/Components
web/reactplayer/src/Components
MetricsCaptured.js
VideoJSPlayer.js
18:26 
151:159 
view