aergoio/aergo

View on GitHub

Showing 1,051 of 1,052 total issues

Method executor.commitCalledContract has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
Open

func (ce *executor) commitCalledContract() error {
    ctx := ce.ctx

    if ctx == nil || ctx.callState == nil {
        return nil
Severity: Minor
Found in contract/vm.go - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method executor.call has 7 return statements (exceeds 4 allowed).
Open

func (ce *executor) call(instLimit C.int, target *LState) (ret C.int) {
    defer func() {
        if ret == 0 && target != nil {
            if C.luaL_hasuncatchablerror(ce.L) != C.int(0) {
                C.luaL_setuncatchablerror(target)
Severity: Major
Found in contract/vm.go - About 45 mins to fix

    Method DummyChain.Query has 7 return statements (exceeds 4 allowed).
    Open

    func (bc *DummyChain) Query(contract_name, queryInfo, expectedErr string, expectedRvs ...string) error {
        cState, err := statedb.OpenContractStateAccount(contract.StrHash(contract_name), bc.sdb.GetStateDB())
        if err != nil {
            return err
        }
    Severity: Major
    Found in contract/vm_dummy/vm_dummy.go - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      if varProof.Inclusion {
                          if len(varProof.GetValue()) == 0 {
                              return nil, nil
                          }
                          return C.CString(string(varProof.GetValue())), nil
      Severity: Major
      Found in contract/vm_callback.go - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                        if err != nil {
                            return nil, C.CString("[System.LuaGetDB] failed to get snapshot state variable in contract")
                        }
        Severity: Major
        Found in contract/vm_callback.go - About 45 mins to fix

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

          func (mr *MockContextMockRecorder) RequestFuture(arg0, arg1, arg2 interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestFuture", reflect.TypeOf((*MockContext)(nil).RequestFuture), arg0, arg1, arg2)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_actorcontext.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockTxNoticeTracerMockRecorder) RegisterTxNotice(txIDs, cnt, alreadySent interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTxNotice", reflect.TypeOf((*MockTxNoticeTracer)(nil).RegisterTxNotice), txIDs, cnt, alreadySent)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_txnotice.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98

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

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

          func (mr *MockSyncManagerMockRecorder) HandleGetTxReq(arg0, arg1, arg2 interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleGetTxReq", reflect.TypeOf((*MockSyncManager)(nil).HandleGetTxReq), arg0, arg1, arg2)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_syncmanager.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockActorServiceMockRecorder) FutureRequest(actorName, msg, timeout interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FutureRequest", reflect.TypeOf((*MockActorService)(nil).FutureRequest), actorName, msg, timeout)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_actorservice.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockMoFactoryMockRecorder) NewMsgRequestOrderWithReceiver(respReceiver, protocolID, message interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewMsgRequestOrderWithReceiver", reflect.TypeOf((*MockMoFactory)(nil).NewMsgRequestOrderWithReceiver), respReceiver, protocolID, message)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_msgorder.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockSyncManagerMockRecorder) HandleGetBlockResponse(arg0, arg1, arg2 interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleGetBlockResponse", reflect.TypeOf((*MockSyncManager)(nil).HandleGetBlockResponse), arg0, arg1, arg2)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_syncmanager.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockAergoRaftAccessorMockRecorder) Process(arg0, arg1, arg2 interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Process", reflect.TypeOf((*MockAergoRaftAccessor)(nil).Process), arg0, arg1, arg2)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_consensus.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockVersionedManagerMockRecorder) GetVersionedHandshaker(version, peerID, rwc interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersionedHandshaker", reflect.TypeOf((*MockVersionedManager)(nil).GetVersionedHandshaker), version, peerID, rwc)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_handshake.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockPeerRoleManagerMockRecorder) FilterBPNoticeReceiver(block, pm, targetZone interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterBPNoticeReceiver", reflect.TypeOf((*MockPeerRoleManager)(nil).FilterBPNoticeReceiver), block, pm, targetZone)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_peerrole.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockActorServiceMockRecorder) CallRequest(actorName, msg, timeout interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallRequest", reflect.TypeOf((*MockActorService)(nil).CallRequest), actorName, msg, timeout)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_actorservice.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockAsyncHandlerMockRecorder) Handle(msg, msgBody, ttl interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Handle", reflect.TypeOf((*MockAsyncHandler)(nil).Handle), msg, msgBody, ttl)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_message.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockPeerFactoryMockRecorder) CreateRemotePeer(remoteInfo, seq, rw interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRemotePeer", reflect.TypeOf((*MockPeerFactory)(nil).CreateRemotePeer), remoteInfo, seq, rw)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_remotepeer.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockMoFactoryMockRecorder) NewMsgRequestOrder(expectResponse, protocolID, message interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewMsgRequestOrder", reflect.TypeOf((*MockMoFactory)(nil).NewMsgRequestOrder), expectResponse, protocolID, message)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_msgorder.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockHostMockRecorder) SetStreamHandlerMatch(arg0, arg1, arg2 interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStreamHandlerMatch", reflect.TypeOf((*MockHost)(nil).SetStreamHandlerMatch), arg0, arg1, arg2)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_host.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_syncmanager.go on lines 95..98
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

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

          func (mr *MockSyncManagerMockRecorder) HandleNewTxNotice(arg0, arg1, arg2 interface{}) *gomock.Call {
              mr.mock.ctrl.T.Helper()
              return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleNewTxNotice", reflect.TypeOf((*MockSyncManager)(nil).HandleNewTxNotice), arg0, arg1, arg2)
          }
          Severity: Major
          Found in p2p/p2pmock/mock_syncmanager.go and 17 other locations - About 45 mins to fix
          p2p/p2pmock/mock_actorcontext.go on lines 190..193
          p2p/p2pmock/mock_actorservice.go on lines 72..75
          p2p/p2pmock/mock_actorservice.go on lines 101..104
          p2p/p2pmock/mock_consensus.go on lines 188..191
          p2p/p2pmock/mock_consensus.go on lines 227..230
          p2p/p2pmock/mock_handshake.go on lines 139..142
          p2p/p2pmock/mock_host.go on lines 220..223
          p2p/p2pmock/mock_message.go on lines 374..377
          p2p/p2pmock/mock_msgorder.go on lines 166..169
          p2p/p2pmock/mock_msgorder.go on lines 180..183
          p2p/p2pmock/mock_msgorder.go on lines 194..197
          p2p/p2pmock/mock_networktransport.go on lines 396..399
          p2p/p2pmock/mock_peerrole.go on lines 124..127
          p2p/p2pmock/mock_remotepeer.go on lines 47..50
          p2p/p2pmock/mock_syncmanager.go on lines 57..60
          p2p/p2pmock/mock_syncmanager.go on lines 71..74
          p2p/p2pmock/mock_txnotice.go on lines 43..46

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

          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