awslabs / amazon-redshift-utils
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
  • 16% duplication:
    • 11,253 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,850 duplicated lines
  • 333 duplicates
system16% (1,850 lines)
Duplication per Extension
yaml41% (1,332 lines)
py6% (518 lines)
Duplication per Component (primary)
src/SimpleReplay22% (1,118 lines)
src/RedshiftAutomation29% (245 lines)
src/AnalyzeVacuumUtility33% (225 lines)
src/SystemTablePersistence32% (98 lines)
src/MetadataTransfer17% (62 lines)
src/SnapshotManager8% (39 lines)
src/ColumnEncodingUtility3% (33 lines)
src/QMRNotificationUtility4% (16 lines)
src/UnloadCopyUtility<1% (14 lines)
src0% (0 lines)
src/UserLastLogin0% (0 lines)
src/WorkloadManagementScheduler0% (0 lines)
src/MultipleTableRestoreUtility0% (0 lines)
src/BlogContent0% (0 lines)
src/UnloadAutoPartitions0% (0 lines)

Duplication Between Components (50+ lines)

G src/RedshiftAutomation src/RedshiftAutomation src/SystemTablePersistence src/SystemTablePersistence src/RedshiftAutomation--src/SystemTablePersistence 253 src/SnapshotManager src/SnapshotManager src/RedshiftAutomation--src/SnapshotManager 106 src/SnapshotManager--src/SystemTablePersistence 78

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 333 duplicates...
Size#FoldersFilesLinesCode
53 x 2 src/AnalyzeVacuumUtility/lib
src/AnalyzeVacuumUtility/lib
analyze_vacuum.py
analyze_vacuum.py
437:489 (9%)
506:558 (9%)
view
42 x 2 src/RedshiftAutomation
src/SystemTablePersistence
deploy.yaml
deploy-systable-standalone.yaml
115:156 (14%)
67:108 (32%)
view
30 x 2 src/RedshiftAutomation
src/SystemTablePersistence
deploy-function-and-schedule.yaml
deploy-systable-standalone.yaml
75:104 (28%)
79:108 (22%)
view
30 x 2 src/RedshiftAutomation
src/RedshiftAutomation
deploy-function-and-schedule.yaml
deploy.yaml
75:104 (28%)
127:156 (10%)
view
29 x 2 src/SimpleReplay
src/SimpleReplay
extract.py
replay.py
916:947 (2%)
1289:1320 (2%)
view
28 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-extract.yaml
ra3-migration-extract.yaml
132:159 (3%)
174:201 (3%)
view
28 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-extract.yaml
ra3-migration-replay.yaml
354:381 (3%)
301:328 (2%)
view
23 x 2 src/MetadataTransfer
src/MetadataTransfer
metadatacopy.py
userprivs.py
131:156 (15%)
143:168 (14%)
view
22 x 2 src/RedshiftAutomation
src/SystemTablePersistence
deploy.yaml
deploy-systable-standalone.yaml
258:279 (7%)
110:131 (16%)
view
21 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-extract.yaml
ra3-migration-replay.yaml
854:874 (2%)
1296:1316 (1%)
view
19 x 2 src/RedshiftAutomation
src/RedshiftAutomation
deploy-function-and-schedule.yaml
deploy.yaml
38:56 (18%)
102:120 (6%)
view
19 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-extract.yaml
ra3-migration-replay.yaml
783:805 (2%)
1217:1236 (1%)
view
18 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-replay.yaml
ra3-migration-replay.yaml
1132:1149 (1%)
1203:1220 (1%)
view
16 x 2 src/RedshiftAutomation
src/SnapshotManager
deploy.yaml
deploy.yaml
125:140 (5%)
106:121 (9%)
view
16 x 2 src/SnapshotManager
src/SystemTablePersistence
deploy.yaml
deploy-systable-standalone.yaml
106:121 (9%)
77:92 (12%)
view
15 x 2 src/AnalyzeVacuumUtility/lib
src/AnalyzeVacuumUtility/lib
analyze_vacuum.py
analyze_vacuum.py
260:274 (2%)
530:544 (2%)
view
15 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-extract.yaml
ra3-migration-replay.yaml
71:85 (1%)
143:157 (1%)
view
15 x 2 src/SimpleReplay
src/SimpleReplay
extract.py
replay.py
873:887 (1%)
1238:1253 (1%)
view
15 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-replay.yaml
ra3-migration-replay.yaml
1116:1130 (1%)
1187:1201 (1%)
view
15 x 2 src/SimpleReplay/cloudformation
src/SimpleReplay/cloudformation
ra3-migration-replay.yaml
ra3-migration-replay.yaml
736:750 (1%)
811:825 (1%)
view