status-im/status-go

View on GitHub

Showing 432 of 432 total issues

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

package common

import (
    "sync"
    "time"
Severity: Major
Found in wakuv2/common/stats.go and 1 other location - About 1 day to fix
waku/common/stats.go on lines 1..118

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

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

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

func (db sqlitePersistence) buildMessagesQueryWithAdditionalFields(additionalSelectFields, whereAndTheRest string) string {
    allFields := db.tableUserMessagesAllFieldsJoin()
    if additionalSelectFields != "" {
        additionalSelectFields = "," + additionalSelectFields
    }
Severity: Major
Found in protocol/message_persistence.go - About 1 day to fix

    File gateway.pb.go has 1394 lines of code (exceeds 900 allowed). Consider refactoring.
    Open

    // Code generated by protoc-gen-go. DO NOT EDIT.
    // source: gateway.proto
    
    package cbridge
    
    
    Severity: Major
    Found in services/wallet/bridge/cbridge/gateway.pb.go - About 1 day to fix

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

      func (m *Messenger) HandleMembershipUpdateMessage(messageState *ReceivedMessageState, rawMembershipUpdate *protobuf.MembershipUpdateMessage, statusMessage *v1protocol.StatusMessage) error {
          chat, _ := messageState.AllChats.Load(rawMembershipUpdate.ChatId)
      
          return m.HandleMembershipUpdate(messageState, chat, rawMembershipUpdate, m.systemMessagesTranslations)
      }
      Severity: Major
      Found in protocol/messenger_handler.go - About 1 day to fix

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

        package common
        
        import (
            "crypto/ecdsa"
            crand "crypto/rand"
        Severity: Major
        Found in wakuv2/common/helpers.go and 1 other location - About 1 day to fix
        waku/common/helpers.go on lines 1..112

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

        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 common
        
        import (
            "crypto/ecdsa"
            crand "crypto/rand"
        Severity: Major
        Found in waku/common/helpers.go and 1 other location - About 1 day to fix
        wakuv2/common/helpers.go on lines 1..112

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

        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

        MessengerResponse has 88 methods (exceeds 21 allowed). Consider refactoring.
        Open

        type MessengerResponse struct {
            Contacts                      []*Contact
            Installations                 []*multidevice.Installation
            Invitations                   []*GroupChatInvitation
            CommunityChanges              []*communities.CommunityChanges
        Severity: Major
        Found in protocol/messenger_response.go - About 1 day to fix

          File persistence.go has 1365 lines of code (exceeds 900 allowed). Consider refactoring.
          Open

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

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

            package main
            
            import (
                "crypto/rand"
                "math/big"
            Severity: Major
            Found in cmd/spiff-workflow/signing_phrase.go and 2 other locations - About 1 day to fix
            cmd/ping-community/signing_phrase.go on lines 1..650
            cmd/populate-db/signing_phrase.go on lines 1..650

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

            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

            package main
            
            import (
                "crypto/rand"
                "math/big"
            Severity: Major
            Found in cmd/populate-db/signing_phrase.go and 2 other locations - About 1 day to fix
            cmd/ping-community/signing_phrase.go on lines 1..650
            cmd/spiff-workflow/signing_phrase.go on lines 1..650

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

            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

            package main
            
            import (
                "crypto/rand"
                "math/big"
            Severity: Major
            Found in cmd/ping-community/signing_phrase.go and 2 other locations - About 1 day to fix
            cmd/populate-db/signing_phrase.go on lines 1..650
            cmd/spiff-workflow/signing_phrase.go on lines 1..650

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

            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

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

            type API struct {
                s      *Service
                reader *Reader
                router *router.Router
            }
            Severity: Major
            Found in services/wallet/api.go - About 1 day to fix

              File backend_test.go has 1337 lines of code (exceeds 900 allowed). Consider refactoring.
              Open

              package api
              
              import (
                  "context"
                  "crypto/sha256"
              Severity: Major
              Found in api/backend_test.go - About 1 day to fix

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

                func (m *Messenger) dispatchToHandler(messageState *ReceivedMessageState, protoBytes []byte, msg *v1protocol.StatusMessage, filter transport.Filter, fromArchive bool) error {
                    switch msg.ApplicationLayer.Type {
                    
                           case protobuf.ApplicationMetadataMessage_CHAT_MESSAGE:
                        return m.handleChatMessageProtobuf(messageState, protoBytes, msg, filter, fromArchive)
                Severity: Major
                Found in protocol/messenger_handlers.go - About 1 day to fix

                  File api.go has 1308 lines of code (exceeds 900 allowed). Consider refactoring.
                  Open

                  package ext
                  
                  import (
                      "context"
                      "crypto/ecdsa"
                  Severity: Major
                  Found in services/ext/api.go - About 1 day to fix

                    Database has 76 methods (exceeds 21 allowed). Consider refactoring.
                    Open

                    type Database struct {
                        db                   *sql.DB
                        SyncQueue            chan SyncSettingField
                        changesSubscriptions []chan *SyncSettingField
                        notifier             Notifier
                    Severity: Major
                    Found in multiaccounts/settings/database.go - About 1 day to fix

                      File registrar.go has 1266 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 registrar
                      
                      
                      Severity: Major
                      Found in contracts/registrar/registrar.go - About 1 day to fix

                        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
                              Severity
                              Category
                              Status
                              Source
                              Language