aws-samples / amazon-lookout-for-metrics-samples
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
  • 45% duplication:
    • 2,433 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,096 duplicated lines
  • 49 duplicates
system45% (1,096 lines)
Duplication per Extension
py53% (746 lines)
YAML61% (235 lines)
yaml25% (94 lines)
js100% (21 lines)
Duplication per Component (primary)
next_steps/readable_alerts_html84% (329 lines)
getting_started39% (249 lines)
next_steps/kinesis_stream_connector/data_generator/src100% (129 lines)
next_steps/kinesis_stream_connector/l4m_detector/src100% (129 lines)
workshops/RI2021/ml_ops/lambdas25% (76 lines)
workshops/RI2021/ml_ops23% (73 lines)
next_steps/readable_alerts53% (69 lines)
workshops/RI202130% (21 lines)
next_steps/kinesis_stream_connector/data_generator100% (7 lines)
next_steps/kinesis_stream_connector/l4m_connector100% (7 lines)
next_steps/kinesis_stream_connector/l4m_detector100% (7 lines)
next_steps/kinesis_stream_connector/data_generator/stack0% (0 lines)
next_steps/kinesis_stream_connector/l4m_connector/src0% (0 lines)
next_steps/kinesis_stream_connector/l4m_connector/stack0% (0 lines)
next_steps/kinesis_stream_connector/l4m_detector/stack0% (0 lines)
workshops/RI2021/ml_ops/shared0% (0 lines)

Duplication Between Components (50+ lines)

G next_steps/kinesis_stream_connector/data_generator/src next_steps/kinesis_stream_connector/data_generator/src next_steps/kinesis_stream_connector/l4m_detector/src next_steps/kinesis_stream_connector/l4m_detector/src next_steps/kinesis_stream_connector/data_generator/src--next_steps/kinesis_stream_connector/l4m_detector/src 258 getting_started getting_started getting_started--next_steps/kinesis_stream_connector/data_generator/src 132 getting_started--next_steps/kinesis_stream_connector/l4m_detector/src 132

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 49 duplicates...
Size#FoldersFilesLinesCode
153 x 2 next_steps/readable_alerts_html
next_steps/readable_alerts_html
HumanReadableAlertsHtml.YAML
readable_alerts_html.py
99:349 (65%)
11:261 (100%)
view
129 x 2 next_steps/kinesis_strea...ctor/data_generator/src
next_steps/kinesis_strea...nector/l4m_detector/src
synth_live_data_csv.py
synth_live_data_csv.py
23:206 (100%)
23:206 (100%)
view
36 x 2 getting_started
next_steps/kinesis_strea...nector/l4m_detector/src
synth_data.py
synth_live_data_csv.py
71:128 (29%)
78:129 (27%)
view
36 x 2 getting_started
next_steps/kinesis_strea...ctor/data_generator/src
synth_data.py
synth_live_data_csv.py
71:128 (29%)
78:129 (27%)
view
24 x 2 next_steps/readable_alerts
next_steps/readable_alerts
HumanReadableAlerts.YAML
readable_alerts.py
96:132 (24%)
24:60 (77%)
view
19 x 2 getting_started
next_steps/kinesis_strea...nector/l4m_detector/src
synth_data.py
synth_live_data_csv.py
38:69 (15%)
52:75 (14%)
view
19 x 2 getting_started
next_steps/kinesis_strea...ctor/data_generator/src
synth_data.py
synth_live_data_csv.py
38:69 (15%)
52:75 (14%)
view
14 x 2 workshops/RI2021/ml_ops/.../anomaly-alert-function
workshops/RI2021/ml_ops/.../anomaly-alert-function
anomaly-alert-function.py
anomaly-alert-function.py
160:176 (7%)
190:206 (7%)
view
13 x 2 getting_started
workshops/RI2021
LookoutForMetricsNotebookSetup.YAML
AL4MWorkshop.yaml
23:35 (25%)
25:37 (18%)
view
13 x 2 getting_started
getting_started
utility.py
utility.py
268:280 (2%)
398:411 (2%)
view
11 x 2 workshops/RI2021/ml_ops/.../anomaly-alert-function
workshops/RI2021/ml_ops/.../anomaly-alert-function
anomaly-alert-function.py
anomaly-alert-function.py
42:56 (6%)
108:120 (6%)
view
11 x 2 getting_started
next_steps/kinesis_strea...ctor/data_generator/src
synth_data.py
synth_live_data_csv.py
21:34 (9%)
36:49 (8%)
view
11 x 2 getting_started
next_steps/kinesis_strea...nector/l4m_detector/src
synth_data.py
synth_live_data_csv.py
21:34 (9%)
36:49 (8%)
view
10 x 2 getting_started
getting_started
utility.py
utility.py
38:49 (2%)
199:209 (2%)
view
9 x 2 getting_started
getting_started
utility.py
utility.py
199:208 (2%)
289:298 (2%)
view
9 x 2 getting_started
getting_started
utility.py
utility.py
38:48 (2%)
289:298 (2%)
view
8 x 2 next_steps/readable_alerts_html
next_steps/readable_alerts_html
HumanReadableAlertsHtml.YAML
HumanReadableAlertsHtml.YAML
44:51 (3%)
53:60 (3%)
view
8 x 2 workshops/RI2021/ml_ops
workshops/RI2021/ml_ops
template.yaml
template.yaml
121:128 (2%)
301:308 (2%)
view
8 x 2 getting_started
workshops/RI2021
LookoutForMetricsNotebookSetup.YAML
AL4MWorkshop.yaml
49:58 (15%)
54:63 (11%)
view
8 x 2 workshops/RI2021/ml_ops
workshops/RI2021/ml_ops
template.yaml
template.yaml
163:170 (2%)
183:190 (2%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
35 x 2 next_steps/kinesis_strea...ctor/data_generator/src
next_steps/kinesis_strea...nector/l4m_detector/src
synth_live_data_csv.py
synth_live_data_csv.py
0:0 
0:0 
view
26 x 2 next_steps/kinesis_strea...ctor/data_generator/src
next_steps/kinesis_strea...nector/l4m_detector/src
synth_live_data_csv.py
synth_live_data_csv.py
0:0 
0:0 
view
14 x 3 getting_started
next_steps/kinesis_strea...ctor/data_generator/src
next_steps/kinesis_strea...nector/l4m_detector/src
synth_data.py
synth_live_data_csv.py
synth_live_data_csv.py
0:0 
0:0 
0:0 
view
11 x 2 next_steps/kinesis_strea...ctor/data_generator/src
next_steps/kinesis_strea...nector/l4m_detector/src
synth_live_data_csv.py
synth_live_data_csv.py
0:0 
0:0 
view