status-im/status-go

View on GitHub

Showing 512 of 512 total issues

Peer has 43 methods (exceeds 21 allowed). Consider refactoring.
Open

type Peer struct {
    host    common.WakuHost
    rw      p2p.MsgReadWriter
    p2pPeer *p2p.Peer
    logger  *zap.Logger
Severity: Minor
Found in waku/v1/peer.go - About 5 hrs to fix

    API has 43 methods (exceeds 21 allowed). Consider refactoring.
    Open

    type API struct {
        manager   *account.GethManager
        config    *params.NodeConfig
        db        *accounts.Database
        feed      *event.Feed
    Severity: Minor
    Found in services/accounts/accounts.go - About 5 hrs to fix

      TokenMasterCommunityEventsSuite has 43 methods (exceeds 21 allowed). Consider refactoring.
      Open

      type TokenMasterCommunityEventsSuite struct {
          suite.Suite
          controlNode *Messenger
          tokenMaster *Messenger
          alice       *Messenger
      Severity: Minor
      Found in protocol/communities_events_token_master_test.go - About 5 hrs to fix

        MessengerCommunitiesTokenPermissionsSuite has 43 methods (exceeds 21 allowed). Consider refactoring.
        Open

        type MessengerCommunitiesTokenPermissionsSuite struct {
            suite.Suite
            owner *Messenger
            bob   *Messenger
            alice *Messenger
        Severity: Minor
        Found in protocol/communities_messenger_token_permissions_test.go - About 5 hrs to fix

          HopL1HopBridgeFilterer has 42 methods (exceeds 21 allowed). Consider refactoring.
          Open

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

            HopL1EthBridgeFilterer has 42 methods (exceeds 21 allowed). Consider refactoring.
            Open

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

              Peer has 42 methods (exceeds 21 allowed). Consider refactoring.
              Open

              type Peer struct {
                  host    common.WakuHost
                  rw      p2p.MsgReadWriter
                  p2pPeer *p2p.Peer
                  logger  *zap.Logger
              Severity: Minor
              Found in waku/v0/peer.go - About 5 hrs to fix

                HopL1Erc20BridgeFilterer has 42 methods (exceeds 21 allowed). Consider refactoring.
                Open

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

                  NimbusPublicAPI has 42 methods (exceeds 21 allowed). Consider refactoring.
                  Open

                  type NimbusPublicAPI struct {
                      service   *NimbusService
                      publicAPI types.PublicWhisperAPI
                      log       log.Logger
                  }
                  Severity: Minor
                  Found in services/shhext/api_nimbus.go - About 5 hrs to fix

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

                    type Service struct {
                        manager         *Manager
                        accountsManager *account.GethManager
                        pendingTracker  *transactions.PendingTxTracker
                        config          *params.NodeConfig
                    Severity: Minor
                    Found in services/communitytokens/service.go - About 5 hrs to fix

                      CommunitySuite has 42 methods (exceeds 21 allowed). Consider refactoring.
                      Open

                      type CommunitySuite struct {
                          suite.Suite
                      
                          identity    *ecdsa.PrivateKey
                          communityID []byte
                      Severity: Minor
                      Found in protocol/communities/community_test.go - About 5 hrs to fix

                        Protocol has 41 methods (exceeds 21 allowed). Consider refactoring.
                        Open

                        type Protocol struct {
                            encryptor     *encryptor
                            secret        *sharedsecret.SharedSecret
                            multidevice   *multidevice.Multidevice
                            publisher     *publisher.Publisher
                        Severity: Minor
                        Found in protocol/encryption/protocol.go - About 5 hrs to fix

                          sqlitePersistence has 41 methods (exceeds 21 allowed). Consider refactoring.
                          Open

                          type sqlitePersistence struct {
                              *common.RawMessagesPersistence
                              db *sql.DB
                          }
                          Severity: Minor
                          Found in protocol/persistence.go - About 5 hrs to fix

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

                            func (m *Messenger) prepareMutualStateUpdateMessage(contactID string, updateType MutualStateUpdateType, clock uint64, timestamp uint64, outgoing bool) (*common.Message, error) {
                                var text string
                                var to string
                                var from string
                                var contentType protobuf.ChatMessage_ContentType
                            Severity: Minor
                            Found in protocol/messenger_contacts.go - About 5 hrs to fix

                              File messenger_contact_requests_test.go has 1035 lines of code (exceeds 900 allowed). Consider refactoring.
                              Open

                              package protocol
                              
                              import (
                                  "context"
                                  "fmt"
                              Severity: Major
                              Found in protocol/messenger_contact_requests_test.go - About 5 hrs to fix

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

                                func (p *Peer) broadcast() error {
                                    envelopes := p.host.Envelopes()
                                    bundle := make([]*common.Envelope, 0, len(envelopes))
                                    for _, envelope := range envelopes {
                                        if !p.Marked(envelope) && envelope.PoW() >= p.powRequirement && p.topicOrBloomMatch(envelope) {
                                Severity: Major
                                Found in waku/v1/peer.go and 1 other location - About 5 hrs to fix
                                waku/v0/peer.go on lines 535..569

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

                                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) broadcast() error {
                                    envelopes := p.host.Envelopes()
                                    bundle := make([]*common.Envelope, 0, len(envelopes))
                                    for _, envelope := range envelopes {
                                        if !p.Marked(envelope) && envelope.PoW() >= p.powRequirement && p.topicOrBloomMatch(envelope) {
                                Severity: Major
                                Found in waku/v0/peer.go and 1 other location - About 5 hrs to fix
                                waku/v1/peer.go on lines 576..610

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

                                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

                                UsernameRegistrarSession has 40 methods (exceeds 21 allowed). Consider refactoring.
                                Open

                                type UsernameRegistrarSession struct {
                                    Contract     *UsernameRegistrar // 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/registrar/registrar.go - About 5 hrs to fix

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

                                  func (p *Peer) handleP2PRequestCode(packet p2p.Msg) error {
                                      // Must be processed if mail server is implemented. Otherwise ignore.
                                      if !p.host.Mailserver() {
                                          return nil
                                      }
                                  Severity: Major
                                  Found in waku/v0/peer.go and 1 other location - About 5 hrs to fix
                                  waku/v1/peer.go on lines 332..367

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

                                  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) handleP2PRequestCode(packet p2p.Msg) error {
                                      // Must be processed if mail server is implemented. Otherwise ignore.
                                      if !p.host.Mailserver() {
                                          return nil
                                      }
                                  Severity: Major
                                  Found in waku/v1/peer.go and 1 other location - About 5 hrs to fix
                                  waku/v0/peer.go on lines 296..331

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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language