Fantom-foundation/go-lachesis

View on GitHub

Showing 829 of 829 total issues

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

func (_Contract *ContractSession) CalcDelegationRewards(delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
    return _Contract.Contract.CalcDelegationRewards(&_Contract.CallOpts, delegator, toStakerID, _fromEpoch, maxEpochs)
}
Severity: Major
Found in gossip/sfc202/contract.go and 7 other locations - About 55 mins to fix
gossip/sfc202/contract.go on lines 238..240
gossip/sfc202/contract.go on lines 245..247
gossip/sfc202/contract.go on lines 277..279
gossip/sfc204/contract.go on lines 221..223
gossip/sfc204/contract.go on lines 228..230
gossip/sfc204/contract.go on lines 253..255
gossip/sfc204/contract.go on lines 260..262

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

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

func (_Contract *ContractCallerSession) CalcDelegationCompoundRewards(delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
    return _Contract.Contract.CalcDelegationCompoundRewards(&_Contract.CallOpts, delegator, toStakerID, _fromEpoch, maxEpochs)
}
Severity: Major
Found in gossip/sfc202/contract.go and 7 other locations - About 55 mins to fix
gossip/sfc202/contract.go on lines 238..240
gossip/sfc202/contract.go on lines 270..272
gossip/sfc202/contract.go on lines 277..279
gossip/sfc204/contract.go on lines 221..223
gossip/sfc204/contract.go on lines 228..230
gossip/sfc204/contract.go on lines 253..255
gossip/sfc204/contract.go on lines 260..262

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

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

func (_Contract *ContractCallerSession) CalcDelegationRewards(delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
    return _Contract.Contract.CalcDelegationRewards(&_Contract.CallOpts, delegator, toStakerID, _fromEpoch, maxEpochs)
}
Severity: Major
Found in gossip/sfc204/contract.go and 7 other locations - About 55 mins to fix
gossip/sfc202/contract.go on lines 238..240
gossip/sfc202/contract.go on lines 245..247
gossip/sfc202/contract.go on lines 270..272
gossip/sfc202/contract.go on lines 277..279
gossip/sfc204/contract.go on lines 221..223
gossip/sfc204/contract.go on lines 228..230
gossip/sfc204/contract.go on lines 253..255

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

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

func (_Contract *ContractSession) CalcDelegationCompoundRewards(delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
    return _Contract.Contract.CalcDelegationCompoundRewards(&_Contract.CallOpts, delegator, toStakerID, _fromEpoch, maxEpochs)
}
Severity: Major
Found in gossip/sfc202/contract.go and 7 other locations - About 55 mins to fix
gossip/sfc202/contract.go on lines 245..247
gossip/sfc202/contract.go on lines 270..272
gossip/sfc202/contract.go on lines 277..279
gossip/sfc204/contract.go on lines 221..223
gossip/sfc204/contract.go on lines 228..230
gossip/sfc204/contract.go on lines 253..255
gossip/sfc204/contract.go on lines 260..262

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

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

func (_Contract *ContractCallerSession) CalcDelegationRewards(delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
    return _Contract.Contract.CalcDelegationRewards(&_Contract.CallOpts, delegator, toStakerID, _fromEpoch, maxEpochs)
}
Severity: Major
Found in gossip/sfc202/contract.go and 7 other locations - About 55 mins to fix
gossip/sfc202/contract.go on lines 238..240
gossip/sfc202/contract.go on lines 245..247
gossip/sfc202/contract.go on lines 270..272
gossip/sfc204/contract.go on lines 221..223
gossip/sfc204/contract.go on lines 228..230
gossip/sfc204/contract.go on lines 253..255
gossip/sfc204/contract.go on lines 260..262

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

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

func (_Contract *ContractCallerSession) CalcDelegationCompoundRewards(delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
    return _Contract.Contract.CalcDelegationCompoundRewards(&_Contract.CallOpts, delegator, toStakerID, _fromEpoch, maxEpochs)
}
Severity: Major
Found in gossip/sfc204/contract.go and 7 other locations - About 55 mins to fix
gossip/sfc202/contract.go on lines 238..240
gossip/sfc202/contract.go on lines 245..247
gossip/sfc202/contract.go on lines 270..272
gossip/sfc202/contract.go on lines 277..279
gossip/sfc204/contract.go on lines 221..223
gossip/sfc204/contract.go on lines 253..255
gossip/sfc204/contract.go on lines 260..262

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

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

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

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

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

Refactorings

Further Reading

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

func (_Contract *ContractCaller) CalcRawValidatorEpochReward(opts *bind.CallOpts, stakerID *big.Int, epoch *big.Int) (*big.Int, error) {
    var (
        ret0 = new(*big.Int)
    )
    out := ret0
Severity: Minor
Found in gossip/sfc110/contract.go and 1 other location - About 55 mins to fix
gossip/sfc204/contract.go on lines 299..306

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

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

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

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

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

Refactorings

Further Reading

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

func (_Contract *ContractCaller) CalcValidatorLockupPenalty(opts *bind.CallOpts, stakerID *big.Int, withdrawalAmount *big.Int) (*big.Int, error) {
    var (
        ret0 = new(*big.Int)
    )
    out := ret0
Severity: Minor
Found in gossip/sfc204/contract.go and 1 other location - About 55 mins to fix
gossip/sfc110/contract.go on lines 220..227

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

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

Function Dir has 9 return statements (exceeds 4 allowed).
Open

func Dir(src string, dst string) (err error) {
    src = filepath.Clean(src)
    dst = filepath.Clean(dst)

    si, err := os.Stat(src)
Severity: Major
Found in utils/iocopy/dir.go - About 55 mins to fix

    Method ProtocolManager.txsyncLoop has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
    Open

    func (pm *ProtocolManager) txsyncLoop() {
        var (
            pending = make(map[enode.ID]*txsync)
            sending = false               // whether a send is active
            pack    = new(txsync)         // the pack that is being sent
    Severity: Minor
    Found in gossip/sync.go - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    func (vi *Index) GetLowestAfterSeq(id hash.Event) LowestAfterSeq {
        if bVal, okGet := vi.cache.LowestAfterSeq.Get(id); okGet {
            return bVal.(LowestAfterSeq)
        }
    
    
    Severity: Major
    Found in vector/store_vectors.go and 2 other locations - About 55 mins to fix
    vector/store_vectors.go on lines 38..46
    vector/store_vectors.go on lines 49..57

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

    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

    Method FilterCriteria.UnmarshalJSON has 9 return statements (exceeds 4 allowed).
    Open

    func (args *FilterCriteria) UnmarshalJSON(data []byte) error {
        type input struct {
            BlockHash *common.Hash     `json:"blockHash"`
            FromBlock *rpc.BlockNumber `json:"fromBlock"`
            ToBlock   *rpc.BlockNumber `json:"toBlock"`
    Severity: Major
    Found in gossip/filters/api.go - About 55 mins to fix

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

      func (vi *Index) GetHighestBeforeTime(id hash.Event) HighestBeforeTime {
          if bVal, okGet := vi.cache.HighestBeforeTime.Get(id); okGet {
              return bVal.(HighestBeforeTime)
          }
      
      
      Severity: Major
      Found in vector/store_vectors.go and 2 other locations - About 55 mins to fix
      vector/store_vectors.go on lines 27..35
      vector/store_vectors.go on lines 38..46

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 125.

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

      func (vi *Index) GetHighestBeforeSeq(id hash.Event) HighestBeforeSeq {
          if bVal, okGet := vi.cache.HighestBeforeSeq.Get(id); okGet {
              return bVal.(HighestBeforeSeq)
          }
      
      
      Severity: Major
      Found in vector/store_vectors.go and 2 other locations - About 55 mins to fix
      vector/store_vectors.go on lines 27..35
      vector/store_vectors.go on lines 49..57

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

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

      func (_Contract *ContractCaller) RewardsStash(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {
          var (
              ret0 = new(*big.Int)
          )
          out := ret0
      Severity: Major
      Found in gossip/sfc110/contract.go and 6 other locations - About 55 mins to fix
      gossip/sfc202/contract.go on lines 426..433
      gossip/sfc202/contract.go on lines 746..753
      gossip/sfc202/contract.go on lines 1324..1331
      gossip/sfc204/contract.go on lines 435..442
      gossip/sfc204/contract.go on lines 755..762
      gossip/sfc204/contract.go on lines 1251..1258

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

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

      func (_Contract *ContractCaller) DelegationEarlyWithdrawalPenalty(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {
          var (
              ret0 = new(*big.Int)
          )
          out := ret0
      Severity: Major
      Found in gossip/sfc204/contract.go and 6 other locations - About 55 mins to fix
      gossip/sfc110/contract.go on lines 1150..1157
      gossip/sfc202/contract.go on lines 426..433
      gossip/sfc202/contract.go on lines 746..753
      gossip/sfc202/contract.go on lines 1324..1331
      gossip/sfc204/contract.go on lines 755..762
      gossip/sfc204/contract.go on lines 1251..1258

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

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

      func (_Contract *ContractCaller) RewardsStash(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {
          var (
              ret0 = new(*big.Int)
          )
          out := ret0
      Severity: Major
      Found in gossip/sfc204/contract.go and 6 other locations - About 55 mins to fix
      gossip/sfc110/contract.go on lines 1150..1157
      gossip/sfc202/contract.go on lines 426..433
      gossip/sfc202/contract.go on lines 746..753
      gossip/sfc202/contract.go on lines 1324..1331
      gossip/sfc204/contract.go on lines 435..442
      gossip/sfc204/contract.go on lines 755..762

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

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

      func (_Contract *ContractCaller) DelegationEarlyWithdrawalPenalty(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {
          var (
              ret0 = new(*big.Int)
          )
          out := ret0
      Severity: Major
      Found in gossip/sfc202/contract.go and 6 other locations - About 55 mins to fix
      gossip/sfc110/contract.go on lines 1150..1157
      gossip/sfc202/contract.go on lines 746..753
      gossip/sfc202/contract.go on lines 1324..1331
      gossip/sfc204/contract.go on lines 435..442
      gossip/sfc204/contract.go on lines 755..762
      gossip/sfc204/contract.go on lines 1251..1258

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

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

      func (_Contract *ContractCaller) GetDelegationRewardRatio(opts *bind.CallOpts, delegator common.Address, toStakerID *big.Int) (*big.Int, error) {
          var (
              ret0 = new(*big.Int)
          )
          out := ret0
      Severity: Major
      Found in gossip/sfc204/contract.go and 6 other locations - About 55 mins to fix
      gossip/sfc110/contract.go on lines 1150..1157
      gossip/sfc202/contract.go on lines 426..433
      gossip/sfc202/contract.go on lines 746..753
      gossip/sfc202/contract.go on lines 1324..1331
      gossip/sfc204/contract.go on lines 435..442
      gossip/sfc204/contract.go on lines 1251..1258

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

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

      func (_Contract *ContractCaller) GetDelegationRewardRatio(opts *bind.CallOpts, delegator common.Address, toStakerID *big.Int) (*big.Int, error) {
          var (
              ret0 = new(*big.Int)
          )
          out := ret0
      Severity: Major
      Found in gossip/sfc202/contract.go and 6 other locations - About 55 mins to fix
      gossip/sfc110/contract.go on lines 1150..1157
      gossip/sfc202/contract.go on lines 426..433
      gossip/sfc202/contract.go on lines 1324..1331
      gossip/sfc204/contract.go on lines 435..442
      gossip/sfc204/contract.go on lines 755..762
      gossip/sfc204/contract.go on lines 1251..1258

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

      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