Fantom-foundation/go-lachesis

View on GitHub

Showing 829 of 829 total issues

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

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

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

File emitter.go has 643 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package gossip

import (
    "fmt"
    "math/big"
Severity: Minor
Found in gossip/emitter.go - About 5 hrs to fix

    Method rows.String has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
    Open

    func (rr *rows) String() string {
        var (
            res strings.Builder
            out = func(s string) {
                _, err := res.WriteString(s)
    Severity: Minor
    Found in inter/ascii_scheme.go - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    TxPool has 39 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type TxPool struct {
        config      TxPoolConfig
        chainconfig *params.ChainConfig
        chain       stateReader
        gasPrice    *big.Int
    Severity: Minor
    Found in evmcore/tx_pool.go - About 5 hrs to fix

      Method Election.ProcessRoot has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring.
      Open

      func (el *Election) ProcessRoot(newRoot RootAndSlot) (*Res, error) {
          res, err := el.chooseAtropos()
          if err != nil || res != nil {
              return res, err
          }
      Severity: Minor
      Found in poset/election/election_math.go - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function DAGtoASCIIscheme has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring.
      Open

      func DAGtoASCIIscheme(events Events) (string, error) {
          events = events.ByParents()
      
          var (
              scheme rows
      Severity: Minor
      Found in inter/ascii_scheme.go - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function ASCIIschemeForEach has 152 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func ASCIIschemeForEach(
          scheme string,
          callback ForEachEvent,
      ) (
          nodes []idx.StakerID,
      Severity: Major
      Found in inter/ascii_scheme.go - About 5 hrs to fix

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

        func (_Contract *ContractFilterer) WatchIncreasedDelegation(opts *bind.WatchOpts, sink chan<- *ContractIncreasedDelegation, 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/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 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) WatchBurntRewardStash(opts *bind.WatchOpts, sink chan<- *ContractBurntRewardStash, addr []common.Address, stakerID []*big.Int) (event.Subscription, error) {
        
            var addrRule []interface{}
            for _, addrItem := range addr {
                addrRule = append(addrRule, addrItem)
        Severity: Major
        Found in gossip/sfc110/contract.go and 20 other locations - About 5 hrs to fix
        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 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) WatchIncreasedDelegation(opts *bind.WatchOpts, sink chan<- *ContractIncreasedDelegation, 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 3138..3179
        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) 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/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 3138..3179
        gossip/sfc204/contract.go on lines 3435..3476
        gossip/sfc204/contract.go on lines 3734..3775
        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) WatchLockingDelegation(opts *bind.WatchOpts, sink chan<- *ContractLockingDelegation, 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/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 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

        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/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 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) WatchLockingDelegation(opts *bind.WatchOpts, sink chan<- *ContractLockingDelegation, 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 3138..3179
        gossip/sfc204/contract.go on lines 3435..3476
        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/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) 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/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 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