Showing 521 of 521 total issues
Identical blocks of code found in 3 locations. Consider refactoring. Open
err := rows.Scan(&token.CommunityID, &token.Address, &token.TokenType, &token.Name,
&token.Symbol, &token.Description, &supplyStr, &token.InfiniteSupply, &token.Transferable,
&token.RemoteSelfDestruct, &token.ChainID, &token.DeployState, &token.Base64Image, &token.Decimals,
&token.Deployer, &token.PrivilegesLevel, &token.TransactionHash)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method HopL2AmmWrapperTransactorSession.SwapAndSend
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL2AmmWrapper *HopL2AmmWrapperTransactorSession) SwapAndSend(chainId *big.Int, recipient common.Address, amount *big.Int, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, destinationAmountOutMin *big.Int, destinationDeadline *big.Int) (*types.Transaction, error) {
Method HopL1HopBridgeTransactor.SendToL2
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1HopBridge *HopL1HopBridgeTransactor) SendToL2(opts *bind.TransactOpts, chainId *big.Int, recipient common.Address, amount *big.Int, amountOutMin *big.Int, deadline *big.Int, relayer common.Address, relayerFee *big.Int) (*types.Transaction, error) {
Method HopL1Erc20BridgeTransactor.SendToL2
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1Erc20Bridge *HopL1Erc20BridgeTransactor) SendToL2(opts *bind.TransactOpts, chainId *big.Int, recipient common.Address, amount *big.Int, amountOutMin *big.Int, deadline *big.Int, relayer common.Address, relayerFee *big.Int) (*types.Transaction, error) {
Method HopL2AmmWrapperSession.SwapAndSend
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL2AmmWrapper *HopL2AmmWrapperSession) SwapAndSend(chainId *big.Int, recipient common.Address, amount *big.Int, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, destinationAmountOutMin *big.Int, destinationDeadline *big.Int) (*types.Transaction, error) {
Method HopL2OptimismBridgeCaller.GetTransferId
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL2OptimismBridge *HopL2OptimismBridgeCaller) GetTransferId(opts *bind.CallOpts, chainId *big.Int, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) ([32]byte, error) {
Method HopL1Erc20BridgeTransactor.SettleBondedWithdrawal
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1Erc20Bridge *HopL1Erc20BridgeTransactor) SettleBondedWithdrawal(opts *bind.TransactOpts, bonder common.Address, transferId [32]byte, rootHash [32]byte, transferRootTotalAmount *big.Int, transferIdTreeIndex *big.Int, siblings [][32]byte, totalLeaves *big.Int) (*types.Transaction, error) {
Method Uniswapv2Transactor.Permit
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_Uniswapv2 *Uniswapv2Transactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) {
Method HopL1EthBridgeTransactor.SendToL2
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1EthBridge *HopL1EthBridgeTransactor) SendToL2(opts *bind.TransactOpts, chainId *big.Int, recipient common.Address, amount *big.Int, amountOutMin *big.Int, deadline *big.Int, relayer common.Address, relayerFee *big.Int) (*types.Transaction, error) {
Method HopL1HopBridgeCaller.GetTransferId
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1HopBridge *HopL1HopBridgeCaller) GetTransferId(opts *bind.CallOpts, chainId *big.Int, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) ([32]byte, error) {
Method HopL1HopBridgeTransactor.SettleBondedWithdrawal
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1HopBridge *HopL1HopBridgeTransactor) SettleBondedWithdrawal(opts *bind.TransactOpts, bonder common.Address, transferId [32]byte, rootHash [32]byte, transferRootTotalAmount *big.Int, transferIdTreeIndex *big.Int, siblings [][32]byte, totalLeaves *big.Int) (*types.Transaction, error) {
Method HopL1Erc20BridgeCaller.GetTransferId
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1Erc20Bridge *HopL1Erc20BridgeCaller) GetTransferId(opts *bind.CallOpts, chainId *big.Int, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) ([32]byte, error) {
Method HopL2ArbitrumBridgeCaller.GetTransferId
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeCaller) GetTransferId(opts *bind.CallOpts, chainId *big.Int, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) ([32]byte, error) {
Avoid deeply nested control flow statements. Open
if rl.callersOnWaitForRequests[i].requests <= numOfRequestsToMakeAvailable {
index = i
break
}
Method HopL1EthBridgeTransactor.SettleBondedWithdrawal
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1EthBridge *HopL1EthBridgeTransactor) SettleBondedWithdrawal(opts *bind.TransactOpts, bonder common.Address, transferId [32]byte, rootHash [32]byte, transferRootTotalAmount *big.Int, transferIdTreeIndex *big.Int, siblings [][32]byte, totalLeaves *big.Int) (*types.Transaction, error) {
Method HopL2ArbitrumBridgeTransactor.SettleBondedWithdrawal
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeTransactor) SettleBondedWithdrawal(opts *bind.TransactOpts, bonder common.Address, transferId [32]byte, rootHash [32]byte, transferRootTotalAmount *big.Int, transferIdTreeIndex *big.Int, siblings [][32]byte, totalLeaves *big.Int) (*types.Transaction, error) {
Method HopL2OptimismBridgeTransactor.SettleBondedWithdrawal
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL2OptimismBridge *HopL2OptimismBridgeTransactor) SettleBondedWithdrawal(opts *bind.TransactOpts, bonder common.Address, transferId [32]byte, rootHash [32]byte, transferRootTotalAmount *big.Int, transferIdTreeIndex *big.Int, siblings [][32]byte, totalLeaves *big.Int) (*types.Transaction, error) {
Method HopL1EthBridgeCaller.GetTransferId
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
func (_HopL1EthBridge *HopL1EthBridgeCaller) GetTransferId(opts *bind.CallOpts, chainId *big.Int, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) ([32]byte, error) {
Avoid deeply nested control flow statements. Open
} else if err != nil {
log.Debug("error fetching records", "topic", topic, "rendezvous server", srv, "err", err)
} else {
for i := range records {
n, err := enrToNode(records[i])
Avoid deeply nested control flow statements. Open
if transfersLoaded {
if c.transfersLoaded == nil {
c.transfersLoaded = make(map[common.Address]bool)
}
c.transfersLoaded[account] = true