-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate code (part 4) #1264
Comments
Hi @LucasSte , could please guide me a little bit more about how solve this problem ? |
Hi @ggold7046, this issue points fourteen sections of code that are duplicate. The solution here is to remove them. In some cases, however, the fix is not as simple as writing a function to remove the code duplication. Some parts require complete refactoring! If you are interested in working on this issue, please read through the code to understand the problem. |
Thanks @LucasSte for the info. Could you please guide which coding part could be removed by writing function ? |
Hey @ggold7046, The code excerpts in the issue come from a duplication detection tool my IDE has. I have just pasted them here without analyzing anything. If you are interested in working on this issue, I suggest that you go over them yourself and understand the problems. The knowledge you can acquire by doing that will not only help you removing duplicate code from our repository but also be the base for other contributions. Once you have made progress on that, we are happy to discuss and review your solution. |
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/sema/statements.rs#L1043-L1063
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/sema/expression/function_call.rs#L1715-L1735
======================================
3.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/substrate/storage.rs#L152-L158
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L776-L783
=======================================
4.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/substrate/storage.rs#L582-L590
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/substrate/storage.rs#L760-L769
=======================================
5.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/substrate/storage.rs#L693-L703
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/substrate/storage.rs#L739-L749
========================================
6.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/codegen/storage.rs#L114-L135
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/codegen/storage.rs#L288-L309
========================================
7.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/strings.rs#L236-L246
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/strings.rs#L260-L270
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/strings.rs#L282-L292
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/strings.rs#L312-L322
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/strings.rs#L336-L346
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/strings.rs#L403-L413
========================================
8.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/abi/substrate.rs#L287-L300
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/abi/substrate.rs#L372-L384
========================================
9.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/codegen/dispatch/substrate.rs#L341-L360
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/codegen/dispatch/substrate.rs#L398-L417
========================================
10.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L100-L110
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L182-L192
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L334-L344
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L440-L450
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L548-L558
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L837-L847
========================================
11.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L354-L369
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L1019-L1034
========================================
12.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L623-L636
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L2069-L2082
========================================
13.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L876-L887
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L929-L939
========================================
14.
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L2023-L2041
https://github.com/hyperledger/solang/blob/1b46d73b32449a09ba1c1e54c8073ecb4d7cf4a0/src/emit/solana/target.rs#L2093-L2111
The text was updated successfully, but these errors were encountered: