status-im/status-go

View on GitHub

Showing 498 of 498 total issues

File waku.go has 1246 lines of code (exceeds 900 allowed). Consider refactoring.
Open

// Copyright 2019 The Waku Library Authors.
//
// The Waku library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
Severity: Major
Found in waku/waku.go - About 1 day to fix

    File client.go has 1239 lines of code (exceeds 900 allowed). Consider refactoring.
    Open

    package pushnotificationclient
    
    import (
        "bytes"
        "context"
    Severity: Major
    Found in protocol/pushnotificationclient/client.go - About 1 day to fix

      File CommunityTokenDeployer.go has 1223 lines of code (exceeds 900 allowed). Consider refactoring.
      Open

      // Code generated - DO NOT EDIT.
      // This file is a generated binding and any manual changes will be lost.
      
      package communitytokendeployer
      
      
      Severity: Major
      Found in contracts/community-tokens/deployer/CommunityTokenDeployer.go - About 1 day to fix

        Client has 67 methods (exceeds 21 allowed). Consider refactoring.
        Open

        type Client struct {
            persistence        *Persistence
            messagePersistence MessagePersistence
        
            config *Config
        Severity: Major
        Found in protocol/pushnotificationclient/client.go - About 1 day to fix

          File activity_test.go has 1213 lines of code (exceeds 900 allowed). Consider refactoring.
          Open

          package activity
          
          import (
              "context"
              "database/sql"
          Severity: Major
          Found in services/wallet/activity/activity_test.go - About 1 day to fix

            CelerFilterer has 66 methods (exceeds 21 allowed). Consider refactoring.
            Open

            type CelerFilterer struct {
                contract *bind.BoundContract // Generic contract wrapper for the low level calls
            }
            Severity: Major
            Found in contracts/celer/bridge.go - About 1 day to fix

              File activity_center_persistence.go has 1212 lines of code (exceeds 900 allowed). Consider refactoring.
              Open

              package protocol
              
              import (
                  "context"
                  "database/sql"
              Severity: Major
              Found in protocol/activity_center_persistence.go - About 1 day to fix

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

                func (p *Peer) handlePacket(packet p2p.Msg) error {
                    switch packet.Code {
                    case messagesCode:
                        if err := p.handleMessagesCode(packet); err != nil {
                            p.logger.Warn("failed to handle messagesCode message, peer will be disconnected", zap.String("peerID", types.EncodeHex(p.ID())), zap.Error(err))
                Severity: Major
                Found in waku/v1/peer.go and 1 other location - About 1 day to fix
                waku/v0/peer.go on lines 207..251

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

                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) handlePacket(packet p2p.Msg) error {
                    switch packet.Code {
                    case messagesCode:
                        if err := p.handleMessagesCode(packet); err != nil {
                            p.logger.Warn("failed to handle messagesCode message, peer will be disconnected", zap.String("peerID", types.EncodeHex(p.ID())), zap.Error(err))
                Severity: Major
                Found in waku/v0/peer.go and 1 other location - About 1 day to fix
                waku/v1/peer.go on lines 243..287

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

                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

                Transport has 64 methods (exceeds 21 allowed). Consider refactoring.
                Open

                type Transport struct {
                    waku        types.Waku
                    api         types.PublicWakuAPI // only PublicWakuAPI implements logic to send messages
                    keysManager *transportKeysManager
                    filters     *FiltersManager
                Severity: Major
                Found in protocol/transport/transport.go - About 1 day to fix

                  MessengerCommunitiesSuite has 63 methods (exceeds 21 allowed). Consider refactoring.
                  Open

                  type MessengerCommunitiesSuite struct {
                      suite.Suite
                      owner *Messenger
                      bob   *Messenger
                      alice *Messenger
                  Severity: Major
                  Found in protocol/communities_messenger_test.go - About 1 day to fix

                    Method Messenger.RequestImportDiscordCommunity has 682 lines of code (exceeds 500 allowed). Consider refactoring.
                    Open

                    func (m *Messenger) RequestImportDiscordCommunity(request *requests.ImportDiscordCommunity) {
                        go func() {
                    
                            totalImportChunkCount := len(request.FilesToImport)
                    
                    
                    Severity: Major
                    Found in protocol/messenger_communities_import_discord.go - About 1 day to fix

                      File uniswapv2pair.go has 1155 lines of code (exceeds 900 allowed). Consider refactoring.
                      Open

                      // Code generated - DO NOT EDIT.
                      // This file is a generated binding and any manual changes will be lost.
                      
                      package uniswapv2
                      
                      
                      Severity: Major
                      Found in contracts/uniswapV2/uniswapv2pair.go - About 1 day to fix

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

                        func ImportAccount(seedPhrase string, backend *api.GethStatusBackend) error {
                            backend.UpdateRootDataDir("./tmp")
                            manager := backend.AccountManager()
                            if err := manager.InitKeystore("./tmp"); err != nil {
                                return err
                        Severity: Major
                        Found in cmd/populate-db/main.go and 1 other location - About 1 day to fix
                        cmd/ping-community/main.go on lines 388..459

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

                        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 ImportAccount(seedPhrase string, backend *api.GethStatusBackend) error {
                            backend.UpdateRootDataDir("./tmp")
                            manager := backend.AccountManager()
                            if err := manager.InitKeystore("./tmp"); err != nil {
                                return err
                        Severity: Major
                        Found in cmd/ping-community/main.go and 1 other location - About 1 day to fix
                        cmd/populate-db/main.go on lines 437..508

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

                        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

                        CelerSession has 57 methods (exceeds 21 allowed). Consider refactoring.
                        Open

                        type CelerSession struct {
                            Contract     *Celer            // 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: Major
                        Found in contracts/celer/bridge.go - About 1 day to fix

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

                          func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derivedAddresses map[string]generator.AccountInfo, mnemonic *string) (*settings.Settings, error) {
                              chatKeyString := derivedAddresses[pathDefaultChat].PublicKey
                          
                              defaultSettings := &settings.Settings{}
                              defaultSettings.KeyUID = generatedAccountInfo.KeyUID
                          Severity: Major
                          Found in cmd/spiff-workflow/main.go and 2 other locations - About 7 hrs to fix
                          cmd/ping-community/main.go on lines 282..340
                          cmd/populate-db/main.go on lines 330..388

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

                          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 3 locations. Consider refactoring.
                          Open

                          func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derivedAddresses map[string]generator.AccountInfo, mnemonic *string) (*settings.Settings, error) {
                              chatKeyString := derivedAddresses[pathDefaultChat].PublicKey
                          
                              defaultSettings := &settings.Settings{}
                              defaultSettings.KeyUID = generatedAccountInfo.KeyUID
                          Severity: Major
                          Found in cmd/ping-community/main.go and 2 other locations - About 7 hrs to fix
                          cmd/populate-db/main.go on lines 330..388
                          cmd/spiff-workflow/main.go on lines 229..287

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

                          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 3 locations. Consider refactoring.
                          Open

                          func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derivedAddresses map[string]generator.AccountInfo, mnemonic *string) (*settings.Settings, error) {
                              chatKeyString := derivedAddresses[pathDefaultChat].PublicKey
                          
                              defaultSettings := &settings.Settings{}
                              defaultSettings.KeyUID = generatedAccountInfo.KeyUID
                          Severity: Major
                          Found in cmd/populate-db/main.go and 2 other locations - About 7 hrs to fix
                          cmd/ping-community/main.go on lines 282..340
                          cmd/spiff-workflow/main.go on lines 229..287

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

                          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

                          HopL2OptimismBridgeSession has 53 methods (exceeds 21 allowed). Consider refactoring.
                          Open

                          type HopL2OptimismBridgeSession struct {
                              Contract     *HopL2OptimismBridge // 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: Major
                          Found in contracts/hop/l2Contracts/l2OptimismBridge/l2OptimismBridge.go - About 7 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language