status-im/status-go

View on GitHub

Showing 515 of 515 total issues

Consider simplifying this complex logical expression.
Open

    if message.ContentType != protobuf.ChatMessage_TEXT_PLAIN &&
        message.ContentType != protobuf.ChatMessage_BRIDGE_MESSAGE &&
        message.ContentType != protobuf.ChatMessage_STICKER &&
        message.ContentType != protobuf.ChatMessage_EMOJI &&
        message.ContentType != protobuf.ChatMessage_IMAGE &&
Severity: Major
Found in protocol/messenger_messages.go - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if p.Id != other.Id ||
            p.Type != other.Type ||
            len(p.TokenCriteria) != len(other.TokenCriteria) ||
            len(p.ChatIds) != len(other.ChatIds) ||
            p.IsPrivate != other.IsPrivate ||
    Severity: Major
    Found in protocol/communities/community_token_permission.go - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if ii.Name == "" && len(ii.Payload) == 0 && ii.Width == 0 && ii.Height == 0 && ii.FileSize == 0 && ii.ResizeTarget == 0 {
      Severity: Major
      Found in multiaccounts/database.go - About 40 mins to fix

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

        func (api *PublicWakuAPI) GetPublicKey(ctx context.Context, id string) (hexutil.Bytes, error) {
            key, err := api.w.GetPrivateKey(id)
            if err != nil {
                return hexutil.Bytes{}, err
            }
        Severity: Minor
        Found in waku/api.go and 1 other location - About 40 mins to fix
        wakuv2/api.go on lines 116..122

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

        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 (api *PublicWakuAPI) GetPublicKey(ctx context.Context, id string) (hexutil.Bytes, error) {
            key, err := api.w.GetPrivateKey(id)
            if err != nil {
                return hexutil.Bytes{}, err
            }
        Severity: Minor
        Found in wakuv2/api.go and 1 other location - About 40 mins to fix
        waku/api.go on lines 146..152

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

        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

                address: {
                    {
                        Token: token.Token{
                            Address:  common.Address{0x34},
                            Name:     "Token 1",
        Severity: Minor
        Found in services/wallet/reader_test.go and 1 other location - About 40 mins to fix
        services/wallet/reader_test.go on lines 447..465

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

        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

                common.Address{0x12}: {
                    {
                        Token: token.Token{
                            Address:  common.Address{0x34},
                            Name:     "Token 1",
        Severity: Minor
        Found in services/wallet/reader_test.go and 1 other location - About 40 mins to fix
        services/wallet/reader_test.go on lines 520..538

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

        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 HopL2OptimismBridgeTransactor.Send has 7 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        func (_HopL2OptimismBridge *HopL2OptimismBridgeTransactor) Send(opts *bind.TransactOpts, chainId *big.Int, recipient common.Address, amount *big.Int, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) (*types.Transaction, error) {
        Severity: Major
        Found in contracts/hop/l2Contracts/l2OptimismBridge/l2OptimismBridge.go - About 35 mins to fix

          Method HopL1Erc20BridgeTransactorSession.SendToL2 has 7 arguments (exceeds 6 allowed). Consider refactoring.
          Open

          func (_HopL1Erc20Bridge *HopL1Erc20BridgeTransactorSession) SendToL2(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 35 mins to fix

            Method HopL2ArbitrumBridgeTransactor.Distribute has 7 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeTransactor) Distribute(opts *bind.TransactOpts, 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/l2Contracts/l2ArbitrumBridge/l2ArbitrumBridge.go - About 35 mins to fix

              Method HopL2ArbitrumBridgeTransactorSession.SettleBondedWithdrawal has 7 arguments (exceeds 6 allowed). Consider refactoring.
              Open

              func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeTransactorSession) SettleBondedWithdrawal(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 35 mins to fix

                Method HopL1HopBridgeTransactorSession.SettleBondedWithdrawal has 7 arguments (exceeds 6 allowed). Consider refactoring.
                Open

                func (_HopL1HopBridge *HopL1HopBridgeTransactorSession) SettleBondedWithdrawal(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 35 mins to fix

                  Method HopL1EthBridgeTransactorSession.SendToL2 has 7 arguments (exceeds 6 allowed). Consider refactoring.
                  Open

                  func (_HopL1EthBridge *HopL1EthBridgeTransactorSession) SendToL2(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 35 mins to fix

                    Method HopL2ArbitrumBridgeSession.SettleBondedWithdrawal has 7 arguments (exceeds 6 allowed). Consider refactoring.
                    Open

                    func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeSession) SettleBondedWithdrawal(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 35 mins to fix

                      Method HopL1Erc20BridgeTransactorSession.SettleBondedWithdrawal has 7 arguments (exceeds 6 allowed). Consider refactoring.
                      Open

                      func (_HopL1Erc20Bridge *HopL1Erc20BridgeTransactorSession) SettleBondedWithdrawal(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 35 mins to fix

                        Method HopL2ArbitrumBridgeTransactor.BondWithdrawalAndDistribute has 7 arguments (exceeds 6 allowed). Consider refactoring.
                        Open

                        func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeTransactor) BondWithdrawalAndDistribute(opts *bind.TransactOpts, recipient common.Address, amount *big.Int, transferNonce [32]byte, bonderFee *big.Int, amountOutMin *big.Int, deadline *big.Int) (*types.Transaction, error) {
                        Severity: Major
                        Found in contracts/hop/l2Contracts/l2ArbitrumBridge/l2ArbitrumBridge.go - About 35 mins to fix

                          Method HopL1HopBridgeSession.GetTransferId has 7 arguments (exceeds 6 allowed). Consider refactoring.
                          Open

                          func (_HopL1HopBridge *HopL1HopBridgeSession) GetTransferId(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 35 mins to fix

                            Method HopL1Erc20BridgeSession.GetTransferId has 7 arguments (exceeds 6 allowed). Consider refactoring.
                            Open

                            func (_HopL1Erc20Bridge *HopL1Erc20BridgeSession) GetTransferId(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 35 mins to fix

                              Method HopL2ArbitrumBridgeSession.GetTransferId has 7 arguments (exceeds 6 allowed). Consider refactoring.
                              Open

                              func (_HopL2ArbitrumBridge *HopL2ArbitrumBridgeSession) GetTransferId(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 35 mins to fix

                                Method HopL1Erc20BridgeCallerSession.GetTransferId has 7 arguments (exceeds 6 allowed). Consider refactoring.
                                Open

                                func (_HopL1Erc20Bridge *HopL1Erc20BridgeCallerSession) GetTransferId(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 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language