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 *ContractSession) WithdrawalRequests(arg0 common.Address, arg1 *big.Int) (struct {
    StakerID   *big.Int
    Epoch      *big.Int
    Time       *big.Int
    Amount     *big.Int
Severity: Major
Found in gossip/sfc202/contract.go and 5 other locations - About 1 hr to fix
gossip/sfc110/contract.go on lines 1552..1560
gossip/sfc110/contract.go on lines 1565..1573
gossip/sfc202/contract.go on lines 1765..1773
gossip/sfc204/contract.go on lines 1679..1687
gossip/sfc204/contract.go on lines 1692..1700

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

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

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

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

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

Refactorings

Further Reading

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

func (s *Store) set(table kvdb.KeyValueStore, key []byte, val interface{}) {
    buf, err := rlp.EncodeToBytes(val)
    if err != nil {
        s.Log.Crit("Failed to encode rlp", "err", err)
    }
Severity: Major
Found in app/store.go and 2 other locations - About 1 hr to fix
gossip/store.go on lines 181..190
poset/store.go on lines 129..138

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

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

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

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

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

Refactorings

Further Reading

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

func (s *Store) set(table kvdb.KeyValueStore, key []byte, val interface{}) {
    buf, err := rlp.EncodeToBytes(val)
    if err != nil {
        s.Log.Crit("Failed to encode rlp", "err", err)
    }
Severity: Major
Found in gossip/store.go and 2 other locations - About 1 hr to fix
app/store.go on lines 147..156
poset/store.go on lines 129..138

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

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 *ContractCallerSession) WithdrawalRequests(arg0 common.Address, arg1 *big.Int) (struct {
    StakerID   *big.Int
    Epoch      *big.Int
    Time       *big.Int
    Amount     *big.Int
Severity: Major
Found in gossip/sfc204/contract.go and 5 other locations - About 1 hr to fix
gossip/sfc110/contract.go on lines 1552..1560
gossip/sfc110/contract.go on lines 1565..1573
gossip/sfc202/contract.go on lines 1752..1760
gossip/sfc202/contract.go on lines 1765..1773
gossip/sfc204/contract.go on lines 1679..1687

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

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

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

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

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

Refactorings

Further Reading

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

func (s *Store) set(table kvdb.KeyValueStore, key []byte, val interface{}) {
    buf, err := rlp.EncodeToBytes(val)
    if err != nil {
        s.Log.Crit("Failed to encode rlp", "err", err)
    }
Severity: Major
Found in poset/store.go and 2 other locations - About 1 hr to fix
app/store.go on lines 147..156
gossip/store.go on lines 181..190

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

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 *ContractSession) WithdrawalRequests(arg0 common.Address, arg1 *big.Int) (struct {
    StakerID   *big.Int
    Epoch      *big.Int
    Time       *big.Int
    Amount     *big.Int
Severity: Major
Found in gossip/sfc204/contract.go and 5 other locations - About 1 hr to fix
gossip/sfc110/contract.go on lines 1552..1560
gossip/sfc110/contract.go on lines 1565..1573
gossip/sfc202/contract.go on lines 1752..1760
gossip/sfc202/contract.go on lines 1765..1773
gossip/sfc204/contract.go on lines 1692..1700

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

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 (s *Store) GetNonSupportedUpgrade() *big.Int {
    valBytes, err := s.table.NetworkVersion.Get([]byte(diKey))
    if err != nil {
        s.Log.Crit("Failed to get key", "err", err)
    }
Severity: Major
Found in gossip/store_network_version.go and 1 other location - About 1 hr to fix
gossip/store_network_version.go on lines 21..31

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

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 (s *Store) GetNetworkVersion() *big.Int {
    valBytes, err := s.table.NetworkVersion.Get([]byte(nvKey))
    if err != nil {
        s.Log.Crit("Failed to get key", "err", err)
    }
Severity: Major
Found in gossip/store_network_version.go and 1 other location - About 1 hr to fix
gossip/store_network_version.go on lines 42..52

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

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 precacheTransaction has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

func precacheTransaction(config *params.ChainConfig, bc DummyChain, author *common.Address, gaspool *GasPool, statedb *state.StateDB, header *EvmHeader, tx *types.Transaction, cfg vm.Config) error {
Severity: Major
Found in evmcore/state_prefetcher.go - About 1 hr to fix

    Function DoCall has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides map[common.Address]account, vmCfg vm.Config, timeout time.Duration, globalGasCap uint64) (*evmcore.ExecutionResult, error) {
    Severity: Major
    Found in ethapi/api.go - About 1 hr to fix

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

      func (s *Store) addValidationScore(t kvdb.KeyValueStore, stakerID idx.StakerID, diff *big.Int) {
          score := s.getValidationScore(t, stakerID)
          score.Add(score, diff)
          err := t.Put(stakerID.Bytes(), score.Bytes())
          if err != nil {
      Severity: Minor
      Found in app/store_scores.go and 1 other location - About 1 hr to fix
      app/store_scores.go on lines 178..185

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

      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 (s *Store) addOriginationScore(t kvdb.KeyValueStore, stakerID idx.StakerID, diff *big.Int) {
          score := s.getOriginationScore(t, stakerID)
          score.Add(score, diff)
          err := t.Put(stakerID.Bytes(), score.Bytes())
          if err != nil {
      Severity: Minor
      Found in app/store_scores.go and 1 other location - About 1 hr to fix
      app/store_scores.go on lines 95..102

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

      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 *ContractCallerSession) EpochValidator(e *big.Int, v *big.Int) (struct {
          StakeAmount      *big.Int
          DelegatedMe      *big.Int
          BaseRewardWeight *big.Int
          TxRewardWeight   *big.Int
      Severity: Major
      Found in gossip/sfc204/contract.go and 5 other locations - About 1 hr to fix
      gossip/sfc110/contract.go on lines 814..821
      gossip/sfc110/contract.go on lines 826..833
      gossip/sfc202/contract.go on lines 696..703
      gossip/sfc202/contract.go on lines 708..715
      gossip/sfc204/contract.go on lines 705..712

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

      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 *ContractSession) EpochValidator(e *big.Int, v *big.Int) (struct {
          StakeAmount      *big.Int
          DelegatedMe      *big.Int
          BaseRewardWeight *big.Int
          TxRewardWeight   *big.Int
      Severity: Major
      Found in gossip/sfc110/contract.go and 5 other locations - About 1 hr to fix
      gossip/sfc110/contract.go on lines 826..833
      gossip/sfc202/contract.go on lines 696..703
      gossip/sfc202/contract.go on lines 708..715
      gossip/sfc204/contract.go on lines 705..712
      gossip/sfc204/contract.go on lines 717..724

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

      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 *ContractSession) EpochValidator(e *big.Int, v *big.Int) (struct {
          StakeAmount      *big.Int
          DelegatedMe      *big.Int
          BaseRewardWeight *big.Int
          TxRewardWeight   *big.Int
      Severity: Major
      Found in gossip/sfc202/contract.go and 5 other locations - About 1 hr to fix
      gossip/sfc110/contract.go on lines 814..821
      gossip/sfc110/contract.go on lines 826..833
      gossip/sfc202/contract.go on lines 708..715
      gossip/sfc204/contract.go on lines 705..712
      gossip/sfc204/contract.go on lines 717..724

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

      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 *ContractSession) EpochValidator(e *big.Int, v *big.Int) (struct {
          StakeAmount      *big.Int
          DelegatedMe      *big.Int
          BaseRewardWeight *big.Int
          TxRewardWeight   *big.Int
      Severity: Major
      Found in gossip/sfc204/contract.go and 5 other locations - About 1 hr to fix
      gossip/sfc110/contract.go on lines 814..821
      gossip/sfc110/contract.go on lines 826..833
      gossip/sfc202/contract.go on lines 696..703
      gossip/sfc202/contract.go on lines 708..715
      gossip/sfc204/contract.go on lines 717..724

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

      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 *ContractCallerSession) EpochValidator(e *big.Int, v *big.Int) (struct {
          StakeAmount      *big.Int
          DelegatedMe      *big.Int
          BaseRewardWeight *big.Int
          TxRewardWeight   *big.Int
      Severity: Major
      Found in gossip/sfc202/contract.go and 5 other locations - About 1 hr to fix
      gossip/sfc110/contract.go on lines 814..821
      gossip/sfc110/contract.go on lines 826..833
      gossip/sfc202/contract.go on lines 696..703
      gossip/sfc204/contract.go on lines 705..712
      gossip/sfc204/contract.go on lines 717..724

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

      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 *ContractCallerSession) EpochValidator(e *big.Int, v *big.Int) (struct {
          StakeAmount      *big.Int
          DelegatedMe      *big.Int
          BaseRewardWeight *big.Int
          TxRewardWeight   *big.Int
      Severity: Major
      Found in gossip/sfc110/contract.go and 5 other locations - About 1 hr to fix
      gossip/sfc110/contract.go on lines 814..821
      gossip/sfc202/contract.go on lines 696..703
      gossip/sfc202/contract.go on lines 708..715
      gossip/sfc204/contract.go on lines 705..712
      gossip/sfc204/contract.go on lines 717..724

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

      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) 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 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 *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/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 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

      Severity
      Category
      Status
      Source
      Language