aws-solutions / machine-downtime-monitor-on-aws
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
  • 4% duplication:
    • 4,522 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 226 duplicated lines
  • 16 duplicates
system4% (226 lines)
Duplication per Extension
ts4% (112 lines)
tsx4% (48 lines)
py11% (38 lines)
js72% (16 lines)
graphql10% (12 lines)
Duplication per Component (primary)
cdk-infrastructure/lib6% (90 lines)
web-ui/src3% (54 lines)
glue-job-scripts11% (38 lines)
lambda/solution-helper3% (24 lines)
cdk-infrastructure72% (8 lines)
lambda/filter-kinesis-stream1% (6 lines)
lambda/util4% (6 lines)
web-ui/public0% (0 lines)
lambda/data-sources0% (0 lines)
lambda/update-filter-function0% (0 lines)
Longest Duplicates
The list of 16 longest duplicates.
See data for all 16 duplicates...
Size#FoldersFilesLinesCode
11 x 2 source/cdk-infrastructure/lib/solution-helper
source/cdk-infrastructure/lib/solution-helper
solution-helper-construct.ts
solution-helper-construct.ts
43:57 (9%)
82:96 (9%)
view
10 x 2 source/cdk-infrastructur...b/front-end/appsync-api
source/cdk-infrastructure/lib/solution-helper
appsync-api-construct.ts
solution-helper-construct.ts
101:114 (6%)
43:56 (8%)
view
10 x 2 source/glue-job-scripts
source/glue-job-scripts
configuration.py
configuration.py
102:111 (5%)
117:126 (5%)
view
10 x 2 source/cdk-infrastructur...b/front-end/appsync-api
source/cdk-infrastructure/lib/solution-helper
appsync-api-construct.ts
solution-helper-construct.ts
101:114 (6%)
82:95 (8%)
view
9 x 2 source/glue-job-scripts
source/glue-job-scripts
configuration.py
configuration.py
142:150 (4%)
156:164 (4%)
view
8 x 2 source/cdk-infrastructure/lib/bi-reporting
source/cdk-infrastructure/lib/bi-reporting/etl
bi-reporting-construct.ts
etl-construct.ts
24:38 (11%)
28:42 (2%)
view
8 x 2 source/lambda/solution-helper
source/lambda/solution-helper
create-quicksight.ts
create-quicksight.ts
196:205 (3%)
210:219 (3%)
view
8 x 2 source/web-ui/src/graphql
source/web-ui/src/graphql
queries.tsx
subscriptions.tsx
8:16 (12%)
8:16 (53%)
view
8 x 2 source/cdk-infrastructur...b/front-end/appsync-api
source/cdk-infrastructur...b/front-end/appsync-api
appsync-api-construct.ts
appsync-api-construct.ts
32:39 (5%)
42:49 (5%)
view
8 x 2 source/cdk-infrastructure
source/lambda/solution-helper
jest.config.js
jest.config.js
1:8 (72%)
1:8 (72%)
view
7 x 2 source/web-ui/src/graphql
source/web-ui/src/graphql
mutations.tsx
queries.tsx
23:29 (19%)
26:32 (10%)
view
7 x 2 source/cdk-infrastructure/lib/bi-reporting/etl
source/cdk-infrastructure/lib/bi-reporting/etl
etl-construct.ts
etl-construct.ts
290:296 (1%)
360:366 (1%)
view
6 x 2 source/lambda/filter-kinesis-stream
source/web-ui/src/graphql
gql-mutations.ts
queries.tsx
6:12 (75%)
51:57 (9%)
view
6 x 2 source/web-ui/src/views/machines
source/web-ui/src/views/machines
MachineStatusCard.tsx
MachineStatusCard.tsx
308:313 (1%)
321:326 (1%)
view
6 x 2 source/lambda/util
source/web-ui/src/util
gql-schema-interfaces.ts
data-structures.ts
26:31 (20%)
56:61 (11%)
view
6 x 2 source/cdk-infrastructur...b/front-end/appsync-api
source/cdk-infrastructur...b/front-end/appsync-api
schema.graphql
schema.graphql
44:49 (5%)
94:99 (5%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
6 x 2 source/web-ui/src/graphql
source/lambda/filter-kinesis-stream
queries.tsx
gql-mutations.ts
50:56 
5:11 
view