awslabs / sagemaker-defect-detection
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:
    • 2,016 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 217 duplicated lines
  • 16 duplicates
system10% (217 lines)
Duplication per Extension
py11% (165 lines)
yaml10% (52 lines)
Duplication per Component (primary)
src/sagemaker_defect_detection19% (123 lines)
cloudformation11% (52 lines)
src/sagemaker_defect_detection/dataset22% (26 lines)
src/sagemaker_defect_detection/utils2% (8 lines)
src/prepare_data11% (8 lines)
src/sagemaker_defect_detection/models0% (0 lines)
ROOT0% (0 lines)
cloudformation/solution-assistant/src0% (0 lines)
cloudformation/solution-assistant0% (0 lines)
scripts0% (0 lines)
Longest Duplicates
The list of 16 longest duplicates.
See data for all 16 duplicates...
Size#FoldersFilesLinesCode
13 x 2 src/sagemaker_defect_detection/dataset
src/sagemaker_defect_detection/dataset
neu.py
neu.py
58:71 (11%)
118:130 (11%)
view
10 x 2 cloudformation
cloudformation
defect-detection-permissions.yaml
defect-detection-sagemaker-notebook-i...
9:20 (6%)
13:24 (12%)
view
9 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
classifier.py
detector.py
178:186 (4%)
330:338 (2%)
view
8 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
classifier.py
detector.py
202:209 (3%)
358:365 (2%)
view
8 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
classifier.py
detector.py
118:126 (3%)
224:232 (2%)
view
8 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
detector.py
detector.py
399:406 (2%)
409:416 (2%)
view
8 x 2 src/prepare_data
src/sagemaker_defect_detection/utils
neu.py
visualize.py
20:27 (11%)
15:22 (10%)
view
7 x 2 cloudformation
cloudformation
defect-detection-permissions.yaml
defect-detection-sagemaker-notebook-i...
3:9 (4%)
3:9 (8%)
view
7 x 2 cloudformation
cloudformation
defect-detection-sagemaker-notebook-i...
defect-detection.yaml
17:24 (8%)
96:103 (3%)
view
7 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
classifier.py
detector.py
171:177 (3%)
322:328 (2%)
view
7 x 2 cloudformation
cloudformation
defect-detection-permissions.yaml
defect-detection.yaml
13:20 (4%)
96:103 (3%)
view
6 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
classifier.py
detector.py
38:43 (2%)
42:47 (1%)
view
6 x 2 cloudformation
cloudformation
defect-detection.yaml
defect-detection.yaml
134:139 (2%)
148:153 (2%)
view
6 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
classifier.py
detector.py
50:55 (2%)
63:68 (1%)
view
6 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
detector.py
detector.py
113:119 (1%)
140:146 (1%)
view
6 x 2 src/sagemaker_defect_detection
src/sagemaker_defect_detection
detector.py
detector.py
141:147 (1%)
154:160 (1%)
view