Fantom-foundation/go-lachesis

View on GitHub

Showing 829 of 829 total issues

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

func (_Contract *ContractFilterer) FilterCreatedStake(opts *bind.FilterOpts, stakerID []*big.Int, dagSfcAddress []common.Address) (*ContractCreatedStakeIterator, error) {

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

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

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 GetAPIs has 82 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func GetAPIs(apiBackend Backend) []rpc.API {
    nonceLock := new(AddrLocker)
    orig := []rpc.API{
        {
            Namespace: "eth",
Severity: Major
Found in ethapi/backend.go - About 2 hrs to fix

    Method FilterCriteria.UnmarshalJSON has 82 lines of code (exceeds 50 allowed). Consider refactoring.
    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 2 hrs to fix

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

      func (_Contract *ContractFilterer) FilterUnstashedRewards(opts *bind.FilterOpts, auth []common.Address, receiver []common.Address) (*ContractUnstashedRewardsIterator, error) {
      
          var authRule []interface{}
          for _, authItem := range auth {
              authRule = append(authRule, authItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 5 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 3675..3691
      gossip/sfc202/contract.go on lines 4300..4316
      gossip/sfc202/contract.go on lines 4912..4928
      gossip/sfc204/contract.go on lines 4143..4159
      gossip/sfc204/contract.go on lines 4755..4771

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

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

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

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

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

      Refactorings

      Further Reading

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

      func (_Contract *ContractFilterer) FilterUnstashedRewards(opts *bind.FilterOpts, auth []common.Address, receiver []common.Address) (*ContractUnstashedRewardsIterator, error) {
      
          var authRule []interface{}
          for _, authItem := range auth {
              authRule = append(authRule, authItem)
      Severity: Major
      Found in gossip/sfc202/contract.go and 5 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 3675..3691
      gossip/sfc110/contract.go on lines 4287..4303
      gossip/sfc202/contract.go on lines 4300..4316
      gossip/sfc204/contract.go on lines 4143..4159
      gossip/sfc204/contract.go on lines 4755..4771

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

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

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

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

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

      Refactorings

      Further Reading

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

      func (_Contract *ContractFilterer) FilterUnstashedRewards(opts *bind.FilterOpts, auth []common.Address, receiver []common.Address) (*ContractUnstashedRewardsIterator, error) {
      
          var authRule []interface{}
          for _, authItem := range auth {
              authRule = append(authRule, authItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 5 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 3675..3691
      gossip/sfc110/contract.go on lines 4287..4303
      gossip/sfc202/contract.go on lines 4300..4316
      gossip/sfc202/contract.go on lines 4912..4928
      gossip/sfc204/contract.go on lines 4143..4159

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

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

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

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

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

      Refactorings

      Further Reading

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

      func (_Contract *ContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ContractOwnershipTransferredIterator, error) {
      
          var previousOwnerRule []interface{}
          for _, previousOwnerItem := range previousOwner {
              previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
      Severity: Major
      Found in gossip/sfc204/contract.go and 5 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 3675..3691
      gossip/sfc110/contract.go on lines 4287..4303
      gossip/sfc202/contract.go on lines 4300..4316
      gossip/sfc202/contract.go on lines 4912..4928
      gossip/sfc204/contract.go on lines 4755..4771

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

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

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

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

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

      Refactorings

      Further Reading

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

      func (_Contract *ContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ContractOwnershipTransferredIterator, error) {
      
          var previousOwnerRule []interface{}
          for _, previousOwnerItem := range previousOwner {
              previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
      Severity: Major
      Found in gossip/sfc202/contract.go and 5 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 3675..3691
      gossip/sfc110/contract.go on lines 4287..4303
      gossip/sfc202/contract.go on lines 4912..4928
      gossip/sfc204/contract.go on lines 4143..4159
      gossip/sfc204/contract.go on lines 4755..4771

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

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

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

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

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

      Refactorings

      Further Reading

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

      func (_Contract *ContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ContractOwnershipTransferredIterator, error) {
      
          var previousOwnerRule []interface{}
          for _, previousOwnerItem := range previousOwner {
              previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
      Severity: Major
      Found in gossip/sfc110/contract.go and 5 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 4287..4303
      gossip/sfc202/contract.go on lines 4300..4316
      gossip/sfc202/contract.go on lines 4912..4928
      gossip/sfc204/contract.go on lines 4143..4159
      gossip/sfc204/contract.go on lines 4755..4771

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

      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 DeployContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Contract, error) {
          parsed, err := abi.JSON(strings.NewReader(ContractABI))
          if err != nil {
              return common.Address{}, nil, nil, err
          }
      Severity: Major
      Found in gossip/sfc202/contract.go and 2 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 36..47
      gossip/sfcproxy/contract.go on lines 36..47

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

      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 DeployContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Contract, error) {
          parsed, err := abi.JSON(strings.NewReader(ContractABI))
          if err != nil {
              return common.Address{}, nil, nil, err
          }
      Severity: Major
      Found in gossip/sfc110/contract.go and 2 other locations - About 2 hrs to fix
      gossip/sfc202/contract.go on lines 36..47
      gossip/sfcproxy/contract.go on lines 36..47

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

      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 DeployContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Contract, error) {
          parsed, err := abi.JSON(strings.NewReader(ContractABI))
          if err != nil {
              return common.Address{}, nil, nil, err
          }
      Severity: Major
      Found in gossip/sfcproxy/contract.go and 2 other locations - About 2 hrs to fix
      gossip/sfc110/contract.go on lines 36..47
      gossip/sfc202/contract.go on lines 36..47

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

      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 Election.ProcessRoot has 81 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

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

        Function DoEstimateGas has 81 lines of code (exceeds 50 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: Major
        Found in ethapi/api.go - About 2 hrs to fix

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

          func (_Contract *ContractCaller) CalcValidatorRewards(opts *bind.CallOpts, stakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
              var (
                  ret0 = new(*big.Int)
                  ret1 = new(*big.Int)
                  ret2 = new(*big.Int)
          Severity: Major
          Found in gossip/sfc202/contract.go and 4 other locations - About 2 hrs to fix
          gossip/sfc110/contract.go on lines 460..473
          gossip/sfc202/contract.go on lines 284..297
          gossip/sfc204/contract.go on lines 267..280
          gossip/sfc204/contract.go on lines 325..338

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

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

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

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

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

          Refactorings

          Further Reading

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

          func (_Contract *ContractCaller) EpochValidator(opts *bind.CallOpts, 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 2 other locations - About 2 hrs to fix
          gossip/sfc202/contract.go on lines 676..691
          gossip/sfc204/contract.go on lines 685..700

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

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

          func (_Contract *ContractCaller) CalcValidatorCompoundRewards(opts *bind.CallOpts, stakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
              var (
                  ret0 = new(*big.Int)
                  ret1 = new(*big.Int)
                  ret2 = new(*big.Int)
          Severity: Major
          Found in gossip/sfc202/contract.go and 4 other locations - About 2 hrs to fix
          gossip/sfc110/contract.go on lines 460..473
          gossip/sfc202/contract.go on lines 316..329
          gossip/sfc204/contract.go on lines 267..280
          gossip/sfc204/contract.go on lines 325..338

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

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

          func (_Contract *ContractCaller) CalcValidatorRewards(opts *bind.CallOpts, stakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
              var (
                  ret0 = new(*big.Int)
                  ret1 = new(*big.Int)
                  ret2 = new(*big.Int)
          Severity: Major
          Found in gossip/sfc204/contract.go and 4 other locations - About 2 hrs to fix
          gossip/sfc110/contract.go on lines 460..473
          gossip/sfc202/contract.go on lines 284..297
          gossip/sfc202/contract.go on lines 316..329
          gossip/sfc204/contract.go on lines 267..280

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

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

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

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

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

          Refactorings

          Further Reading

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

          func (_Contract *ContractCaller) EpochValidator(opts *bind.CallOpts, 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 2 other locations - About 2 hrs to fix
          gossip/sfc110/contract.go on lines 794..809
          gossip/sfc204/contract.go on lines 685..700

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

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

          func (_Contract *ContractCaller) CalcValidatorRewards(opts *bind.CallOpts, stakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
              var (
                  ret0 = new(*big.Int)
                  ret1 = new(*big.Int)
                  ret2 = new(*big.Int)
          Severity: Major
          Found in gossip/sfc110/contract.go and 4 other locations - About 2 hrs to fix
          gossip/sfc202/contract.go on lines 284..297
          gossip/sfc202/contract.go on lines 316..329
          gossip/sfc204/contract.go on lines 267..280
          gossip/sfc204/contract.go on lines 325..338

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

          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