status-im/status-go

View on GitHub

Showing 521 of 521 total issues

Function newLoadBlocksAndTransfersCommand has 13 arguments (exceeds 6 allowed). Consider refactoring.
Open

func newLoadBlocksAndTransfersCommand(accounts []common.Address, db *Database, accountsDB *accounts.Database,
    blockDAO *BlockDAO, blockRangesSeqDAO BlockRangeDAOer, chainClient chain.ClientInterface, feed *event.Feed,
    transactionManager *TransactionManager, pendingTxManager *transactions.PendingTxTracker,
    tokenManager *token.Manager, balanceCacher balance.Cacher, omitHistory bool,
    blockChainState *blockchainstate.BlockChainState) *loadBlocksAndTransfersCommand {
Severity: Major
Found in services/wallet/transfer/commands_sequential.go - About 1 hr to fix

    Function NewSequentialFetchStrategy has 13 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    func NewSequentialFetchStrategy(db *Database, blockDAO *BlockDAO, blockRangesSeqDAO *BlockRangeSequentialDAO, accountsDB *accounts.Database, feed *event.Feed,
        transactionManager *TransactionManager, pendingTxManager *transactions.PendingTxTracker,
        tokenManager *token.Manager,
        chainClients map[uint64]chain.ClientInterface,
        accounts []common.Address,
    Severity: Major
    Found in services/wallet/transfer/sequential_fetch_strategy.go - About 1 hr to fix

      Method HopL1EthBridgeTransactor.Withdraw has 12 arguments (exceeds 6 allowed). Consider refactoring.
      Open

      func (_HopL1EthBridge *HopL1EthBridgeTransactor) Withdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

        Method HopL2ArbitrumBridgeTransactor.Withdraw has 12 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeTransactor) Withdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

          Method HopL2OptimismBridgeTransactor.Withdraw has 12 arguments (exceeds 6 allowed). Consider refactoring.
          Open

          func (_HopL2OptimismBridge *HopL2OptimismBridgeTransactor) Withdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

            Method HopL1Erc20BridgeTransactor.Withdraw has 12 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            func (_HopL1Erc20Bridge *HopL1Erc20BridgeTransactor) Withdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

              Method HopL1HopBridgeTransactor.Withdraw has 12 arguments (exceeds 6 allowed). Consider refactoring.
              Open

              func (_HopL1HopBridge *HopL1HopBridgeTransactor) Withdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                Method ClientV5.BuildTransaction has 12 arguments (exceeds 6 allowed). Consider refactoring.
                Open

                func (c *ClientV5) BuildTransaction(ctx context.Context, srcTokenAddress common.Address, srcTokenDecimals uint, srcAmountWei *big.Int,
                    destTokenAddress common.Address, destTokenDecimals uint, destAmountWei *big.Int, slippageBasisPoints uint,
                    addressFrom common.Address, addressTo common.Address, priceRoute json.RawMessage, side SwapSide) (Transaction, error) {
                Severity: Major
                Found in services/wallet/thirdparty/paraswap/request_build_transaction.go - About 1 hr to fix

                  Method Service.InitProtocol has 12 arguments (exceeds 6 allowed). Consider refactoring.
                  Open

                  func (s *Service) InitProtocol(nodeName string, identity *ecdsa.PrivateKey, appDb, walletDb *sql.DB, httpServer *server.MediaServer, multiAccountDb *multiaccounts.Database, acc *multiaccounts.Account, accountManager *account.GethManager, rpcClient *rpc.Client, walletService *wallet.Service, communityTokensService *communitytokens.Service, wakuService *wakuv2.Waku, logger *zap.Logger) error {
                  Severity: Major
                  Found in services/ext/service.go - About 1 hr to fix

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func (p *Peer) setTopicInterest(topicInterest []common.TopicType) {
                        p.topicInterestMu.Lock()
                        defer p.topicInterestMu.Unlock()
                        if topicInterest == nil {
                            p.topicInterest = nil
                    Severity: Major
                    Found in waku/v1/peer.go and 1 other location - About 1 hr to fix
                    waku/v0/peer.go on lines 598..611

                    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 140.

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func (p *Peer) setTopicInterest(topicInterest []common.TopicType) {
                        p.topicInterestMu.Lock()
                        defer p.topicInterestMu.Unlock()
                        if topicInterest == nil {
                            p.topicInterest = nil
                    Severity: Major
                    Found in waku/v0/peer.go and 1 other location - About 1 hr to fix
                    waku/v1/peer.go on lines 645..658

                    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 140.

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                expectedCandidates: []*PathV2{
                                    {
                                        ProcessorName:    pathprocessor.ProcessorBridgeHopName,
                                        FromChain:        &mainnet,
                                        ToChain:          &optimism,
                    Severity: Major
                    Found in services/wallet/router/router_v2_test.go and 1 other location - About 1 hr to fix
                    services/wallet/router/router_v2_test.go on lines 2722..2743

                    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 138.

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                expectedCandidates: []*PathV2{
                                    {
                                        ProcessorName:    pathprocessor.ProcessorBridgeHopName,
                                        FromChain:        &mainnet,
                                        ToChain:          &optimism,
                    Severity: Major
                    Found in services/wallet/router/router_v2_test.go and 1 other location - About 1 hr to fix
                    services/wallet/router/router_v2_test.go on lines 2775..2796

                    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 138.

                    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 HopL2ArbitrumBridgeSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                    Open

                    func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                      Method HopL1EthBridgeTransactorSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                      Open

                      func (_HopL1EthBridge *HopL1EthBridgeTransactorSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                        Method HopL1HopBridgeTransactorSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                        Open

                        func (_HopL1HopBridge *HopL1HopBridgeTransactorSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                          Method HopL1Erc20BridgeSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                          Open

                          func (_HopL1Erc20Bridge *HopL1Erc20BridgeSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                            Method HopL1EthBridgeSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                            Open

                            func (_HopL1EthBridge *HopL1EthBridgeSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                              Method HopL2OptimismBridgeTransactorSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                              Open

                              func (_HopL2OptimismBridge *HopL2OptimismBridgeTransactorSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix

                                Method HopL2OptimismBridgeSession.Withdraw has 11 arguments (exceeds 6 allowed). Consider refactoring.
                                Open

                                func (_HopL2OptimismBridge *HopL2OptimismBridgeSession) Withdraw(recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int, 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 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language