Fantom-foundation/go-lachesis

View on GitHub

Showing 538 of 829 total issues

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

func (_Contract *ContractFilterer) WatchUpdatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractUpdatedDelegation, delegator []common.Address, oldStakerID []*big.Int, newStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc204/contract.go and 2 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 4599..4644
gossip/sfc202/contract.go on lines 5224..5269

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

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

func (_Contract *ContractFilterer) WatchUpdatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractUpdatedDelegation, delegator []common.Address, oldStakerID []*big.Int, newStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc202/contract.go and 2 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 4599..4644
gossip/sfc204/contract.go on lines 5067..5112

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

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

func (_Contract *ContractFilterer) WatchUpdatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractUpdatedDelegation, delegator []common.Address, oldStakerID []*big.Int, newStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc110/contract.go and 2 other locations - About 5 hrs to fix
gossip/sfc202/contract.go on lines 5224..5269
gossip/sfc204/contract.go on lines 5067..5112

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

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

func (_Contract *ContractFilterer) WatchPartialWithdrawnByRequest(opts *bind.WatchOpts, sink chan<- *ContractPartialWithdrawnByRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var authRule []interface{}
    for _, authItem := range auth {
        authRule = append(authRule, authItem)
Severity: Major
Found in gossip/sfc204/contract.go and 5 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2946..2991
gossip/sfc110/contract.go on lines 3856..3901
gossip/sfc202/contract.go on lines 3139..3184
gossip/sfc202/contract.go on lines 4481..4526
gossip/sfc204/contract.go on lines 2982..3027

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

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

func (_Contract *ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var authRule []interface{}
    for _, authItem := range auth {
        authRule = append(authRule, authItem)
Severity: Major
Found in gossip/sfc202/contract.go and 5 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2946..2991
gossip/sfc110/contract.go on lines 3856..3901
gossip/sfc202/contract.go on lines 4481..4526
gossip/sfc204/contract.go on lines 2982..3027
gossip/sfc204/contract.go on lines 4324..4369

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

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

func (_Contract *ContractFilterer) WatchPartialWithdrawnByRequest(opts *bind.WatchOpts, sink chan<- *ContractPartialWithdrawnByRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var authRule []interface{}
    for _, authItem := range auth {
        authRule = append(authRule, authItem)
Severity: Major
Found in gossip/sfc202/contract.go and 5 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2946..2991
gossip/sfc110/contract.go on lines 3856..3901
gossip/sfc202/contract.go on lines 3139..3184
gossip/sfc204/contract.go on lines 2982..3027
gossip/sfc204/contract.go on lines 4324..4369

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

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

func (_Contract *ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var authRule []interface{}
    for _, authItem := range auth {
        authRule = append(authRule, authItem)
Severity: Major
Found in gossip/sfc110/contract.go and 5 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 3856..3901
gossip/sfc202/contract.go on lines 3139..3184
gossip/sfc202/contract.go on lines 4481..4526
gossip/sfc204/contract.go on lines 2982..3027
gossip/sfc204/contract.go on lines 4324..4369

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

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

func (_Contract *ContractFilterer) WatchPartialWithdrawnByRequest(opts *bind.WatchOpts, sink chan<- *ContractPartialWithdrawnByRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var authRule []interface{}
    for _, authItem := range auth {
        authRule = append(authRule, authItem)
Severity: Major
Found in gossip/sfc110/contract.go and 5 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2946..2991
gossip/sfc202/contract.go on lines 3139..3184
gossip/sfc202/contract.go on lines 4481..4526
gossip/sfc204/contract.go on lines 2982..3027
gossip/sfc204/contract.go on lines 4324..4369

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

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

func (_Contract *ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var authRule []interface{}
    for _, authItem := range auth {
        authRule = append(authRule, authItem)
Severity: Major
Found in gossip/sfc204/contract.go and 5 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2946..2991
gossip/sfc110/contract.go on lines 3856..3901
gossip/sfc202/contract.go on lines 3139..3184
gossip/sfc202/contract.go on lines 4481..4526
gossip/sfc204/contract.go on lines 4324..4369

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

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 (_Contract *ContractFilterer) WatchUpdatedStakerSfcAddress(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStakerSfcAddress, stakerID []*big.Int, oldSfcAddress []common.Address, newSfcAddress []common.Address) (event.Subscription, error) {

    var stakerIDRule []interface{}
    for _, stakerIDItem := range stakerID {
        stakerIDRule = append(stakerIDRule, stakerIDItem)
Severity: Major
Found in gossip/sfc110/contract.go and 1 other location - About 5 hrs to fix
gossip/sfc202/contract.go on lines 6074..6119

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

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 (_Contract *ContractFilterer) WatchUpdatedStakerSfcAddress(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStakerSfcAddress, stakerID []*big.Int, oldSfcAddress []common.Address, newSfcAddress []common.Address) (event.Subscription, error) {

    var stakerIDRule []interface{}
    for _, stakerIDItem := range stakerID {
        stakerIDRule = append(stakerIDRule, stakerIDItem)
Severity: Major
Found in gossip/sfc202/contract.go and 1 other location - About 5 hrs to fix
gossip/sfc110/contract.go on lines 5182..5227

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

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

func (_Contract *ContractFilterer) WatchDeactivatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractDeactivatedDelegation, delegator []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc204/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchClaimedDelegationReward(opts *bind.WatchOpts, sink chan<- *ContractClaimedDelegationReward, from []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var fromRule []interface{}
    for _, fromItem := range from {
        fromRule = append(fromRule, fromItem)
Severity: Major
Found in gossip/sfc110/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchCreatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractCreatedDelegation, delegator []common.Address, toStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc110/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchDeactivatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractDeactivatedDelegation, delegator []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc110/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchCreatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractCreatedDelegation, delegator []common.Address, toStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc204/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchCreatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractCreatedDelegation, delegator []common.Address, toStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc202/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchWithdrawnDelegation(opts *bind.WatchOpts, sink chan<- *ContractWithdrawnDelegation, delegator []common.Address, toStakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc202/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 4012..4053
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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

func (_Contract *ContractFilterer) WatchCreatedStake(opts *bind.WatchOpts, sink chan<- *ContractCreatedStake, stakerID []*big.Int, dagSfcAddress []common.Address) (event.Subscription, error) {

    var stakerIDRule []interface{}
    for _, stakerIDItem := range stakerID {
        stakerIDRule = append(stakerIDRule, stakerIDItem)
Severity: Major
Found in gossip/sfc202/contract.go and 2 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2786..2827
gossip/sfc204/contract.go on lines 2822..2863

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

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

func (_Contract *ContractFilterer) WatchPreparedToWithdrawDelegation(opts *bind.WatchOpts, sink chan<- *ContractPreparedToWithdrawDelegation, delegator []common.Address, stakerID []*big.Int) (event.Subscription, error) {

    var delegatorRule []interface{}
    for _, delegatorItem := range delegator {
        delegatorRule = append(delegatorRule, delegatorItem)
Severity: Major
Found in gossip/sfc110/contract.go and 20 other locations - About 5 hrs to fix
gossip/sfc110/contract.go on lines 2179..2220
gossip/sfc110/contract.go on lines 2334..2375
gossip/sfc110/contract.go on lines 2633..2674
gossip/sfc110/contract.go on lines 3102..3143
gossip/sfc110/contract.go on lines 3399..3440
gossip/sfc110/contract.go on lines 5339..5380
gossip/sfc202/contract.go on lines 2527..2568
gossip/sfc202/contract.go on lines 2826..2867
gossip/sfc202/contract.go on lines 3295..3336
gossip/sfc202/contract.go on lines 3592..3633
gossip/sfc202/contract.go on lines 3891..3932
gossip/sfc202/contract.go on lines 4637..4678
gossip/sfc202/contract.go on lines 6231..6272
gossip/sfc204/contract.go on lines 2370..2411
gossip/sfc204/contract.go on lines 2669..2710
gossip/sfc204/contract.go on lines 3138..3179
gossip/sfc204/contract.go on lines 3435..3476
gossip/sfc204/contract.go on lines 3734..3775
gossip/sfc204/contract.go on lines 4480..4521
gossip/sfc204/contract.go on lines 5770..5811

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

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