Fantom-foundation/go-lachesis

View on GitHub

Showing 829 of 829 total issues

Method ContractFilterer.WatchPartialWithdrawnByRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (_Contract *ContractFilterer) WatchPartialWithdrawnByRequest(opts *bind.WatchOpts, sink chan<- *ContractPartialWithdrawnByRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {
Severity: Minor
Found in gossip/sfc110/contract.go - About 35 mins to fix

    Function ReadGasPowerContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func ReadGasPowerContext(s *Store, a *app.Store, validators *pos.Validators, epoch idx.Epoch, cfg *lachesis.EconomyConfig) *gaspowercheck.ValidationContext {
    Severity: Minor
    Found in gossip/checker_helpers.go - About 35 mins to fix

      Method ContractFilterer.WatchCreatedWithdrawRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (_Contract *ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {
      Severity: Minor
      Found in gossip/sfc204/contract.go - About 35 mins to fix

        Method ContractCaller.CalcDelegationCompoundRewards has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (_Contract *ContractCaller) CalcDelegationCompoundRewards(opts *bind.CallOpts, delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
        Severity: Minor
        Found in gossip/sfc202/contract.go - About 35 mins to fix

          Method ContractFilterer.WatchCreatedWithdrawRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func (_Contract *ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {
          Severity: Minor
          Found in gossip/sfc202/contract.go - About 35 mins to fix

            Method ContractFilterer.WatchUpdatedStakerSfcAddress has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func (_Contract *ContractFilterer) WatchUpdatedStakerSfcAddress(opts *bind.WatchOpts, sink chan<- *ContractUpdatedStakerSfcAddress, stakerID []*big.Int, oldSfcAddress []common.Address, newSfcAddress []common.Address) (event.Subscription, error) {
            Severity: Minor
            Found in gossip/sfc202/contract.go - About 35 mins to fix

              Method ContractFilterer.WatchPartialWithdrawnByRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func (_Contract *ContractFilterer) WatchPartialWithdrawnByRequest(opts *bind.WatchOpts, sink chan<- *ContractPartialWithdrawnByRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {
              Severity: Minor
              Found in gossip/sfc204/contract.go - About 35 mins to fix

                Method Service.updateOriginationScores has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func (s *Service) updateOriginationScores(block *inter.Block, evmBlock *evmcore.EvmBlock, receipts types.Receipts, txPositions map[common.Hash]TxPosition, sealEpoch bool) {
                Severity: Minor
                Found in gossip/scores.go - About 35 mins to fix

                  Function makeCheckers has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func makeCheckers(net *lachesis.Config, heavyCheckReader *HeavyCheckReader, gasPowerCheckReader *GasPowerCheckReader, engine Consensus, store *Store) *eventcheck.Checkers {
                  Severity: Minor
                  Found in gossip/service.go - About 35 mins to fix

                    Method ContractCaller.CalcDelegationRewards has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func (_Contract *ContractCaller) CalcDelegationRewards(opts *bind.CallOpts, delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
                    Severity: Minor
                    Found in gossip/sfc204/contract.go - About 35 mins to fix

                      Method ContractFilterer.WatchPartialWithdrawnByRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      func (_Contract *ContractFilterer) WatchPartialWithdrawnByRequest(opts *bind.WatchOpts, sink chan<- *ContractPartialWithdrawnByRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {
                      Severity: Minor
                      Found in gossip/sfc202/contract.go - About 35 mins to fix

                        Method PeerPacksDownloader.NotifyPack has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        func (d *PeerPacksDownloader) NotifyPack(epoch idx.Epoch, index idx.Pack, ids hash.Events, time time.Time, fetchEvents fetcher.EventsRequesterFn) error {
                        Severity: Minor
                        Found in gossip/packsdownloader/peer_downloader.go - About 35 mins to fix

                          Method ContractFilterer.WatchUpdatedDelegation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          func (_Contract *ContractFilterer) WatchUpdatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractUpdatedDelegation, delegator []common.Address, oldStakerID []*big.Int, newStakerID []*big.Int) (event.Subscription, error) {
                          Severity: Minor
                          Found in gossip/sfc204/contract.go - About 35 mins to fix

                            Method ContractFilterer.WatchUpdatedDelegation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            func (_Contract *ContractFilterer) WatchUpdatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractUpdatedDelegation, delegator []common.Address, oldStakerID []*big.Int, newStakerID []*big.Int) (event.Subscription, error) {
                            Severity: Minor
                            Found in gossip/sfc202/contract.go - About 35 mins to fix

                              Function newPeer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              func newPeer(peer Peer, myEpoch idx.Epoch, fetcher *fetcher.Fetcher, onlyNotConnected onlyNotConnectedFn, dropPeer dropPeerFn) *PeerPacksDownloader {
                              Severity: Minor
                              Found in gossip/packsdownloader/peer_downloader.go - About 35 mins to fix

                                Method ContractCaller.CalcDelegationRewards has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                func (_Contract *ContractCaller) CalcDelegationRewards(opts *bind.CallOpts, delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
                                Severity: Minor
                                Found in gossip/sfc202/contract.go - About 35 mins to fix

                                  Method Service.updateUsersPOI has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  func (s *Service) updateUsersPOI(block *inter.Block, evmBlock *evmcore.EvmBlock, receipts types.Receipts, totalFee *big.Int, sealEpoch bool) {
                                  Severity: Minor
                                  Found in gossip/poi.go - About 35 mins to fix

                                    Method ContractCaller.CalcDelegationCompoundRewards has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func (_Contract *ContractCaller) CalcDelegationCompoundRewards(opts *bind.CallOpts, delegator common.Address, toStakerID *big.Int, _fromEpoch *big.Int, maxEpochs *big.Int) (*big.Int, *big.Int, *big.Int, error) {
                                    Severity: Minor
                                    Found in gossip/sfc204/contract.go - About 35 mins to fix

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

                                      func (s *PublicTransactionPoolAPI) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) hexutil.Bytes {
                                          if block, _ := s.b.BlockByNumber(ctx, blockNr); block != nil {
                                              return newRPCRawTransactionFromBlockIndex(block, uint64(index))
                                          }
                                          return nil
                                      Severity: Minor
                                      Found in ethapi/api.go and 1 other location - About 35 mins to fix
                                      ethapi/api.go on lines 1419..1424

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

                                      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 *PublicTransactionPoolAPI) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) hexutil.Bytes {
                                          if block, _ := s.b.BlockByHash(ctx, blockHash); block != nil {
                                              return newRPCRawTransactionFromBlockIndex(block, uint64(index))
                                          }
                                          return nil
                                      Severity: Minor
                                      Found in ethapi/api.go and 1 other location - About 35 mins to fix
                                      ethapi/api.go on lines 1411..1416

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

                                      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