aergoio/aergo

View on GitHub

Showing 1,051 of 1,052 total issues

Similar blocks of code found in 42 locations. Consider refactoring.
Open

func (mr *MockRemotePeerMockRecorder) SendAndWaitMessage(msg, ttl interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAndWaitMessage", reflect.TypeOf((*MockRemotePeer)(nil).SendAndWaitMessage), msg, ttl)
}
Severity: Major
Found in p2p/p2pmock/mock_remotepeer.go and 41 other locations - About 45 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 58..61
p2p/p2pmock/mock_actorcontext.go on lines 176..179
p2p/p2pmock/mock_actorcontext.go on lines 283..286
p2p/p2pmock/mock_actorcontext.go on lines 297..300
p2p/p2pmock/mock_actorcontext.go on lines 321..324
p2p/p2pmock/mock_actorservice.go on lines 45..48
p2p/p2pmock/mock_actorservice.go on lines 57..60
p2p/p2pmock/mock_actorservice.go on lines 87..90
p2p/p2pmock/mock_actorservice.go on lines 115..118
p2p/p2pmock/mock_consensus.go on lines 200..203
p2p/p2pmock/mock_handshake.go on lines 49..52
p2p/p2pmock/mock_handshake.go on lines 87..90
p2p/p2pmock/mock_host.go on lines 94..97
p2p/p2pmock/mock_host.go on lines 208..211
p2p/p2pmock/mock_listmanager.go on lines 71..74
p2p/p2pmock/mock_message.go on lines 242..245
p2p/p2pmock/mock_message.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 278..281
p2p/p2pmock/mock_message.go on lines 325..328
p2p/p2pmock/mock_message.go on lines 362..365
p2p/p2pmock/mock_message.go on lines 425..428
p2p/p2pmock/mock_metricsman.go on lines 70..73
p2p/p2pmock/mock_metricsman.go on lines 84..87
p2p/p2pmock/mock_msgio.go on lines 121..124
p2p/p2pmock/mock_msgio.go on lines 133..136
p2p/p2pmock/mock_msgorder.go on lines 250..253
p2p/p2pmock/mock_networktransport.go on lines 118..121
p2p/p2pmock/mock_networktransport.go on lines 188..191
p2p/p2pmock/mock_networktransport.go on lines 384..387
p2p/p2pmock/mock_peermanager.go on lines 220..223
p2p/p2pmock/mock_peerrole.go on lines 68..71
p2p/p2pmock/mock_peerrole.go on lines 110..113
p2p/p2pmock/mock_peerrole.go on lines 138..141
p2p/p2pmock/mock_remotepeer.go on lines 192..195
p2p/p2pmock/mock_remotepeer.go on lines 337..340
p2p/p2pmock/mock_remotepeer.go on lines 363..366
p2p/p2pmock/mock_syncmanager.go on lines 45..48
p2p/p2pmock/mock_syncmanager.go on lines 83..86
p2p/p2pmock/mock_syncmanager.go on lines 119..122
p2p/p2pmock/mock_txnotice.go on lines 55..58
p2p/p2pmock/mock_txnotice.go on lines 67..70

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

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

Similar blocks of code found in 42 locations. Consider refactoring.
Open

func (mr *MockContextMockRecorder) SpawnNamed(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpawnNamed", reflect.TypeOf((*MockContext)(nil).SpawnNamed), arg0, arg1)
}
Severity: Major
Found in p2p/p2pmock/mock_actorcontext.go and 41 other locations - About 45 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 58..61
p2p/p2pmock/mock_actorcontext.go on lines 176..179
p2p/p2pmock/mock_actorcontext.go on lines 297..300
p2p/p2pmock/mock_actorcontext.go on lines 321..324
p2p/p2pmock/mock_actorservice.go on lines 45..48
p2p/p2pmock/mock_actorservice.go on lines 57..60
p2p/p2pmock/mock_actorservice.go on lines 87..90
p2p/p2pmock/mock_actorservice.go on lines 115..118
p2p/p2pmock/mock_consensus.go on lines 200..203
p2p/p2pmock/mock_handshake.go on lines 49..52
p2p/p2pmock/mock_handshake.go on lines 87..90
p2p/p2pmock/mock_host.go on lines 94..97
p2p/p2pmock/mock_host.go on lines 208..211
p2p/p2pmock/mock_listmanager.go on lines 71..74
p2p/p2pmock/mock_message.go on lines 242..245
p2p/p2pmock/mock_message.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 278..281
p2p/p2pmock/mock_message.go on lines 325..328
p2p/p2pmock/mock_message.go on lines 362..365
p2p/p2pmock/mock_message.go on lines 425..428
p2p/p2pmock/mock_metricsman.go on lines 70..73
p2p/p2pmock/mock_metricsman.go on lines 84..87
p2p/p2pmock/mock_msgio.go on lines 121..124
p2p/p2pmock/mock_msgio.go on lines 133..136
p2p/p2pmock/mock_msgorder.go on lines 250..253
p2p/p2pmock/mock_networktransport.go on lines 118..121
p2p/p2pmock/mock_networktransport.go on lines 188..191
p2p/p2pmock/mock_networktransport.go on lines 384..387
p2p/p2pmock/mock_peermanager.go on lines 220..223
p2p/p2pmock/mock_peerrole.go on lines 68..71
p2p/p2pmock/mock_peerrole.go on lines 110..113
p2p/p2pmock/mock_peerrole.go on lines 138..141
p2p/p2pmock/mock_remotepeer.go on lines 192..195
p2p/p2pmock/mock_remotepeer.go on lines 284..287
p2p/p2pmock/mock_remotepeer.go on lines 337..340
p2p/p2pmock/mock_remotepeer.go on lines 363..366
p2p/p2pmock/mock_syncmanager.go on lines 45..48
p2p/p2pmock/mock_syncmanager.go on lines 83..86
p2p/p2pmock/mock_syncmanager.go on lines 119..122
p2p/p2pmock/mock_txnotice.go on lines 55..58
p2p/p2pmock/mock_txnotice.go on lines 67..70

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

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

Similar blocks of code found in 42 locations. Consider refactoring.
Open

func (mr *MockMetricsManagerMockRecorder) NewMetric(pid, manNum interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewMetric", reflect.TypeOf((*MockMetricsManager)(nil).NewMetric), pid, manNum)
}
Severity: Major
Found in p2p/p2pmock/mock_metricsman.go and 41 other locations - About 45 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 58..61
p2p/p2pmock/mock_actorcontext.go on lines 176..179
p2p/p2pmock/mock_actorcontext.go on lines 283..286
p2p/p2pmock/mock_actorcontext.go on lines 297..300
p2p/p2pmock/mock_actorcontext.go on lines 321..324
p2p/p2pmock/mock_actorservice.go on lines 45..48
p2p/p2pmock/mock_actorservice.go on lines 57..60
p2p/p2pmock/mock_actorservice.go on lines 87..90
p2p/p2pmock/mock_actorservice.go on lines 115..118
p2p/p2pmock/mock_consensus.go on lines 200..203
p2p/p2pmock/mock_handshake.go on lines 49..52
p2p/p2pmock/mock_handshake.go on lines 87..90
p2p/p2pmock/mock_host.go on lines 94..97
p2p/p2pmock/mock_host.go on lines 208..211
p2p/p2pmock/mock_listmanager.go on lines 71..74
p2p/p2pmock/mock_message.go on lines 242..245
p2p/p2pmock/mock_message.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 278..281
p2p/p2pmock/mock_message.go on lines 325..328
p2p/p2pmock/mock_message.go on lines 362..365
p2p/p2pmock/mock_message.go on lines 425..428
p2p/p2pmock/mock_metricsman.go on lines 84..87
p2p/p2pmock/mock_msgio.go on lines 121..124
p2p/p2pmock/mock_msgio.go on lines 133..136
p2p/p2pmock/mock_msgorder.go on lines 250..253
p2p/p2pmock/mock_networktransport.go on lines 118..121
p2p/p2pmock/mock_networktransport.go on lines 188..191
p2p/p2pmock/mock_networktransport.go on lines 384..387
p2p/p2pmock/mock_peermanager.go on lines 220..223
p2p/p2pmock/mock_peerrole.go on lines 68..71
p2p/p2pmock/mock_peerrole.go on lines 110..113
p2p/p2pmock/mock_peerrole.go on lines 138..141
p2p/p2pmock/mock_remotepeer.go on lines 192..195
p2p/p2pmock/mock_remotepeer.go on lines 284..287
p2p/p2pmock/mock_remotepeer.go on lines 337..340
p2p/p2pmock/mock_remotepeer.go on lines 363..366
p2p/p2pmock/mock_syncmanager.go on lines 45..48
p2p/p2pmock/mock_syncmanager.go on lines 83..86
p2p/p2pmock/mock_syncmanager.go on lines 119..122
p2p/p2pmock/mock_txnotice.go on lines 55..58
p2p/p2pmock/mock_txnotice.go on lines 67..70

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

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

Similar blocks of code found in 42 locations. Consider refactoring.
Open

func (mr *MockPeerManagerMockRecorder) GetPeerAddresses(noHidden, showSelf interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerAddresses", reflect.TypeOf((*MockPeerManager)(nil).GetPeerAddresses), noHidden, showSelf)
}
Severity: Major
Found in p2p/p2pmock/mock_peermanager.go and 41 other locations - About 45 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 58..61
p2p/p2pmock/mock_actorcontext.go on lines 176..179
p2p/p2pmock/mock_actorcontext.go on lines 283..286
p2p/p2pmock/mock_actorcontext.go on lines 297..300
p2p/p2pmock/mock_actorcontext.go on lines 321..324
p2p/p2pmock/mock_actorservice.go on lines 45..48
p2p/p2pmock/mock_actorservice.go on lines 57..60
p2p/p2pmock/mock_actorservice.go on lines 87..90
p2p/p2pmock/mock_actorservice.go on lines 115..118
p2p/p2pmock/mock_consensus.go on lines 200..203
p2p/p2pmock/mock_handshake.go on lines 49..52
p2p/p2pmock/mock_handshake.go on lines 87..90
p2p/p2pmock/mock_host.go on lines 94..97
p2p/p2pmock/mock_host.go on lines 208..211
p2p/p2pmock/mock_listmanager.go on lines 71..74
p2p/p2pmock/mock_message.go on lines 242..245
p2p/p2pmock/mock_message.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 278..281
p2p/p2pmock/mock_message.go on lines 325..328
p2p/p2pmock/mock_message.go on lines 362..365
p2p/p2pmock/mock_message.go on lines 425..428
p2p/p2pmock/mock_metricsman.go on lines 70..73
p2p/p2pmock/mock_metricsman.go on lines 84..87
p2p/p2pmock/mock_msgio.go on lines 121..124
p2p/p2pmock/mock_msgio.go on lines 133..136
p2p/p2pmock/mock_msgorder.go on lines 250..253
p2p/p2pmock/mock_networktransport.go on lines 118..121
p2p/p2pmock/mock_networktransport.go on lines 188..191
p2p/p2pmock/mock_networktransport.go on lines 384..387
p2p/p2pmock/mock_peerrole.go on lines 68..71
p2p/p2pmock/mock_peerrole.go on lines 110..113
p2p/p2pmock/mock_peerrole.go on lines 138..141
p2p/p2pmock/mock_remotepeer.go on lines 192..195
p2p/p2pmock/mock_remotepeer.go on lines 284..287
p2p/p2pmock/mock_remotepeer.go on lines 337..340
p2p/p2pmock/mock_remotepeer.go on lines 363..366
p2p/p2pmock/mock_syncmanager.go on lines 45..48
p2p/p2pmock/mock_syncmanager.go on lines 83..86
p2p/p2pmock/mock_syncmanager.go on lines 119..122
p2p/p2pmock/mock_txnotice.go on lines 55..58
p2p/p2pmock/mock_txnotice.go on lines 67..70

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

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

Similar blocks of code found in 42 locations. Consider refactoring.
Open

func (mr *MockMoFactoryMockRecorder) NewRaftMsgOrder(msgType, raftMsg interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewRaftMsgOrder", reflect.TypeOf((*MockMoFactory)(nil).NewRaftMsgOrder), msgType, raftMsg)
}
Severity: Major
Found in p2p/p2pmock/mock_msgorder.go and 41 other locations - About 45 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 58..61
p2p/p2pmock/mock_actorcontext.go on lines 176..179
p2p/p2pmock/mock_actorcontext.go on lines 283..286
p2p/p2pmock/mock_actorcontext.go on lines 297..300
p2p/p2pmock/mock_actorcontext.go on lines 321..324
p2p/p2pmock/mock_actorservice.go on lines 45..48
p2p/p2pmock/mock_actorservice.go on lines 57..60
p2p/p2pmock/mock_actorservice.go on lines 87..90
p2p/p2pmock/mock_actorservice.go on lines 115..118
p2p/p2pmock/mock_consensus.go on lines 200..203
p2p/p2pmock/mock_handshake.go on lines 49..52
p2p/p2pmock/mock_handshake.go on lines 87..90
p2p/p2pmock/mock_host.go on lines 94..97
p2p/p2pmock/mock_host.go on lines 208..211
p2p/p2pmock/mock_listmanager.go on lines 71..74
p2p/p2pmock/mock_message.go on lines 242..245
p2p/p2pmock/mock_message.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 278..281
p2p/p2pmock/mock_message.go on lines 325..328
p2p/p2pmock/mock_message.go on lines 362..365
p2p/p2pmock/mock_message.go on lines 425..428
p2p/p2pmock/mock_metricsman.go on lines 70..73
p2p/p2pmock/mock_metricsman.go on lines 84..87
p2p/p2pmock/mock_msgio.go on lines 121..124
p2p/p2pmock/mock_msgio.go on lines 133..136
p2p/p2pmock/mock_networktransport.go on lines 118..121
p2p/p2pmock/mock_networktransport.go on lines 188..191
p2p/p2pmock/mock_networktransport.go on lines 384..387
p2p/p2pmock/mock_peermanager.go on lines 220..223
p2p/p2pmock/mock_peerrole.go on lines 68..71
p2p/p2pmock/mock_peerrole.go on lines 110..113
p2p/p2pmock/mock_peerrole.go on lines 138..141
p2p/p2pmock/mock_remotepeer.go on lines 192..195
p2p/p2pmock/mock_remotepeer.go on lines 284..287
p2p/p2pmock/mock_remotepeer.go on lines 337..340
p2p/p2pmock/mock_remotepeer.go on lines 363..366
p2p/p2pmock/mock_syncmanager.go on lines 45..48
p2p/p2pmock/mock_syncmanager.go on lines 83..86
p2p/p2pmock/mock_syncmanager.go on lines 119..122
p2p/p2pmock/mock_txnotice.go on lines 55..58
p2p/p2pmock/mock_txnotice.go on lines 67..70

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvListBlockMetadata(msg *types.BlockMetadataList) *InOutBlockMetadataList {
    if msg == nil {
        return nil
    }

Severity: Major
Found in types/jsonrpc/block.go and 6 other locations - About 40 mins to fix
types/jsonrpc/account.go on lines 24..36
types/jsonrpc/block.go on lines 105..116
types/jsonrpc/commit.go on lines 8..18
types/jsonrpc/rpc.go on lines 13..24
types/jsonrpc/rpc.go on lines 96..107
types/jsonrpc/rpc.go on lines 169..180

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvPeerList(msg *types.PeerList) *InOutPeerList {
    if msg == nil {
        return nil
    }

Severity: Major
Found in types/jsonrpc/rpc.go and 6 other locations - About 40 mins to fix
types/jsonrpc/account.go on lines 24..36
types/jsonrpc/block.go on lines 105..116
types/jsonrpc/block.go on lines 165..177
types/jsonrpc/commit.go on lines 8..18
types/jsonrpc/rpc.go on lines 96..107
types/jsonrpc/rpc.go on lines 169..180

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvMetrics(msg *types.Metrics) *InOutMetrics {
    if msg == nil {
        return nil
    }

Severity: Major
Found in types/jsonrpc/rpc.go and 6 other locations - About 40 mins to fix
types/jsonrpc/account.go on lines 24..36
types/jsonrpc/block.go on lines 105..116
types/jsonrpc/block.go on lines 165..177
types/jsonrpc/commit.go on lines 8..18
types/jsonrpc/rpc.go on lines 13..24
types/jsonrpc/rpc.go on lines 96..107

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvAccounts(msg *types.AccountList) *InOutAccountList {
    if msg == nil {
        return nil
    }

Severity: Major
Found in types/jsonrpc/account.go and 6 other locations - About 40 mins to fix
types/jsonrpc/block.go on lines 105..116
types/jsonrpc/block.go on lines 165..177
types/jsonrpc/commit.go on lines 8..18
types/jsonrpc/rpc.go on lines 13..24
types/jsonrpc/rpc.go on lines 96..107
types/jsonrpc/rpc.go on lines 169..180

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvLongPeerList(msg *types.PeerList) *InOutLongPeerList {
    if msg == nil {
        return nil
    }

Severity: Major
Found in types/jsonrpc/rpc.go and 6 other locations - About 40 mins to fix
types/jsonrpc/account.go on lines 24..36
types/jsonrpc/block.go on lines 105..116
types/jsonrpc/block.go on lines 165..177
types/jsonrpc/commit.go on lines 8..18
types/jsonrpc/rpc.go on lines 13..24
types/jsonrpc/rpc.go on lines 169..180

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

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

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

/*
 * @file
 * @copyright defined in aergo/LICENSE.txt
 */

Severity: Major
Found in cmd/colaris/cmd/version.go and 2 other locations - About 40 mins to fix
cmd/aergosvr/version.go on lines 1..19
cmd/polaris/version.go on lines 1..24

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

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

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

/*
 * @file
 * @copyright defined in aergo/LICENSE.txt
 */

Severity: Major
Found in cmd/polaris/version.go and 2 other locations - About 40 mins to fix
cmd/aergosvr/version.go on lines 1..19
cmd/colaris/cmd/version.go on lines 1..24

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvCommitResultList(msg *types.CommitResultList) *InOutCommitResultList {
    if msg == nil {
        return nil
    }
    c := &InOutCommitResultList{}
Severity: Major
Found in types/jsonrpc/commit.go and 6 other locations - About 40 mins to fix
types/jsonrpc/account.go on lines 24..36
types/jsonrpc/block.go on lines 105..116
types/jsonrpc/block.go on lines 165..177
types/jsonrpc/rpc.go on lines 13..24
types/jsonrpc/rpc.go on lines 96..107
types/jsonrpc/rpc.go on lines 169..180

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

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

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

package main

import "github.com/spf13/cobra"

var githash = "No git hash provided"
Severity: Major
Found in cmd/aergosvr/version.go and 2 other locations - About 40 mins to fix
cmd/colaris/cmd/version.go on lines 1..24
cmd/polaris/version.go on lines 1..24

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

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

Similar blocks of code found in 7 locations. Consider refactoring.
Open

func ConvBlockHeaderList(msg *types.BlockHeaderList) *InOutBlockHeaderList {
    if msg == nil {
        return nil
    }

Severity: Major
Found in types/jsonrpc/block.go and 6 other locations - About 40 mins to fix
types/jsonrpc/account.go on lines 24..36
types/jsonrpc/block.go on lines 165..177
types/jsonrpc/commit.go on lines 8..18
types/jsonrpc/rpc.go on lines 13..24
types/jsonrpc/rpc.go on lines 96..107
types/jsonrpc/rpc.go on lines 169..180

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

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

Similar blocks of code found in 95 locations. Consider refactoring.
Open

func (mr *MockContextMockRecorder) Forward(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Forward", reflect.TypeOf((*MockContext)(nil).Forward), arg0)
}
Severity: Major
Found in p2p/p2pmock/mock_actorcontext.go and 94 other locations - About 40 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 150..153
p2p/p2pmock/mock_actorcontext.go on lines 202..205
p2p/p2pmock/mock_actorcontext.go on lines 242..245
p2p/p2pmock/mock_actorcontext.go on lines 254..257
p2p/p2pmock/mock_actorcontext.go on lines 268..271
p2p/p2pmock/mock_actorcontext.go on lines 333..336
p2p/p2pmock/mock_actorcontext.go on lines 345..348
p2p/p2pmock/mock_certificate.go on lines 44..47
p2p/p2pmock/mock_certificate.go on lines 58..61
p2p/p2pmock/mock_certificate.go on lines 73..76
p2p/p2pmock/mock_certificate.go on lines 113..116
p2p/p2pmock/mock_certificate.go on lines 125..128
p2p/p2pmock/mock_chainaccessor.go on lines 46..49
p2p/p2pmock/mock_chainaccessor.go on lines 76..79
p2p/p2pmock/mock_chainaccessor.go on lines 119..122
p2p/p2pmock/mock_chainaccessor.go on lines 148..151
p2p/p2pmock/mock_chainaccessor.go on lines 163..166
p2p/p2pmock/mock_consensus.go on lines 51..54
p2p/p2pmock/mock_consensus.go on lines 66..69
p2p/p2pmock/mock_consensus.go on lines 81..84
p2p/p2pmock/mock_consensus.go on lines 146..149
p2p/p2pmock/mock_consensus.go on lines 160..163
p2p/p2pmock/mock_consensus.go on lines 174..177
p2p/p2pmock/mock_consensus.go on lines 212..215
p2p/p2pmock/mock_handshake.go on lines 124..127
p2p/p2pmock/mock_handshake.go on lines 167..170
p2p/p2pmock/mock_handshake.go on lines 205..208
p2p/p2pmock/mock_handshake.go on lines 220..223
p2p/p2pmock/mock_host.go on lines 196..199
p2p/p2pmock/mock_io.go on lines 45..48
p2p/p2pmock/mock_io.go on lines 97..100
p2p/p2pmock/mock_io.go on lines 135..138
p2p/p2pmock/mock_io.go on lines 187..190
p2p/p2pmock/mock_io.go on lines 239..242
p2p/p2pmock/mock_io.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 213..216
p2p/p2pmock/mock_message.go on lines 228..231
p2p/p2pmock/mock_message.go on lines 411..414
p2p/p2pmock/mock_metricsman.go on lines 99..102
p2p/p2pmock/mock_msgio.go on lines 60..63
p2p/p2pmock/mock_msgio.go on lines 86..89
p2p/p2pmock/mock_msgorder.go on lines 117..120
p2p/p2pmock/mock_msgorder.go on lines 129..132
p2p/p2pmock/mock_msgorder.go on lines 208..211
p2p/p2pmock/mock_msgorder.go on lines 222..225
p2p/p2pmock/mock_msgorder.go on lines 236..239
p2p/p2pmock/mock_msgorder.go on lines 264..267
p2p/p2pmock/mock_networktransport.go on lines 160..163
p2p/p2pmock/mock_networktransport.go on lines 216..219
p2p/p2pmock/mock_networktransport.go on lines 230..233
p2p/p2pmock/mock_networktransport.go on lines 358..361
p2p/p2pmock/mock_peerfinder.go on lines 45..48
p2p/p2pmock/mock_peerfinder.go on lines 57..60
p2p/p2pmock/mock_peerfinder.go on lines 92..95
p2p/p2pmock/mock_peerfinder.go on lines 104..107
p2p/p2pmock/mock_peerfinder.go on lines 151..154
p2p/p2pmock/mock_peerfinder.go on lines 163..166
p2p/p2pmock/mock_peerfinder.go on lines 177..180
p2p/p2pmock/mock_peerfinder.go on lines 189..192
p2p/p2pmock/mock_peerfinder.go on lines 213..216
p2p/p2pmock/mock_peerfinder.go on lines 225..228
p2p/p2pmock/mock_peermanager.go on lines 45..48
p2p/p2pmock/mock_peermanager.go on lines 113..116
p2p/p2pmock/mock_peermanager.go on lines 125..128
p2p/p2pmock/mock_peermanager.go on lines 137..140
p2p/p2pmock/mock_peermanager.go on lines 149..152
p2p/p2pmock/mock_peermanager.go on lines 164..167
p2p/p2pmock/mock_peermanager.go on lines 246..249
p2p/p2pmock/mock_peermanager.go on lines 258..261
p2p/p2pmock/mock_peerrole.go on lines 96..99
p2p/p2pmock/mock_protobuf.go on lines 61..64
p2p/p2pmock/mock_protobuf.go on lines 75..78
p2p/p2pmock/mock_protobuf.go on lines 89..92
p2p/p2pmock/mock_protobuf.go on lines 103..106
p2p/p2pmock/mock_protobuf.go on lines 117..120
p2p/p2pmock/mock_protobuf.go on lines 129..132
p2p/p2pmock/mock_remotepeer.go on lines 180..183
p2p/p2pmock/mock_remotepeer.go on lines 256..259
p2p/p2pmock/mock_remotepeer.go on lines 270..273
p2p/p2pmock/mock_remotepeer.go on lines 296..299
p2p/p2pmock/mock_remotepeer.go on lines 309..312
p2p/p2pmock/mock_remotepeer.go on lines 323..326
p2p/p2pmock/mock_remotepeer.go on lines 351..354
p2p/p2pmock/mock_remotepeer.go on lines 389..392
p2p/p2pmock/mock_remotepeer.go on lines 403..406
p2p/p2pmock/mock_stream.go on lines 136..139
p2p/p2pmock/mock_stream.go on lines 164..167
p2p/p2pmock/mock_stream.go on lines 176..179
p2p/p2pmock/mock_stream.go on lines 190..193
p2p/p2pmock/mock_stream.go on lines 204..207
p2p/p2pmock/mock_stream.go on lines 233..236
p2p/p2pmock/mock_stream.go on lines 355..358
p2p/p2pmock/mock_syncmanager.go on lines 107..110
p2p/p2pmock/mock_syncmanager.go on lines 195..198

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

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

Similar blocks of code found in 95 locations. Consider refactoring.
Open

func (mr *MockCertificateManagerMockRecorder) AddCertificate(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddCertificate", reflect.TypeOf((*MockCertificateManager)(nil).AddCertificate), arg0)
}
Severity: Major
Found in p2p/p2pmock/mock_certificate.go and 94 other locations - About 40 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 84..87
p2p/p2pmock/mock_actorcontext.go on lines 150..153
p2p/p2pmock/mock_actorcontext.go on lines 202..205
p2p/p2pmock/mock_actorcontext.go on lines 242..245
p2p/p2pmock/mock_actorcontext.go on lines 254..257
p2p/p2pmock/mock_actorcontext.go on lines 268..271
p2p/p2pmock/mock_actorcontext.go on lines 333..336
p2p/p2pmock/mock_actorcontext.go on lines 345..348
p2p/p2pmock/mock_certificate.go on lines 58..61
p2p/p2pmock/mock_certificate.go on lines 73..76
p2p/p2pmock/mock_certificate.go on lines 113..116
p2p/p2pmock/mock_certificate.go on lines 125..128
p2p/p2pmock/mock_chainaccessor.go on lines 46..49
p2p/p2pmock/mock_chainaccessor.go on lines 76..79
p2p/p2pmock/mock_chainaccessor.go on lines 119..122
p2p/p2pmock/mock_chainaccessor.go on lines 148..151
p2p/p2pmock/mock_chainaccessor.go on lines 163..166
p2p/p2pmock/mock_consensus.go on lines 51..54
p2p/p2pmock/mock_consensus.go on lines 66..69
p2p/p2pmock/mock_consensus.go on lines 81..84
p2p/p2pmock/mock_consensus.go on lines 146..149
p2p/p2pmock/mock_consensus.go on lines 160..163
p2p/p2pmock/mock_consensus.go on lines 174..177
p2p/p2pmock/mock_consensus.go on lines 212..215
p2p/p2pmock/mock_handshake.go on lines 124..127
p2p/p2pmock/mock_handshake.go on lines 167..170
p2p/p2pmock/mock_handshake.go on lines 205..208
p2p/p2pmock/mock_handshake.go on lines 220..223
p2p/p2pmock/mock_host.go on lines 196..199
p2p/p2pmock/mock_io.go on lines 45..48
p2p/p2pmock/mock_io.go on lines 97..100
p2p/p2pmock/mock_io.go on lines 135..138
p2p/p2pmock/mock_io.go on lines 187..190
p2p/p2pmock/mock_io.go on lines 239..242
p2p/p2pmock/mock_io.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 213..216
p2p/p2pmock/mock_message.go on lines 228..231
p2p/p2pmock/mock_message.go on lines 411..414
p2p/p2pmock/mock_metricsman.go on lines 99..102
p2p/p2pmock/mock_msgio.go on lines 60..63
p2p/p2pmock/mock_msgio.go on lines 86..89
p2p/p2pmock/mock_msgorder.go on lines 117..120
p2p/p2pmock/mock_msgorder.go on lines 129..132
p2p/p2pmock/mock_msgorder.go on lines 208..211
p2p/p2pmock/mock_msgorder.go on lines 222..225
p2p/p2pmock/mock_msgorder.go on lines 236..239
p2p/p2pmock/mock_msgorder.go on lines 264..267
p2p/p2pmock/mock_networktransport.go on lines 160..163
p2p/p2pmock/mock_networktransport.go on lines 216..219
p2p/p2pmock/mock_networktransport.go on lines 230..233
p2p/p2pmock/mock_networktransport.go on lines 358..361
p2p/p2pmock/mock_peerfinder.go on lines 45..48
p2p/p2pmock/mock_peerfinder.go on lines 57..60
p2p/p2pmock/mock_peerfinder.go on lines 92..95
p2p/p2pmock/mock_peerfinder.go on lines 104..107
p2p/p2pmock/mock_peerfinder.go on lines 151..154
p2p/p2pmock/mock_peerfinder.go on lines 163..166
p2p/p2pmock/mock_peerfinder.go on lines 177..180
p2p/p2pmock/mock_peerfinder.go on lines 189..192
p2p/p2pmock/mock_peerfinder.go on lines 213..216
p2p/p2pmock/mock_peerfinder.go on lines 225..228
p2p/p2pmock/mock_peermanager.go on lines 45..48
p2p/p2pmock/mock_peermanager.go on lines 113..116
p2p/p2pmock/mock_peermanager.go on lines 125..128
p2p/p2pmock/mock_peermanager.go on lines 137..140
p2p/p2pmock/mock_peermanager.go on lines 149..152
p2p/p2pmock/mock_peermanager.go on lines 164..167
p2p/p2pmock/mock_peermanager.go on lines 246..249
p2p/p2pmock/mock_peermanager.go on lines 258..261
p2p/p2pmock/mock_peerrole.go on lines 96..99
p2p/p2pmock/mock_protobuf.go on lines 61..64
p2p/p2pmock/mock_protobuf.go on lines 75..78
p2p/p2pmock/mock_protobuf.go on lines 89..92
p2p/p2pmock/mock_protobuf.go on lines 103..106
p2p/p2pmock/mock_protobuf.go on lines 117..120
p2p/p2pmock/mock_protobuf.go on lines 129..132
p2p/p2pmock/mock_remotepeer.go on lines 180..183
p2p/p2pmock/mock_remotepeer.go on lines 256..259
p2p/p2pmock/mock_remotepeer.go on lines 270..273
p2p/p2pmock/mock_remotepeer.go on lines 296..299
p2p/p2pmock/mock_remotepeer.go on lines 309..312
p2p/p2pmock/mock_remotepeer.go on lines 323..326
p2p/p2pmock/mock_remotepeer.go on lines 351..354
p2p/p2pmock/mock_remotepeer.go on lines 389..392
p2p/p2pmock/mock_remotepeer.go on lines 403..406
p2p/p2pmock/mock_stream.go on lines 136..139
p2p/p2pmock/mock_stream.go on lines 164..167
p2p/p2pmock/mock_stream.go on lines 176..179
p2p/p2pmock/mock_stream.go on lines 190..193
p2p/p2pmock/mock_stream.go on lines 204..207
p2p/p2pmock/mock_stream.go on lines 233..236
p2p/p2pmock/mock_stream.go on lines 355..358
p2p/p2pmock/mock_syncmanager.go on lines 107..110
p2p/p2pmock/mock_syncmanager.go on lines 195..198

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

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

Similar blocks of code found in 95 locations. Consider refactoring.
Open

func (mr *MockAergoRaftAccessorMockRecorder) GetMemberByPeerID(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMemberByPeerID", reflect.TypeOf((*MockAergoRaftAccessor)(nil).GetMemberByPeerID), arg0)
}
Severity: Major
Found in p2p/p2pmock/mock_consensus.go and 94 other locations - About 40 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 84..87
p2p/p2pmock/mock_actorcontext.go on lines 150..153
p2p/p2pmock/mock_actorcontext.go on lines 202..205
p2p/p2pmock/mock_actorcontext.go on lines 242..245
p2p/p2pmock/mock_actorcontext.go on lines 254..257
p2p/p2pmock/mock_actorcontext.go on lines 268..271
p2p/p2pmock/mock_actorcontext.go on lines 333..336
p2p/p2pmock/mock_actorcontext.go on lines 345..348
p2p/p2pmock/mock_certificate.go on lines 44..47
p2p/p2pmock/mock_certificate.go on lines 58..61
p2p/p2pmock/mock_certificate.go on lines 73..76
p2p/p2pmock/mock_certificate.go on lines 113..116
p2p/p2pmock/mock_certificate.go on lines 125..128
p2p/p2pmock/mock_chainaccessor.go on lines 46..49
p2p/p2pmock/mock_chainaccessor.go on lines 76..79
p2p/p2pmock/mock_chainaccessor.go on lines 119..122
p2p/p2pmock/mock_chainaccessor.go on lines 148..151
p2p/p2pmock/mock_chainaccessor.go on lines 163..166
p2p/p2pmock/mock_consensus.go on lines 51..54
p2p/p2pmock/mock_consensus.go on lines 66..69
p2p/p2pmock/mock_consensus.go on lines 81..84
p2p/p2pmock/mock_consensus.go on lines 146..149
p2p/p2pmock/mock_consensus.go on lines 174..177
p2p/p2pmock/mock_consensus.go on lines 212..215
p2p/p2pmock/mock_handshake.go on lines 124..127
p2p/p2pmock/mock_handshake.go on lines 167..170
p2p/p2pmock/mock_handshake.go on lines 205..208
p2p/p2pmock/mock_handshake.go on lines 220..223
p2p/p2pmock/mock_host.go on lines 196..199
p2p/p2pmock/mock_io.go on lines 45..48
p2p/p2pmock/mock_io.go on lines 97..100
p2p/p2pmock/mock_io.go on lines 135..138
p2p/p2pmock/mock_io.go on lines 187..190
p2p/p2pmock/mock_io.go on lines 239..242
p2p/p2pmock/mock_io.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 213..216
p2p/p2pmock/mock_message.go on lines 228..231
p2p/p2pmock/mock_message.go on lines 411..414
p2p/p2pmock/mock_metricsman.go on lines 99..102
p2p/p2pmock/mock_msgio.go on lines 60..63
p2p/p2pmock/mock_msgio.go on lines 86..89
p2p/p2pmock/mock_msgorder.go on lines 117..120
p2p/p2pmock/mock_msgorder.go on lines 129..132
p2p/p2pmock/mock_msgorder.go on lines 208..211
p2p/p2pmock/mock_msgorder.go on lines 222..225
p2p/p2pmock/mock_msgorder.go on lines 236..239
p2p/p2pmock/mock_msgorder.go on lines 264..267
p2p/p2pmock/mock_networktransport.go on lines 160..163
p2p/p2pmock/mock_networktransport.go on lines 216..219
p2p/p2pmock/mock_networktransport.go on lines 230..233
p2p/p2pmock/mock_networktransport.go on lines 358..361
p2p/p2pmock/mock_peerfinder.go on lines 45..48
p2p/p2pmock/mock_peerfinder.go on lines 57..60
p2p/p2pmock/mock_peerfinder.go on lines 92..95
p2p/p2pmock/mock_peerfinder.go on lines 104..107
p2p/p2pmock/mock_peerfinder.go on lines 151..154
p2p/p2pmock/mock_peerfinder.go on lines 163..166
p2p/p2pmock/mock_peerfinder.go on lines 177..180
p2p/p2pmock/mock_peerfinder.go on lines 189..192
p2p/p2pmock/mock_peerfinder.go on lines 213..216
p2p/p2pmock/mock_peerfinder.go on lines 225..228
p2p/p2pmock/mock_peermanager.go on lines 45..48
p2p/p2pmock/mock_peermanager.go on lines 113..116
p2p/p2pmock/mock_peermanager.go on lines 125..128
p2p/p2pmock/mock_peermanager.go on lines 137..140
p2p/p2pmock/mock_peermanager.go on lines 149..152
p2p/p2pmock/mock_peermanager.go on lines 164..167
p2p/p2pmock/mock_peermanager.go on lines 246..249
p2p/p2pmock/mock_peermanager.go on lines 258..261
p2p/p2pmock/mock_peerrole.go on lines 96..99
p2p/p2pmock/mock_protobuf.go on lines 61..64
p2p/p2pmock/mock_protobuf.go on lines 75..78
p2p/p2pmock/mock_protobuf.go on lines 89..92
p2p/p2pmock/mock_protobuf.go on lines 103..106
p2p/p2pmock/mock_protobuf.go on lines 117..120
p2p/p2pmock/mock_protobuf.go on lines 129..132
p2p/p2pmock/mock_remotepeer.go on lines 180..183
p2p/p2pmock/mock_remotepeer.go on lines 256..259
p2p/p2pmock/mock_remotepeer.go on lines 270..273
p2p/p2pmock/mock_remotepeer.go on lines 296..299
p2p/p2pmock/mock_remotepeer.go on lines 309..312
p2p/p2pmock/mock_remotepeer.go on lines 323..326
p2p/p2pmock/mock_remotepeer.go on lines 351..354
p2p/p2pmock/mock_remotepeer.go on lines 389..392
p2p/p2pmock/mock_remotepeer.go on lines 403..406
p2p/p2pmock/mock_stream.go on lines 136..139
p2p/p2pmock/mock_stream.go on lines 164..167
p2p/p2pmock/mock_stream.go on lines 176..179
p2p/p2pmock/mock_stream.go on lines 190..193
p2p/p2pmock/mock_stream.go on lines 204..207
p2p/p2pmock/mock_stream.go on lines 233..236
p2p/p2pmock/mock_stream.go on lines 355..358
p2p/p2pmock/mock_syncmanager.go on lines 107..110
p2p/p2pmock/mock_syncmanager.go on lines 195..198

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

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

Similar blocks of code found in 95 locations. Consider refactoring.
Open

func (mr *MockWaitingPeerManagerMockRecorder) OnPeerDisconnect(peer interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnPeerDisconnect", reflect.TypeOf((*MockWaitingPeerManager)(nil).OnPeerDisconnect), peer)
}
Severity: Major
Found in p2p/p2pmock/mock_peerfinder.go and 94 other locations - About 40 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 84..87
p2p/p2pmock/mock_actorcontext.go on lines 150..153
p2p/p2pmock/mock_actorcontext.go on lines 202..205
p2p/p2pmock/mock_actorcontext.go on lines 242..245
p2p/p2pmock/mock_actorcontext.go on lines 254..257
p2p/p2pmock/mock_actorcontext.go on lines 268..271
p2p/p2pmock/mock_actorcontext.go on lines 333..336
p2p/p2pmock/mock_actorcontext.go on lines 345..348
p2p/p2pmock/mock_certificate.go on lines 44..47
p2p/p2pmock/mock_certificate.go on lines 58..61
p2p/p2pmock/mock_certificate.go on lines 73..76
p2p/p2pmock/mock_certificate.go on lines 113..116
p2p/p2pmock/mock_certificate.go on lines 125..128
p2p/p2pmock/mock_chainaccessor.go on lines 46..49
p2p/p2pmock/mock_chainaccessor.go on lines 76..79
p2p/p2pmock/mock_chainaccessor.go on lines 119..122
p2p/p2pmock/mock_chainaccessor.go on lines 148..151
p2p/p2pmock/mock_chainaccessor.go on lines 163..166
p2p/p2pmock/mock_consensus.go on lines 51..54
p2p/p2pmock/mock_consensus.go on lines 66..69
p2p/p2pmock/mock_consensus.go on lines 81..84
p2p/p2pmock/mock_consensus.go on lines 146..149
p2p/p2pmock/mock_consensus.go on lines 160..163
p2p/p2pmock/mock_consensus.go on lines 174..177
p2p/p2pmock/mock_consensus.go on lines 212..215
p2p/p2pmock/mock_handshake.go on lines 124..127
p2p/p2pmock/mock_handshake.go on lines 167..170
p2p/p2pmock/mock_handshake.go on lines 205..208
p2p/p2pmock/mock_handshake.go on lines 220..223
p2p/p2pmock/mock_host.go on lines 196..199
p2p/p2pmock/mock_io.go on lines 45..48
p2p/p2pmock/mock_io.go on lines 97..100
p2p/p2pmock/mock_io.go on lines 135..138
p2p/p2pmock/mock_io.go on lines 187..190
p2p/p2pmock/mock_io.go on lines 239..242
p2p/p2pmock/mock_io.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 213..216
p2p/p2pmock/mock_message.go on lines 228..231
p2p/p2pmock/mock_message.go on lines 411..414
p2p/p2pmock/mock_metricsman.go on lines 99..102
p2p/p2pmock/mock_msgio.go on lines 60..63
p2p/p2pmock/mock_msgio.go on lines 86..89
p2p/p2pmock/mock_msgorder.go on lines 117..120
p2p/p2pmock/mock_msgorder.go on lines 129..132
p2p/p2pmock/mock_msgorder.go on lines 208..211
p2p/p2pmock/mock_msgorder.go on lines 222..225
p2p/p2pmock/mock_msgorder.go on lines 236..239
p2p/p2pmock/mock_msgorder.go on lines 264..267
p2p/p2pmock/mock_networktransport.go on lines 160..163
p2p/p2pmock/mock_networktransport.go on lines 216..219
p2p/p2pmock/mock_networktransport.go on lines 230..233
p2p/p2pmock/mock_networktransport.go on lines 358..361
p2p/p2pmock/mock_peerfinder.go on lines 45..48
p2p/p2pmock/mock_peerfinder.go on lines 57..60
p2p/p2pmock/mock_peerfinder.go on lines 92..95
p2p/p2pmock/mock_peerfinder.go on lines 104..107
p2p/p2pmock/mock_peerfinder.go on lines 151..154
p2p/p2pmock/mock_peerfinder.go on lines 177..180
p2p/p2pmock/mock_peerfinder.go on lines 189..192
p2p/p2pmock/mock_peerfinder.go on lines 213..216
p2p/p2pmock/mock_peerfinder.go on lines 225..228
p2p/p2pmock/mock_peermanager.go on lines 45..48
p2p/p2pmock/mock_peermanager.go on lines 113..116
p2p/p2pmock/mock_peermanager.go on lines 125..128
p2p/p2pmock/mock_peermanager.go on lines 137..140
p2p/p2pmock/mock_peermanager.go on lines 149..152
p2p/p2pmock/mock_peermanager.go on lines 164..167
p2p/p2pmock/mock_peermanager.go on lines 246..249
p2p/p2pmock/mock_peermanager.go on lines 258..261
p2p/p2pmock/mock_peerrole.go on lines 96..99
p2p/p2pmock/mock_protobuf.go on lines 61..64
p2p/p2pmock/mock_protobuf.go on lines 75..78
p2p/p2pmock/mock_protobuf.go on lines 89..92
p2p/p2pmock/mock_protobuf.go on lines 103..106
p2p/p2pmock/mock_protobuf.go on lines 117..120
p2p/p2pmock/mock_protobuf.go on lines 129..132
p2p/p2pmock/mock_remotepeer.go on lines 180..183
p2p/p2pmock/mock_remotepeer.go on lines 256..259
p2p/p2pmock/mock_remotepeer.go on lines 270..273
p2p/p2pmock/mock_remotepeer.go on lines 296..299
p2p/p2pmock/mock_remotepeer.go on lines 309..312
p2p/p2pmock/mock_remotepeer.go on lines 323..326
p2p/p2pmock/mock_remotepeer.go on lines 351..354
p2p/p2pmock/mock_remotepeer.go on lines 389..392
p2p/p2pmock/mock_remotepeer.go on lines 403..406
p2p/p2pmock/mock_stream.go on lines 136..139
p2p/p2pmock/mock_stream.go on lines 164..167
p2p/p2pmock/mock_stream.go on lines 176..179
p2p/p2pmock/mock_stream.go on lines 190..193
p2p/p2pmock/mock_stream.go on lines 204..207
p2p/p2pmock/mock_stream.go on lines 233..236
p2p/p2pmock/mock_stream.go on lines 355..358
p2p/p2pmock/mock_syncmanager.go on lines 107..110
p2p/p2pmock/mock_syncmanager.go on lines 195..198

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

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

Similar blocks of code found in 95 locations. Consider refactoring.
Open

func (mr *MockReadWriteCloserMockRecorder) Read(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockReadWriteCloser)(nil).Read), arg0)
}
Severity: Major
Found in p2p/p2pmock/mock_io.go and 94 other locations - About 40 mins to fix
p2p/p2pmock/mock_actorcontext.go on lines 84..87
p2p/p2pmock/mock_actorcontext.go on lines 150..153
p2p/p2pmock/mock_actorcontext.go on lines 202..205
p2p/p2pmock/mock_actorcontext.go on lines 242..245
p2p/p2pmock/mock_actorcontext.go on lines 254..257
p2p/p2pmock/mock_actorcontext.go on lines 268..271
p2p/p2pmock/mock_actorcontext.go on lines 333..336
p2p/p2pmock/mock_actorcontext.go on lines 345..348
p2p/p2pmock/mock_certificate.go on lines 44..47
p2p/p2pmock/mock_certificate.go on lines 58..61
p2p/p2pmock/mock_certificate.go on lines 73..76
p2p/p2pmock/mock_certificate.go on lines 113..116
p2p/p2pmock/mock_certificate.go on lines 125..128
p2p/p2pmock/mock_chainaccessor.go on lines 46..49
p2p/p2pmock/mock_chainaccessor.go on lines 76..79
p2p/p2pmock/mock_chainaccessor.go on lines 119..122
p2p/p2pmock/mock_chainaccessor.go on lines 148..151
p2p/p2pmock/mock_chainaccessor.go on lines 163..166
p2p/p2pmock/mock_consensus.go on lines 51..54
p2p/p2pmock/mock_consensus.go on lines 66..69
p2p/p2pmock/mock_consensus.go on lines 81..84
p2p/p2pmock/mock_consensus.go on lines 146..149
p2p/p2pmock/mock_consensus.go on lines 160..163
p2p/p2pmock/mock_consensus.go on lines 174..177
p2p/p2pmock/mock_consensus.go on lines 212..215
p2p/p2pmock/mock_handshake.go on lines 124..127
p2p/p2pmock/mock_handshake.go on lines 167..170
p2p/p2pmock/mock_handshake.go on lines 205..208
p2p/p2pmock/mock_handshake.go on lines 220..223
p2p/p2pmock/mock_host.go on lines 196..199
p2p/p2pmock/mock_io.go on lines 45..48
p2p/p2pmock/mock_io.go on lines 97..100
p2p/p2pmock/mock_io.go on lines 135..138
p2p/p2pmock/mock_io.go on lines 187..190
p2p/p2pmock/mock_io.go on lines 254..257
p2p/p2pmock/mock_message.go on lines 213..216
p2p/p2pmock/mock_message.go on lines 228..231
p2p/p2pmock/mock_message.go on lines 411..414
p2p/p2pmock/mock_metricsman.go on lines 99..102
p2p/p2pmock/mock_msgio.go on lines 60..63
p2p/p2pmock/mock_msgio.go on lines 86..89
p2p/p2pmock/mock_msgorder.go on lines 117..120
p2p/p2pmock/mock_msgorder.go on lines 129..132
p2p/p2pmock/mock_msgorder.go on lines 208..211
p2p/p2pmock/mock_msgorder.go on lines 222..225
p2p/p2pmock/mock_msgorder.go on lines 236..239
p2p/p2pmock/mock_msgorder.go on lines 264..267
p2p/p2pmock/mock_networktransport.go on lines 160..163
p2p/p2pmock/mock_networktransport.go on lines 216..219
p2p/p2pmock/mock_networktransport.go on lines 230..233
p2p/p2pmock/mock_networktransport.go on lines 358..361
p2p/p2pmock/mock_peerfinder.go on lines 45..48
p2p/p2pmock/mock_peerfinder.go on lines 57..60
p2p/p2pmock/mock_peerfinder.go on lines 92..95
p2p/p2pmock/mock_peerfinder.go on lines 104..107
p2p/p2pmock/mock_peerfinder.go on lines 151..154
p2p/p2pmock/mock_peerfinder.go on lines 163..166
p2p/p2pmock/mock_peerfinder.go on lines 177..180
p2p/p2pmock/mock_peerfinder.go on lines 189..192
p2p/p2pmock/mock_peerfinder.go on lines 213..216
p2p/p2pmock/mock_peerfinder.go on lines 225..228
p2p/p2pmock/mock_peermanager.go on lines 45..48
p2p/p2pmock/mock_peermanager.go on lines 113..116
p2p/p2pmock/mock_peermanager.go on lines 125..128
p2p/p2pmock/mock_peermanager.go on lines 137..140
p2p/p2pmock/mock_peermanager.go on lines 149..152
p2p/p2pmock/mock_peermanager.go on lines 164..167
p2p/p2pmock/mock_peermanager.go on lines 246..249
p2p/p2pmock/mock_peermanager.go on lines 258..261
p2p/p2pmock/mock_peerrole.go on lines 96..99
p2p/p2pmock/mock_protobuf.go on lines 61..64
p2p/p2pmock/mock_protobuf.go on lines 75..78
p2p/p2pmock/mock_protobuf.go on lines 89..92
p2p/p2pmock/mock_protobuf.go on lines 103..106
p2p/p2pmock/mock_protobuf.go on lines 117..120
p2p/p2pmock/mock_protobuf.go on lines 129..132
p2p/p2pmock/mock_remotepeer.go on lines 180..183
p2p/p2pmock/mock_remotepeer.go on lines 256..259
p2p/p2pmock/mock_remotepeer.go on lines 270..273
p2p/p2pmock/mock_remotepeer.go on lines 296..299
p2p/p2pmock/mock_remotepeer.go on lines 309..312
p2p/p2pmock/mock_remotepeer.go on lines 323..326
p2p/p2pmock/mock_remotepeer.go on lines 351..354
p2p/p2pmock/mock_remotepeer.go on lines 389..392
p2p/p2pmock/mock_remotepeer.go on lines 403..406
p2p/p2pmock/mock_stream.go on lines 136..139
p2p/p2pmock/mock_stream.go on lines 164..167
p2p/p2pmock/mock_stream.go on lines 176..179
p2p/p2pmock/mock_stream.go on lines 190..193
p2p/p2pmock/mock_stream.go on lines 204..207
p2p/p2pmock/mock_stream.go on lines 233..236
p2p/p2pmock/mock_stream.go on lines 355..358
p2p/p2pmock/mock_syncmanager.go on lines 107..110
p2p/p2pmock/mock_syncmanager.go on lines 195..198

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

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