Fantom-foundation/go-lachesis

View on GitHub

Showing 829 of 829 total issues

Method iterator.Next has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
Open

func (it *iterator) Next() bool {
    it.lock.Lock()
    defer it.lock.Unlock()

    if it.Error() != nil {
Severity: Minor
Found in kvdb/flushable/flushable.go - About 4 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 init has 138 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func init() {
    overrideFlags()
    overrideParams()

    // Flags for testing purpose.
Severity: Major
Found in cmd/lachesis/main.go - About 4 hrs to fix

    Method Database.meter has 137 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (db *Database) meter(refresh time.Duration) {
        // Create the counters to store current and previous compaction values
        compactions := make([][]float64, 2)
        for i := 0; i < 2; i++ {
            compactions[i] = make([]float64, 4)
    Severity: Major
    Found in kvdb/leveldb/leveldb.go - About 4 hrs to fix

      Function DoEstimateGas has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
      Open

      func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, gasCap uint64) (hexutil.Uint64, error) {
          // Binary search the gas requirement, as it may be higher than the amount used
          var (
              lo  uint64 = params.TxGas - 1
              hi  uint64
      Severity: Minor
      Found in ethapi/api.go - About 4 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

      Method TxPool.truncatePending has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
      Open

      func (pool *TxPool) truncatePending() {
          pending := uint64(0)
          for _, list := range pool.pending {
              pending += uint64(list.Len())
          }
      Severity: Minor
      Found in evmcore/tx_pool.go - About 4 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

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

      func (_Contract *ContractFilterer) WatchDeactivatedStake(opts *bind.WatchOpts, sink chan<- *ContractDeactivatedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchIncreasedStake(opts *bind.WatchOpts, sink chan<- *ContractIncreasedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchUpdatedStake(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchLockingStake(opts *bind.WatchOpts, sink chan<- *ContractLockingStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchDeactivatedStake(opts *bind.WatchOpts, sink chan<- *ContractDeactivatedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc202/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchDeactivatedStake(opts *bind.WatchOpts, sink chan<- *ContractDeactivatedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchPreparedToWithdrawStake(opts *bind.WatchOpts, sink chan<- *ContractPreparedToWithdrawStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc202/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchUpdatedStake(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc202/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchWithdrawnStake(opts *bind.WatchOpts, sink chan<- *ContractWithdrawnStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchClaimedValidatorReward(opts *bind.WatchOpts, sink chan<- *ContractClaimedValidatorReward, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchPreparedToWithdrawStake(opts *bind.WatchOpts, sink chan<- *ContractPreparedToWithdrawStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchUpdatedStake(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchUpdatedStakerMetadata(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStakerMetadata, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc202/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchClaimedValidatorReward(opts *bind.WatchOpts, sink chan<- *ContractClaimedValidatorReward, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4159..4196
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

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

      func (_Contract *ContractFilterer) WatchPreparedToWithdrawStake(opts *bind.WatchOpts, sink chan<- *ContractPreparedToWithdrawStake, stakerID []*big.Int) (event.Subscription, error) {
      
          var stakerIDRule []interface{}
          for _, stakerIDItem := range stakerID {
              stakerIDRule = append(stakerIDRule, stakerIDItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 21 other locations - About 4 hrs to fix
      gossip/sfc110/contract.go on lines 2484..2521
      gossip/sfc110/contract.go on lines 3249..3286
      gossip/sfc110/contract.go on lines 3548..3585
      gossip/sfc110/contract.go on lines 4886..4923
      gossip/sfc110/contract.go on lines 5029..5066
      gossip/sfc110/contract.go on lines 5487..5524
      gossip/sfc202/contract.go on lines 2677..2714
      gossip/sfc202/contract.go on lines 3442..3479
      gossip/sfc202/contract.go on lines 3741..3778
      gossip/sfc202/contract.go on lines 4040..4077
      gossip/sfc202/contract.go on lines 4784..4821
      gossip/sfc202/contract.go on lines 5778..5815
      gossip/sfc202/contract.go on lines 5921..5958
      gossip/sfc202/contract.go on lines 6379..6416
      gossip/sfc204/contract.go on lines 2520..2557
      gossip/sfc204/contract.go on lines 3285..3322
      gossip/sfc204/contract.go on lines 3584..3621
      gossip/sfc204/contract.go on lines 3883..3920
      gossip/sfc204/contract.go on lines 4627..4664
      gossip/sfc204/contract.go on lines 5621..5658
      gossip/sfc204/contract.go on lines 5918..5955

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

      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