aws-samples / sitewise-data-ingestion-demo
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
  • 6% duplication:
    • 1,226 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 84 duplicated lines
  • 6 duplicates
system6% (84 lines)
Duplication per Extension
ts5% (56 lines)
js13% (28 lines)
Duplication per Component (primary)
lib/lambda13% (42 lines)
misc/asset-map-builder50% (32 lines)
misc/cleanup27% (10 lines)
lib/timestream0% (0 lines)
lib/kinesis0% (0 lines)
lib/assets0% (0 lines)
lib/util0% (0 lines)
lib/asset-models0% (0 lines)
lib/iot-rules0% (0 lines)
lib/stacks0% (0 lines)
ROOT0% (0 lines)
misc/windfarm-stack-manager0% (0 lines)
misc/data-generator0% (0 lines)

Duplication Between Components (50+ lines)

G lib/lambda lib/lambda misc/asset-map-builder misc/asset-map-builder lib/lambda--misc/asset-map-builder 56

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 6 longest duplicates.
See data for all 6 duplicates...
Size#FoldersFilesLinesCode
14 x 2 lib/lambda/functions/asset-mapper
misc/asset-map-builder/src
index.js
index.ts
45:59 (10%)
49:63 (22%)
view
10 x 2 misc/asset-map-builder/src
misc/cleanup/src
index.ts
index.ts
17:30 (15%)
11:24 (27%)
view
8 x 2 lib/lambda/functions/asset-mapper
misc/asset-map-builder/src
index.js
index.ts
64:72 (5%)
68:76 (12%)
view
7 x 2 lib/lambda
lib/lambda
asset-mapper-lambda-construct.ts
data-lake-ingestion-fork-lambda-const...
28:36 (14%)
30:38 (11%)
view
6 x 2 lib/lambda/functions/asset-mapper
misc/asset-map-builder/src
index.js
index.ts
21:29 (4%)
20:28 (9%)
view
6 x 2 lib/lambda/functions/asset-mapper
misc/cleanup/src
index.js
index.ts
21:29 (4%)
14:22 (16%)
view