aws-samples / aws-serverless-security-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
  • 10% duplication:
    • 1,028 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 108 duplicated lines
  • 21 duplicates
system10% (108 lines)
Duplication per Extension
yaml34% (81 lines)
js4% (27 lines)
Duplication per Component (primary)
src34% (81 lines)
src/app8% (27 lines)
src/init0% (0 lines)
src/authorizer0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 21 duplicates...
Size#FoldersFilesLinesCode
10 x 2 src
src
template.yaml
template.yaml
85:100 (4%)
135:150 (4%)
view
7 x 2 src
src
template.yaml
template.yaml
194:202 (2%)
224:232 (2%)
view
7 x 2 src
src
template.yaml
template.yaml
60:66 (2%)
94:100 (2%)
view
7 x 2 src/app
src/app
customizeUnicorn.js
customizeUnicorn.js
59:65 (8%)
102:108 (8%)
view
7 x 2 src
src
template.yaml
template.yaml
194:202 (2%)
204:212 (2%)
view
7 x 2 src
src
template.yaml
template.yaml
234:242 (2%)
253:261 (2%)
view
7 x 2 src
src
template.yaml
template.yaml
60:66 (2%)
144:150 (2%)
view
7 x 2 src
src
template.yaml
template.yaml
204:212 (2%)
224:232 (2%)
view
7 x 2 src/app
src/app
customizeUnicorn.js
customizeUnicorn.js
59:65 (8%)
91:97 (8%)
view
7 x 2 src/app
src/app
customizeUnicorn.js
customizeUnicorn.js
91:97 (8%)
102:108 (8%)
view
7 x 2 src
src
template.yaml
template.yaml
214:222 (2%)
224:232 (2%)
view
7 x 2 src
src
template.yaml
template.yaml
194:202 (2%)
214:222 (2%)
view
7 x 2 src
src
template.yaml
template.yaml
204:212 (2%)
214:222 (2%)
view
6 x 2 src
src
template.yaml
template.yaml
237:242 (2%)
265:270 (2%)
view
6 x 2 src
src
template.yaml
template.yaml
237:242 (2%)
246:251 (2%)
view
6 x 2 src
src
template.yaml
template.yaml
246:251 (2%)
265:270 (2%)
view
6 x 2 src/app
src/app
customizeUnicorn.js
customizeUnicorn.js
41:48 (7%)
60:65 (7%)
view
6 x 2 src/app
src/app
customizeUnicorn.js
customizeUnicorn.js
41:48 (7%)
92:97 (7%)
view
6 x 2 src
src
template.yaml
template.yaml
256:261 (2%)
265:270 (2%)
view
6 x 2 src
src
template.yaml
template.yaml
246:251 (2%)
256:261 (2%)
view