status-im/status-go

View on GitHub

Showing 515 of 515 total issues

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

func (p *Peer) handleMessageResponseCode(packet p2p.Msg) error {
    var resp MultiVersionResponse
    if err := packet.Decode(&resp); err != nil {
        common.EnvelopesRejectedCounter.WithLabelValues("failed_read").Inc()
        return fmt.Errorf("invalid response message: %v", err)
Severity: Major
Found in waku/v1/peer.go and 1 other location - About 2 hrs to fix
waku/v0/peer.go on lines 276..294

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

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

CommunityTokenDeployerFilterer has 24 methods (exceeds 21 allowed). Consider refactoring.
Open

type CommunityTokenDeployerFilterer struct {
    contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
Severity: Minor
Found in contracts/community-tokens/deployer/CommunityTokenDeployer.go - About 2 hrs to fix

    PublicResolverSession has 24 methods (exceeds 21 allowed). Consider refactoring.
    Open

    type PublicResolverSession struct {
        Contract     *PublicResolver   // Generic contract binding to set the session for
        CallOpts     bind.CallOpts     // Call options to use throughout this session
        TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    }
    Severity: Minor
    Found in contracts/resolver/resolver.go - About 2 hrs to fix

      HopBridgeProcessor has 24 methods (exceeds 21 allowed). Consider refactoring.
      Open

      type HopBridgeProcessor struct {
          transactor    transactions.TransactorIface
          httpClient    *thirdparty.HTTPClient
          tokenManager  *token.Manager
          contractMaker *contracts.ContractMaker
      Severity: Minor
      Found in services/wallet/router/pathprocessor/processor_bridge_hop.go - About 2 hrs to fix

        Reader has 24 methods (exceeds 21 allowed). Consider refactoring.
        Open

        type Reader struct {
            tokenManager                   token.ManagerInterface
            marketManager                  *market.Manager
            persistence                    token.TokenBalancesStorage
            walletFeed                     *event.Feed
        Severity: Minor
        Found in services/wallet/reader.go - About 2 hrs to fix

          Messenger has 24 methods (exceeds 21 allowed). Consider refactoring.
          Open

          func (m *Messenger) SendContactVerificationRequest(ctx context.Context, contactID string, challenge string) (*MessengerResponse, error) {
              if len(challenge) < minContactVerificationMessageLen || len(challenge) > maxContactVerificationMessageLen {
                  return nil, errors.New("invalid verification request challenge length")
              }
          
          
          Severity: Minor
          Found in protocol/messenger_contact_verification.go - About 2 hrs to fix

            Messenger has 24 methods (exceeds 21 allowed). Consider refactoring.
            Open

            func (m *Messenger) getOneToOneAndNextClock(contact *Contact) (*Chat, uint64, error) {
                chat, ok := m.allChats.Load(contact.ID)
                if !ok {
                    publicKey, err := contact.PublicKey()
                    if err != nil {
            Severity: Minor
            Found in protocol/messenger_chats.go - About 2 hrs to fix

              MessengerShareUrlsSuite has 24 methods (exceeds 21 allowed). Consider refactoring.
              Open

              type MessengerShareUrlsSuite struct {
                  MessengerBaseTestSuite
              }
              Severity: Minor
              Found in protocol/messenger_share_urls_test.go - About 2 hrs to fix

                File messenger_contact_verification.go has 916 lines of code (exceeds 900 allowed). Consider refactoring.
                Open

                package protocol
                
                import (
                    "context"
                    "strings"
                Severity: Major
                Found in protocol/messenger_contact_verification.go - About 2 hrs to fix

                  Server has 23 methods (exceeds 21 allowed). Consider refactoring.
                  Open

                  type Server struct {
                      persistence   Persistence
                      config        *Config
                      messageSender *common.MessageSender
                      // SentRequests keeps track of the requests sent to gorush, for testing only
                  Severity: Minor
                  Found in protocol/pushnotificationserver/server.go - About 2 hrs to fix

                    ArchiveManager has 23 methods (exceeds 21 allowed). Consider refactoring.
                    Open

                    type ArchiveManager struct {
                        torrentConfig                *params.TorrentConfig
                        torrentClient                *torrent.Client
                        torrentTasks                 map[string]metainfo.Hash
                        historyArchiveDownloadTasks  map[string]*HistoryArchiveDownloadTask
                    Severity: Minor
                    Found in protocol/communities/manager_archive.go - About 2 hrs to fix

                      EncryptionServiceTestSuite has 23 methods (exceeds 21 allowed). Consider refactoring.
                      Open

                      type EncryptionServiceTestSuite struct {
                          suite.Suite
                          logger *zap.Logger
                          alice  *Protocol
                          bob    *Protocol
                      Severity: Minor
                      Found in protocol/encryption/encryption_test.go - About 2 hrs to fix

                        Service has 23 methods (exceeds 21 allowed). Consider refactoring.
                        Open

                        type Service struct {
                            messenger       *protocol.Messenger
                            identity        *ecdsa.PrivateKey
                            cancelMessenger chan struct{}
                            storage         db.TransactionalStorage
                        Severity: Minor
                        Found in services/ext/service.go - About 2 hrs to fix

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

                              cachedTokens := map[common.Address][]token.StorageToken{
                                  addresses[0]: {
                                      {
                                          Token: token.Token{
                                              Address:  common.HexToAddress("0xabc"),
                          Severity: Major
                          Found in services/wallet/reader_test.go and 1 other location - About 2 hrs to fix
                          services/wallet/reader_test.go on lines 938..972

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

                          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

                              cachedTokens := map[common.Address][]token.StorageToken{
                                  addresses[0]: {
                                      {
                                          Token: token.Token{
                                              Address:  common.HexToAddress("0xabc"),
                          Severity: Major
                          Found in services/wallet/reader_test.go and 1 other location - About 2 hrs to fix
                          services/wallet/reader_test.go on lines 823..857

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

                          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

                          package v0
                          
                          import (
                              gethcommon "github.com/ethereum/go-ethereum/common"
                              "github.com/ethereum/go-ethereum/rlp"
                          Severity: Major
                          Found in waku/v0/message_response.go and 1 other location - About 2 hrs to fix
                          waku/v1/message_response.go on lines 1..35

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

                          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

                          package v1
                          
                          import (
                              gethcommon "github.com/ethereum/go-ethereum/common"
                              "github.com/ethereum/go-ethereum/rlp"
                          Severity: Major
                          Found in waku/v1/message_response.go and 1 other location - About 2 hrs to fix
                          waku/v0/message_response.go on lines 1..35

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

                          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

                          File push_notification_test.go has 908 lines of code (exceeds 900 allowed). Consider refactoring.
                          Open

                          package protocol
                          
                          import (
                              "context"
                              "crypto/ecdsa"
                          Severity: Major
                          Found in protocol/push_notification_test.go - About 2 hrs to fix

                            HopL1HopBridgeTransactor has 22 methods (exceeds 21 allowed). Consider refactoring.
                            Open

                            type HopL1HopBridgeTransactor struct {
                                contract *bind.BoundContract // Generic contract wrapper for the low level calls
                            }
                            Severity: Minor
                            Found in contracts/hop/l1Contracts/l1HopBridge/l1HopBridge.go - About 2 hrs to fix

                              Transactor has 22 methods (exceeds 21 allowed). Consider refactoring.
                              Open

                              type Transactor struct {
                                  rpcWrapper     *rpcWrapper
                                  pendingTracker *PendingTxTracker
                                  sendTxTimeout  time.Duration
                                  rpcCallTimeout time.Duration
                              Severity: Minor
                              Found in transactions/transactor.go - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language