status-im/status-go

View on GitHub

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)
Severity: Major
Found in protocol/communities/persistence.go and 2 other locations - About 45 mins to fix
protocol/communities/persistence.go on lines 1249..1254
protocol/communities/persistence.go on lines 1272..1277

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

Further Reading

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) {
Severity: Major
Found in contracts/hop/l2Contracts/l2AmmWrapper/l2AmmWrapper.go - About 45 mins to fix

    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) {
    Severity: Major
    Found in contracts/hop/l1Contracts/l1HopBridge/l1HopBridge.go - About 45 mins to fix

      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) {
      Severity: Major
      Found in contracts/hop/l1Contracts/l1Erc20Bridge/l1Erc20Bridge.go - About 45 mins to fix

        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) {
        Severity: Major
        Found in contracts/hop/l2Contracts/l2AmmWrapper/l2AmmWrapper.go - About 45 mins to fix

          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) {
          Severity: Major
          Found in contracts/hop/l2Contracts/l2OptimismBridge/l2OptimismBridge.go - About 45 mins to fix

            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) {
            Severity: Major
            Found in contracts/hop/l1Contracts/l1Erc20Bridge/l1Erc20Bridge.go - About 45 mins to fix

              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) {
              Severity: Major
              Found in contracts/uniswapV2/uniswapv2pair.go - About 45 mins to fix

                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) {
                Severity: Major
                Found in contracts/hop/l1Contracts/l1EthBridge/l1EthBridge.go - About 45 mins to fix

                  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) {
                  Severity: Major
                  Found in contracts/hop/l1Contracts/l1HopBridge/l1HopBridge.go - About 45 mins to fix

                    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) {
                    Severity: Major
                    Found in contracts/hop/l1Contracts/l1HopBridge/l1HopBridge.go - About 45 mins to fix

                      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) {
                      Severity: Major
                      Found in contracts/hop/l1Contracts/l1Erc20Bridge/l1Erc20Bridge.go - About 45 mins to fix

                        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) {
                        Severity: Major
                        Found in contracts/hop/l2Contracts/l2ArbitrumBridge/l2ArbitrumBridge.go - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if rl.callersOnWaitForRequests[i].requests <= numOfRequestsToMakeAvailable {
                                                      index = i
                                                      break
                                                  }
                          Severity: Major
                          Found in rpc/chain/rpc_limiter.go - About 45 mins to fix

                            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) {
                            Severity: Major
                            Found in contracts/hop/l1Contracts/l1EthBridge/l1EthBridge.go - About 45 mins to fix

                              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) {
                              Severity: Major
                              Found in contracts/hop/l2Contracts/l2ArbitrumBridge/l2ArbitrumBridge.go - About 45 mins to fix

                                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) {
                                Severity: Major
                                Found in contracts/hop/l2Contracts/l2OptimismBridge/l2OptimismBridge.go - About 45 mins to fix

                                  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) {
                                  Severity: Major
                                  Found in contracts/hop/l1Contracts/l1EthBridge/l1EthBridge.go - About 45 mins to fix

                                    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])
                                    Severity: Major
                                    Found in discovery/rendezvous.go - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if transfersLoaded {
                                                              if c.transfersLoaded == nil {
                                                                  c.transfersLoaded = make(map[common.Address]bool)
                                                              }
                                                              c.transfersLoaded[account] = true
                                      Severity: Major
                                      Found in services/wallet/transfer/commands_sequential.go - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language