aergoio/aergo

View on GitHub

Showing 607 of 1,052 total issues

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

func serveSwaggerUI(path string) func(w http.ResponseWriter, r *http.Request) {
    return func(w http.ResponseWriter, r *http.Request) {
        htmlContent, err := os.ReadFile(path + "swagger-ui.html")
        if err != nil {
            http.Error(w, "Failed to read HTML file", http.StatusInternalServerError)
Severity: Major
Found in rpc/web3/web3.go and 1 other location - About 1 hr to fix
rpc/web3/web3.go on lines 144..155

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func resetAccount(account *state.AccountState, fee *big.Int, nonce *uint64) error {
    account.Reset()
    if fee != nil {
        if account.Balance().Cmp(fee) < 0 {
            return &types.InternalError{Reason: "fee is greater than balance"}
Severity: Major
Found in chain/chainhandle.go and 1 other location - About 1 hr to fix
contract/vm_direct/vm_direct.go on lines 364..376

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func resetAccount(account *state.AccountState, fee *big.Int, nonce *uint64) error {
    account.Reset()
    if fee != nil {
        if account.Balance().Cmp(fee) < 0 {
            return &types.InternalError{Reason: "fee is greater than balance"}
Severity: Major
Found in contract/vm_direct/vm_direct.go and 1 other location - About 1 hr to fix
chain/chainhandle.go on lines 932..944

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

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

LOOP:
    for i := 0; i < cnt; i++ {
        blockHash, err := tchain.GetHashByNo(blkNo)
        if err != nil {
            logger.Info().Msg("assertion - hash get failed")
Severity: Major
Found in chain/stubchain.go and 1 other location - About 1 hr to fix
chain/chainanchor.go on lines 31..53

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

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

LOOP:
    for i := 0; i < cnt; i++ {
        blockHash, err := cs.getHashByNo(blkNo)
        if err != nil {
            logger.Info().Msg("assertion - hash get failed")
Severity: Major
Found in chain/chainanchor.go and 1 other location - About 1 hr to fix
chain/stubchain.go on lines 178..200

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

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

func (c *setb) Run(args string) (string, uint64, []*types.Event, error) {
    line, contractIDHex, _ := c.parse(args)

    err := contract.SetBreakPoint(contractIDHex, line)
    if err != nil {
Severity: Major
Found in cmd/brick/exec/debug.go and 1 other location - About 1 hr to fix
cmd/brick/exec/debug.go on lines 130..143

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    if len(conf.NetProtocolAddr) != 0 {
        ipAddress, err = network.GetSingleIPAddress(protocolAddr)
        if err != nil {
            panic("Invalid protocol address " + protocolAddr + " : " + err.Error())
        }
Severity: Major
Found in p2p/pi.go and 1 other location - About 1 hr to fix
cmd/polaris/server/litentcontainer.go on lines 221..236

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

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

func (c *delb) Run(args string) (string, uint64, []*types.Event, error) {
    line, contractIDHex, _ := c.parse(args)

    err := contract.DelBreakPoint(contractIDHex, line)
    if err != nil {
Severity: Major
Found in cmd/brick/exec/debug.go and 1 other location - About 1 hr to fix
cmd/brick/exec/debug.go on lines 72..85

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    if len(conf.NetProtocolAddr) != 0 {
        ipAddress, err = network.GetSingleIPAddress(protocolAddr)
        if err != nil {
            panic("Invalid protocol address " + protocolAddr + " : " + err.Error())
        }
Severity: Major
Found in cmd/polaris/server/litentcontainer.go and 1 other location - About 1 hr to fix
p2p/pi.go on lines 30..45

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) CreateAccount(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccount", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).CreateAccount), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetAccounts(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccounts", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetAccounts), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetBlockMetadata(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockMetadata", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetBlockMetadata), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetVotes(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVotes", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetVotes), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetBlock(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetBlock), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetState(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetState), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetTX(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTX", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetTX), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockNetworkTransportMockRecorder) GetOrCreateStreamWithTTL(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrCreateStreamWithTTL", reflect.TypeOf((*MockNetworkTransport)(nil).GetOrCreateStreamWithTTL), varargs...)
}
Severity: Major
Found in p2p/p2pmock/mock_networktransport.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) Blockchain(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Blockchain", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).Blockchain), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) GetStaking(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStaking", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).GetStaking), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 113..117
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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

func (mr *MockAergoRPCServiceClientMockRecorder) CommitTX(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    varargs := append([]interface{}{arg0, arg1}, arg2...)
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitTX", reflect.TypeOf((*MockAergoRPCServiceClient)(nil).CommitTX), varargs...)
}
Severity: Major
Found in cmd/aergocli/cmd/mock_types/mock_types.go and 45 other locations - About 1 hr to fix
cmd/aergocli/cmd/mock_types/mock_types.go on lines 53..57
cmd/aergocli/cmd/mock_types/mock_types.go on lines 73..77
cmd/aergocli/cmd/mock_types/mock_types.go on lines 93..97
cmd/aergocli/cmd/mock_types/mock_types.go on lines 133..137
cmd/aergocli/cmd/mock_types/mock_types.go on lines 153..157
cmd/aergocli/cmd/mock_types/mock_types.go on lines 173..177
cmd/aergocli/cmd/mock_types/mock_types.go on lines 193..197
cmd/aergocli/cmd/mock_types/mock_types.go on lines 213..217
cmd/aergocli/cmd/mock_types/mock_types.go on lines 233..237
cmd/aergocli/cmd/mock_types/mock_types.go on lines 253..257
cmd/aergocli/cmd/mock_types/mock_types.go on lines 273..277
cmd/aergocli/cmd/mock_types/mock_types.go on lines 293..297
cmd/aergocli/cmd/mock_types/mock_types.go on lines 313..317
cmd/aergocli/cmd/mock_types/mock_types.go on lines 333..337
cmd/aergocli/cmd/mock_types/mock_types.go on lines 353..357
cmd/aergocli/cmd/mock_types/mock_types.go on lines 373..377
cmd/aergocli/cmd/mock_types/mock_types.go on lines 393..397
cmd/aergocli/cmd/mock_types/mock_types.go on lines 413..417
cmd/aergocli/cmd/mock_types/mock_types.go on lines 433..437
cmd/aergocli/cmd/mock_types/mock_types.go on lines 453..457
cmd/aergocli/cmd/mock_types/mock_types.go on lines 473..477
cmd/aergocli/cmd/mock_types/mock_types.go on lines 493..497
cmd/aergocli/cmd/mock_types/mock_types.go on lines 513..517
cmd/aergocli/cmd/mock_types/mock_types.go on lines 533..537
cmd/aergocli/cmd/mock_types/mock_types.go on lines 553..557
cmd/aergocli/cmd/mock_types/mock_types.go on lines 573..577
cmd/aergocli/cmd/mock_types/mock_types.go on lines 593..597
cmd/aergocli/cmd/mock_types/mock_types.go on lines 613..617
cmd/aergocli/cmd/mock_types/mock_types.go on lines 633..637
cmd/aergocli/cmd/mock_types/mock_types.go on lines 653..657
cmd/aergocli/cmd/mock_types/mock_types.go on lines 673..677
cmd/aergocli/cmd/mock_types/mock_types.go on lines 693..697
cmd/aergocli/cmd/mock_types/mock_types.go on lines 713..717
cmd/aergocli/cmd/mock_types/mock_types.go on lines 733..737
cmd/aergocli/cmd/mock_types/mock_types.go on lines 753..757
cmd/aergocli/cmd/mock_types/mock_types.go on lines 773..777
cmd/aergocli/cmd/mock_types/mock_types.go on lines 793..797
cmd/aergocli/cmd/mock_types/mock_types.go on lines 813..817
cmd/aergocli/cmd/mock_types/mock_types.go on lines 833..837
cmd/aergocli/cmd/mock_types/mock_types.go on lines 853..857
cmd/aergocli/cmd/mock_types/mock_types.go on lines 873..877
cmd/aergocli/cmd/mock_types/mock_types.go on lines 893..897
p2p/p2pmock/mock_host.go on lines 169..173
p2p/p2pmock/mock_networktransport.go on lines 269..273
p2p/p2pmock/mock_networktransport.go on lines 331..335

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

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