Showing 551 of 551 total issues
MockRPSLimitedEthClientInterface
has 35 methods (exceeds 21 allowed). Consider refactoring. Open
type MockRPSLimitedEthClientInterface struct {
ctrl *gomock.Controller
recorder *MockRPSLimitedEthClientInterfaceMockRecorder
}
MockRPSLimitedEthClientInterfaceMockRecorder
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type MockRPSLimitedEthClientInterfaceMockRecorder struct {
mock *MockRPSLimitedEthClientInterface
}
SettingsAPI
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type SettingsAPI struct {
messenger **protocol.Messenger
db *accounts.Database
config *params.NodeConfig
}
Messenger
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
func (m *Messenger) shouldSync() (bool, error) {
// TODO (pablo) support community store node as well
if m.mailserverCycle.activeMailserver == nil || !m.Online() {
return false, nil
}
AdminCommunityEventsSuite
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type AdminCommunityEventsSuite struct {
EventSenderCommunityEventsSuiteBase
}
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
}
MessengerContactRequestSuite
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type MessengerContactRequestSuite struct {
MessengerBaseTestSuite
}
TokenMasterCommunityEventsSuite
has 34 methods (exceeds 21 allowed). Consider refactoring. Open
type TokenMasterCommunityEventsSuite struct {
EventSenderCommunityEventsSuiteBase
}
File messenger_storenode_request_test.go
has 989 lines of code (exceeds 900 allowed). Consider refactoring. Open
package protocol
import (
"context"
"fmt"
File OwnerToken.go
has 986 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 ownertoken
File messenger_mailserver.go
has 986 lines of code (exceeds 900 allowed). Consider refactoring. Open
package protocol
import (
"context"
"fmt"
Manager
has 33 methods (exceeds 21 allowed). Consider refactoring. Open
type Manager struct {
balancefetcher.BalanceFetcher
db *sql.DB
RPCClient rpc.ClientInterface
ContractMaker *contracts.ContractMaker
MockEthClientInterface
has 32 methods (exceeds 21 allowed). Consider refactoring. Open
type MockEthClientInterface struct {
ctrl *gomock.Controller
recorder *MockEthClientInterfaceMockRecorder
}
MessengerSignalsHandler
has 32 methods (exceeds 21 allowed). Consider refactoring. Open
type MessengerSignalsHandler struct{}
File Collectibles.go
has 971 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 collectibles
CelerTransactor
has 31 methods (exceeds 21 allowed). Consider refactoring. Open
type CelerTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
CelerTransactorSession
has 31 methods (exceeds 21 allowed). Consider refactoring. Open
type CelerTransactorSession struct {
Contract *CelerTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
MockEthClientInterfaceMockRecorder
has 31 methods (exceeds 21 allowed). Consider refactoring. Open
type MockEthClientInterfaceMockRecorder struct {
mock *MockEthClientInterface
}
Contact
has 31 methods (exceeds 21 allowed). Consider refactoring. Open
func (c *Contact) CanonicalImage(profilePicturesVisibility settings.ProfilePicturesVisibilityType) string {
if profilePicturesVisibility == settings.ProfilePicturesVisibilityNone || (profilePicturesVisibility == settings.ProfilePicturesVisibilityContactsOnly && !c.added()) {
return c.Identicon
}
Identical blocks of code found in 2 locations. Consider refactoring. Open
var bytesToTopicTests = []struct {
data []byte
topic TopicType
}{
{topic: TopicType{0x8f, 0x9a, 0x2b, 0x7d}, data: []byte{0x8f, 0x9a, 0x2b, 0x7d}},
- 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 289.
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