Showing 512 of 512 total issues
File status.go
has 1030 lines of code (exceeds 900 allowed). Consider refactoring. Open
package statusgo
import (
"encoding/hex"
"encoding/json"
Manager
has 39 methods (exceeds 21 allowed). Consider refactoring. Open
type Manager struct {
db *sql.DB
RPCClient *rpc.Client
ContractMaker *contracts.ContractMaker
networkManager *network.Manager
OwnerWithoutCommunityKeyCommunityEventsSuite
has 37 methods (exceeds 21 allowed). Consider refactoring. Open
type OwnerWithoutCommunityKeyCommunityEventsSuite struct {
suite.Suite
controlNode *Messenger
ownerWithoutCommunityKey *Messenger
alice *Messenger
StatusNode
has 37 methods (exceeds 21 allowed). Consider refactoring. Open
type StatusNode struct {
mu sync.RWMutex
appDB *sql.DB
multiaccountsDB *multiaccounts.Database
sqlitePersistence
has 37 methods (exceeds 21 allowed). Consider refactoring. Open
func (db sqlitePersistence) DeleteActivityCenterNotificationByID(id []byte, updatedAt uint64) error {
_, err := db.db.Exec(`UPDATE activity_center_notifications SET deleted = 1, updated_at = ? WHERE id = ? AND NOT deleted`, updatedAt, id)
return err
}
MessengerStoreNodeRequestSuite
has 37 methods (exceeds 21 allowed). Consider refactoring. Open
type MessengerStoreNodeRequestSuite struct {
suite.Suite
cancel chan struct{}
MessageSender
has 37 methods (exceeds 21 allowed). Consider refactoring. Open
type MessageSender struct {
identity *ecdsa.PrivateKey
datasync *datasync.DataSync
database *sql.DB
protocol *encryption.Protocol
File message_sender.go
has 1006 lines of code (exceeds 900 allowed). Consider refactoring. Open
package common
import (
"context"
"crypto/ecdsa"
PublicResolverFilterer
has 36 methods (exceeds 21 allowed). Consider refactoring. Open
type PublicResolverFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
HopL2ArbitrumBridgeFilterer
has 36 methods (exceeds 21 allowed). Consider refactoring. Open
type HopL2ArbitrumBridgeFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
HopL2OptimismBridgeFilterer
has 36 methods (exceeds 21 allowed). Consider refactoring. Open
type HopL2OptimismBridgeFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
ManagerSuite
has 36 methods (exceeds 21 allowed). Consider refactoring. Open
type ManagerSuite struct {
suite.Suite
manager *Manager
archiveManager *ArchiveManager
}
Messenger
has 36 methods (exceeds 21 allowed). Consider refactoring. Open
func (m *Messenger) ActivityCenterNotifications(request ActivityCenterNotificationsRequest) (*ActivityCenterPaginationResponse, error) {
cursor, notifications, err := m.persistence.ActivityCenterNotifications(request.Cursor, request.Limit, request.ActivityTypes, request.ReadType, true)
if err != nil {
return nil, err
}
Identical blocks of code found in 2 locations. Consider refactoring. Open
communityItem := struct {
ID types.HexBytes `json:"id"`
MemberRole protobuf.CommunityMember_Roles `json:"memberRole"`
IsControlNode bool `json:"isControlNode"`
Verified bool `json:"verified"`
- Read upRead up
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 321.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
communityItem := struct {
ID types.HexBytes `json:"id"`
MemberRole protobuf.CommunityMember_Roles `json:"memberRole"`
IsControlNode bool `json:"isControlNode"`
Verified bool `json:"verified"`
- Read upRead up
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 321.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
SettingsAPI
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type SettingsAPI struct {
messenger **protocol.Messenger
db *accounts.Database
config *params.NodeConfig
}
MessengerContactRequestSuite
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type MessengerContactRequestSuite struct {
MessengerBaseTestSuite
}
AdminCommunityEventsSuite
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type AdminCommunityEventsSuite struct {
AdminCommunityEventsSuiteBase
}
Messenger
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
func (m *Messenger) fetchCollectibleOwner(contractAddress string, tokenID string, chainID uint64) ([]thirdparty.AccountBalance, error) {
collectibleID, err := toCollectibleUniqueID(contractAddress, tokenID, chainID)
if err != nil {
return nil, err
}
File messenger_mention_test.go
has 990 lines of code (exceeds 900 allowed). Consider refactoring. Open
package protocol
import (
"fmt"
"reflect"