awslabs / aws-fpga-app-notes
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
  • 84% duplication:
    • 16,066 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 13,514 duplicated lines
  • 3,175 duplicates
system84% (13,514 lines)
Duplication per Extension
cpp91% (11,608 lines)
h63% (1,317 lines)
hpp93% (357 lines)
cl98% (136 lines)
c18% (84 lines)
launch20% (12 lines)
Duplication per Component (primary)
reInvent19_Developer_Workshop/modules97% (11,339 lines)
NYC_Summit18_Developer_Workshop/workspace91% (609 lines)
NYC_Summit18_Developer_Workshop/idct99% (597 lines)
reInvent18_Developer_Workshop/hostcode_opt60% (365 lines)
reInvent18_Developer_Workshop/filter2D19% (282 lines)
reInvent18_Developer_Workshop/helloworld_c68% (174 lines)
NYC_Summit18_Developer_Workshop/helloworld_ocl85% (84 lines)
reInvent18_Developer_Workshop/helloworld_ocl64% (64 lines)
Using-PCIe-Write-Combining0% (0 lines)
Using-PCIM-Port0% (0 lines)
FPGA_Developer_AMI_Build_Recipe_AL2/ansible0% (0 lines)
Using-PCIe-Interrupts0% (0 lines)

Duplication Between Components (50+ lines)

G reInvent18_Developer_Workshop/helloworld_c reInvent18_Developer_Workshop/helloworld_c reInvent19_Developer_Workshop/modules reInvent19_Developer_Workshop/modules reInvent18_Developer_Workshop/helloworld_c--reInvent19_Developer_Workshop/modules 3149 NYC_Summit18_Developer_Workshop/idct NYC_Summit18_Developer_Workshop/idct NYC_Summit18_Developer_Workshop/idct--reInvent19_Developer_Workshop/modules 1343 NYC_Summit18_Developer_Workshop/workspace NYC_Summit18_Developer_Workshop/workspace NYC_Summit18_Developer_Workshop/idct--NYC_Summit18_Developer_Workshop/workspace 1194 reInvent18_Developer_Workshop/hostcode_opt reInvent18_Developer_Workshop/hostcode_opt NYC_Summit18_Developer_Workshop/idct--reInvent18_Developer_Workshop/hostcode_opt 62 NYC_Summit18_Developer_Workshop/workspace--reInvent19_Developer_Workshop/modules 1343 NYC_Summit18_Developer_Workshop/workspace--reInvent18_Developer_Workshop/hostcode_opt 62 reInvent18_Developer_Workshop/hostcode_opt--reInvent19_Developer_Workshop/modules 214 reInvent18_Developer_Workshop/filter2D reInvent18_Developer_Workshop/filter2D reInvent18_Developer_Workshop/filter2D--reInvent19_Developer_Workshop/modules 210 NYC_Summit18_Developer_Workshop/helloworld_ocl NYC_Summit18_Developer_Workshop/helloworld_ocl NYC_Summit18_Developer_Workshop/helloworld_ocl--reInvent19_Developer_Workshop/modules 160 reInvent18_Developer_Workshop/helloworld_ocl reInvent18_Developer_Workshop/helloworld_ocl NYC_Summit18_Developer_Workshop/helloworld_ocl--reInvent18_Developer_Workshop/helloworld_ocl 128 reInvent18_Developer_Workshop/helloworld_ocl--reInvent19_Developer_Workshop/modules 120

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 3,175 duplicates...
Size#FoldersFilesLinesCode
430 x 2 NYC_Summit18_Developer_Workshop/idct/src
NYC_Summit18_Developer_Workshop/workspace/IDCT/src
idct.cpp
idct.cpp
42:824 (100%)
42:824 (100%)
view
206 x 2 reInvent19_Developer_Wor..._03/design/src/baseline
reInvent19_Developer_Wor..._03/design/src/dataflow
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor..._03/design/src/dataflow
reInvent19_Developer_Wor...e_03/design/src/multicu
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...reference-files/multicu
reInvent19_Developer_Wor..._03/design/src/localbuf
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor..._03/design/src/baseline
reInvent19_Developer_Wor...e_03/design/src/multicu
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor..._03/design/src/baseline
reInvent19_Developer_Wor...3/design/src/fixedpoint
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor...reference-files/multicu
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor...eference-files/localbuf
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor..._03/design/src/localbuf
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...eference-files/dataflow
reInvent19_Developer_Wor...3/design/src/fixedpoint
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor..._03/design/src/baseline
reInvent19_Developer_Wor..._03/design/src/localbuf
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...eference-files/dataflow
reInvent19_Developer_Wor..._03/design/src/localbuf
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...erence-files/fixedpoint
reInvent19_Developer_Wor...reference-files/multicu
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor...e_03/design/src/multicu
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor...le_03/design/src/addi_k
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...eference-files/baseline
reInvent19_Developer_Wor...le_03/design/src/addi_k
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...reference-files/multicu
reInvent19_Developer_Wor...3/design/src/fixedpoint
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...eference-files/dataflow
reInvent19_Developer_Wor...eference-files/localbuf
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...le_03/design/src/addi_k
reInvent19_Developer_Wor..._03/design/src/dataflow
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
206 x 2 reInvent19_Developer_Wor...eference-files/baseline
reInvent19_Developer_Wor..._03/design/src/baseline
xcl2.cpp
xcl2.cpp
34:341 (100%)
34:341 (100%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 58 unit duplicates...
Size#FoldersFilesLinesCode
142 x 2 NYC_Summit18_Developer_Workshop/idct/src
NYC_Summit18_Developer_Workshop/workspace/IDCT/src
idct.cpp
idct.cpp
462:673 
462:673 
view
111 x 3 NYC_Summit18_Developer_Workshop/idct/src
NYC_Summit18_Developer_Workshop/workspace/IDCT/src
reInvent19_Developer_Wor...ules/module_01/idct/src
krnl_idct.cpp
krnl_idct.cpp
krnl_idct.cpp
63:206 
63:206 
66:209 
view
110 x 3 NYC_Summit18_Developer_Workshop/idct/src
NYC_Summit18_Developer_Workshop/workspace/IDCT/src
reInvent19_Developer_Wor...ules/module_01/idct/src
idct.cpp
idct.cpp
idct.cpp
685:826 
685:826 
754:895 
view
91 x 2 reInvent19_Developer_Wor...ule_02/src/split_buffer
reInvent19_Developer_Wor...le_02/src/single_buffer
run_fpga.cpp
run_fpga.cpp
20:143 
20:143 
view
72 x 2 reInvent19_Developer_Wor..._03/design/src/dataflow
reInvent19_Developer_Wor...erence-files/fixedpoint
convolve_fpga.cpp
convolve_fpga.cpp
19:105 
19:105 
view
71 x 9 reInvent19_Developer_Wor...3/design/src/fixedpoint
reInvent19_Developer_Wor..._03/design/src/localbuf
reInvent19_Developer_Wor...e_03/design/src/multicu
reInvent19_Developer_Wor..._03/design/src/baseline
reInvent19_Developer_Wor..._03/design/src/dataflow
reInvent19_Developer_Wor...erence-files/fixedpoint
reInvent19_Developer_Wor...eference-files/localbuf
reInvent19_Developer_Wor...eference-files/baseline
reInvent19_Developer_Wor...eference-files/dataflow
convolve.cpp
convolve.cpp
convolve.cpp
convolve.cpp
convolve.cpp
convolve.cpp
convolve.cpp
convolve.cpp
convolve.cpp
32:135 
32:135 
32:135 
32:136 
32:135 
32:135 
32:135 
32:136 
32:135 
view
69 x 2 reInvent19_Developer_Wor...3/design/src/fixedpoint
reInvent19_Developer_Wor...eference-files/localbuf
convolve_fpga.cpp
convolve_fpga.cpp
14:92 
14:92 
view
62 x 2 reInvent18_Developer_Workshop/hostcode_opt/srcBuf
reInvent18_Developer_Wor...p/hostcode_opt/auxFiles
host.cpp
bufHost.cpp
10:98 
10:98 
view
59 x 2 reInvent19_Developer_Wor...e_03/design/src/multicu
reInvent19_Developer_Wor...eference-files/dataflow
convolve_fpga.cpp
convolve_fpga.cpp
32:96 
32:96 
view
57 x 2 reInvent18_Developer_Wor...ostcode_opt/srcPipeline
reInvent18_Developer_Wor...p/hostcode_opt/auxFiles
host.cpp
pipelineHost.cpp
10:93 
10:93 
view
57 x 2 reInvent18_Developer_Workshop/hostcode_opt/srcSync
reInvent18_Developer_Wor...p/hostcode_opt/auxFiles
host.cpp
syncHost.cpp
10:93 
10:93 
view
54 x 3 reInvent19_Developer_Wor...le_03/design/src/addi_k
reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor...reference-files/multicu
convolve_fpga.cpp
convolve_fpga.cpp
convolve_fpga.cpp
37:96 
33:92 
37:96 
view
53 x 6 reInvent19_Developer_Wor...dules/module_02/cpu_src
reInvent19_Developer_Wor...dule_02/reference_files
reInvent19_Developer_Wor...ule_02/src/split_buffer
reInvent19_Developer_Wor...e_02/src/generic_buffer
reInvent19_Developer_Wor...odule_02/src/sw_overlap
reInvent19_Developer_Wor...le_02/src/single_buffer
main.cpp
main.cpp
main.cpp
main.cpp
main.cpp
main.cpp
43:114 
43:114 
43:114 
43:114 
43:114 
43:114 
view
53 x 5 reInvent19_Developer_Wor...dule_02/reference_files
reInvent19_Developer_Wor...ule_02/src/split_buffer
reInvent19_Developer_Wor...e_02/src/generic_buffer
reInvent19_Developer_Wor...odule_02/src/sw_overlap
reInvent19_Developer_Wor...le_02/src/single_buffer
compute_score_host.cpp
compute_score_host.cpp
compute_score_host.cpp
compute_score_host.cpp
compute_score_host.cpp
15:82 
15:82 
15:82 
15:82 
15:82 
view
47 x 5 reInvent19_Developer_Wor...dule_02/reference_files
reInvent19_Developer_Wor...ule_02/src/split_buffer
reInvent19_Developer_Wor...e_02/src/generic_buffer
reInvent19_Developer_Wor...odule_02/src/sw_overlap
reInvent19_Developer_Wor...le_02/src/single_buffer
main.cpp
main.cpp
main.cpp
main.cpp
main.cpp
116:170 
116:170 
116:170 
116:170 
116:170 
view
43 x 3 NYC_Summit18_Developer_Workshop/idct/src
NYC_Summit18_Developer_Workshop/workspace/IDCT/src
reInvent19_Developer_Wor...ules/module_01/idct/src
idct.cpp
idct.cpp
idct.cpp
281:340 
281:340 
343:403 
view
41 x 2 reInvent19_Developer_Wor..._03/design/src/localbuf
reInvent19_Developer_Wor...eference-files/baseline
convolve_fpga.cpp
convolve_fpga.cpp
11:59 
11:59 
view
40 x 3 reInvent19_Developer_Wor...le_03/design/src/addi_k
reInvent19_Developer_Wor.../reference-files/addi_k
reInvent19_Developer_Wor...reference-files/multicu
convolve_fpga.cpp
convolve_fpga.cpp
convolve_fpga.cpp
106:150 
102:146 
106:150 
view
36 x 2 NYC_Summit18_Developer_Workshop/idct/src
NYC_Summit18_Developer_Workshop/workspace/IDCT/src
krnl_idct.cpp
krnl_idct.cpp
241:284 
241:284 
view
34 x 5 reInvent19_Developer_Wor...dule_02/reference_files
reInvent19_Developer_Wor...ule_02/src/split_buffer
reInvent19_Developer_Wor...e_02/src/generic_buffer
reInvent19_Developer_Wor...odule_02/src/sw_overlap
reInvent19_Developer_Wor...le_02/src/single_buffer
compute_score_fpga.cpp
compute_score_fpga.cpp
compute_score_fpga.cpp
compute_score_fpga.cpp
compute_score_fpga.cpp
102:140 
102:140 
102:140 
102:140 
102:140 
view