aws-samples / bank-transfer-blockchain-reinvent2019-workshop
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
  • 22% duplication:
    • 1,765 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 400 duplicated lines
  • 18 duplicates
system22% (400 lines)
Duplication per Extension
go40% (162 lines)
yaml44% (92 lines)
js15% (74 lines)
css69% (48 lines)
py6% (24 lines)
Duplication per Component (primary)
api/connection-profile76% (80 lines)
solution89% (79 lines)
chaincode/src/bank40% (73 lines)
ui/src/app17% (48 lines)
api12% (45 lines)
setup7% (36 lines)
events24% (29 lines)
chaincode/src/interbank11% (10 lines)
chaincode/src/forex0% (0 lines)
ui/src0% (0 lines)
ui/src/environments0% (0 lines)
setup/cloudformation0% (0 lines)

Duplication Between Components (50+ lines)

G chaincode/src/bank chaincode/src/bank solution solution chaincode/src/bank--solution 152 api api events events api--events 58

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 18 longest duplicates.
See data for all 18 duplicates...
Size#FoldersFilesLinesCode
40 x 2 chaincode/src/bank
solution
transfer.go
transfer.go
80:151 (54%)
107:178 (45%)
view
33 x 2 chaincode/src/bank
solution
transfer.go
transfer.go
12:75 (44%)
12:75 (37%)
view
31 x 2 api/connection-profile
api/connection-profile
bank-connection-profile-template.yaml
bank-connection-profile.yaml
32:65 (65%)
32:65 (65%)
view
24 x 2 ui/src/app/home
ui/src/app/login
home.component.css
login.component.css
1:28 (85%)
1:28 (85%)
view
10 x 2 chaincode/src/bank
chaincode/src/interbank
transfer.go
interbank.go
136:151 (13%)
144:159 (11%)
view
10 x 2 chaincode/src/interbank
solution
interbank.go
transfer.go
144:159 (11%)
163:178 (11%)
view
9 x 2 api/connection-profile
api/connection-profile
bank-connection-profile-template.yaml
bank-connection-profile.yaml
21:30 (19%)
21:30 (19%)
view
9 x 2 api
events
connection.js
connection.js
86:96 (13%)
83:93 (13%)
view
8 x 2 setup
setup
setup_fabric_environment.py
setup_fabric_environment.py
93:100 (2%)
183:190 (2%)
view
8 x 2 api
api
app.js
app.js
109:117 (7%)
131:139 (7%)
view
8 x 2 setup
setup
setup_fabric_environment.py
setup_fabric_environment.py
137:144 (2%)
183:190 (2%)
view
8 x 2 setup
setup
setup_fabric_environment.py
setup_fabric_environment.py
93:100 (2%)
137:144 (2%)
view
7 x 2 api
events
connection.js
connection.js
75:81 (10%)
72:78 (10%)
view
7 x 2 api
events
app.js
listener.js
33:40 (6%)
28:35 (12%)
view
6 x 2 chaincode/src/bank
solution
transfer.go
transfer.go
116:124 (8%)
94:103 (6%)
view
6 x 2 setup
setup
configtx.yaml
private-configtx.yaml
48:72 (12%)
31:60 (35%)
view
6 x 2 solution
solution
transfer.go
transfer.go
94:103 (6%)
143:151 (6%)
view
6 x 2 api
events
connection.js
connection.js
17:22 (9%)
17:22 (9%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
16 x 2 chaincode/src/bank
solution
transfer.go
transfer.go
129:152 
156:179 
view