Fantom-foundation/go-lachesis

View on GitHub

Showing 291 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/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

      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

        Function exportEvents has 5 return statements (exceeds 4 allowed).
        Open

        func exportEvents(ctx *cli.Context) error {
            if len(ctx.Args()) < 1 {
                utils.Fatalf("This command requires an argument.")
            }
        
        
        Severity: Major
        Found in cmd/lachesis/export_events.go - About 35 mins to fix

          Method Index.Push has 5 return statements (exceeds 4 allowed).
          Open

          func (tt *Index) Push(recs ...*types.Log) error {
              for _, rec := range recs {
                  if len(rec.Topics) > MaxCount {
                      return ErrTooManyTopics
                  }
          Severity: Major
          Found in topicsdb/topicsdb.go - About 35 mins to fix

            Method Checker.checkInited has 5 return statements (exceeds 4 allowed).
            Open

            func (v *Checker) checkInited(e *inter.Event) error {
                if e.Seq <= 0 || e.Epoch <= 0 || e.Frame <= 0 || e.Lamport <= 0 {
                    return ErrNotInited // it's unsigned, but check for negative in a case if type will change
                }
            
            
            Severity: Major
            Found in eventcheck/basiccheck/basic_check.go - About 35 mins to fix

              Method Helper.AddSection has 5 return statements (exceeds 4 allowed).
              Open

              func (d *Helper) AddSection(name, after string) error {
                  if name == "" {
                      return nil
                  }
              
              
              Severity: Major
              Found in utils/toml/helper.go - About 35 mins to fix

                Method Store.ApplyGenesis has 5 return statements (exceeds 4 allowed).
                Open

                func (s *Store) ApplyGenesis(g *genesis.Genesis, genesisAtropos hash.Event, appHash common.Hash) error {
                    if g == nil {
                        return fmt.Errorf("genesis config shouldn't be nil")
                    }
                    if len(g.Alloc.Validators) == 0 {
                Severity: Major
                Found in poset/apply_genesis.go - About 35 mins to fix

                  Function parseFakeGen has 5 return statements (exceeds 4 allowed).
                  Open

                  func parseFakeGen(s string) (num int, vaccs genesis.VAccounts, err error) {
                      var i64 uint64
                  
                      parts := strings.SplitN(s, "/", 2)
                      if len(parts) != 2 {
                  Severity: Major
                  Found in cmd/lachesis/fake.go - About 35 mins to fix

                    Function measureDbDir has 5 return statements (exceeds 4 allowed).
                    Open

                    func measureDbDir() (size int64) {
                        datadir, ok := dbDir.Load().(string)
                        if !ok || datadir == "" || datadir == "inmemory" {
                            return
                        }
                    Severity: Major
                    Found in cmd/lachesis/metrics/metrics.go - About 35 mins to fix

                      Method SyncedPool.flush has 5 return statements (exceeds 4 allowed).
                      Open

                      func (p *SyncedPool) flush(id []byte) error {
                          key := []byte("flag")
                      
                          // drop old DBs
                          for name := range p.queuedDrops {
                      Severity: Major
                      Found in kvdb/flushable/synced_pool.go - About 35 mins to fix

                        Method Helper.getKVData has 5 return statements (exceeds 4 allowed).
                        Open

                        func (d *Helper) getKVData(name, sectionName string) (*ast.KeyValue, *ast.Table, error) {
                            sect, err := d.FindSection(sectionName)
                            if err != nil {
                                return nil, nil, err
                            }
                        Severity: Major
                        Found in utils/toml/helper.go - About 35 mins to fix

                          Method SyncedPool.checkDbsSynced has 5 return statements (exceeds 4 allowed).
                          Open

                          func (p *SyncedPool) checkDbsSynced() error {
                              p.Lock()
                              defer p.Unlock()
                          
                              var (
                          Severity: Major
                          Found in kvdb/flushable/synced_pool.go - About 35 mins to fix

                            Method EventHeaderData.UnmarshalBinary has 5 return statements (exceeds 4 allowed).
                            Open

                            func (e *EventHeaderData) UnmarshalBinary(raw []byte) (err error) {
                                defer func() {
                                    if r := recover(); r != nil {
                                        err = ErrInvalidEncoding
                                    }
                            Severity: Major
                            Found in inter/event_serializer.go - About 35 mins to fix

                              Method PublicTransactionPoolAPI.GetTransactionByHash has 5 return statements (exceeds 4 allowed).
                              Open

                              func (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error) {
                                  // Try to return an already finalized transaction
                                  tx, blockNumber, index, err := s.b.GetTransaction(ctx, hash)
                                  if err != nil {
                                      return nil, err
                              Severity: Major
                              Found in ethapi/api.go - About 35 mins to fix

                                Method PublicTransactionPoolAPI.GetTransactionReceipt has 5 return statements (exceeds 4 allowed).
                                Open

                                func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
                                    tx, blockNumber, index, err := s.b.GetTransaction(ctx, hash)
                                    if tx == nil || err != nil {
                                        return nil, err
                                    }
                                Severity: Major
                                Found in ethapi/api.go - About 35 mins to fix

                                  Method StateTransition.TransitionDb has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
                                      // First check this message satisfies all consensus rules before
                                      // applying the message. The rules include these clauses
                                      //
                                      // 1. the nonce of the message caller is correct
                                  Severity: Major
                                  Found in evmcore/state_transition.go - About 35 mins to fix

                                    Function writeTo has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func writeTo(parent string, t *ast.Table, w io.Writer) (err error) {
                                        var fullName string
                                        if parent != "" {
                                            fullName = parent + "." + t.Name
                                        } else {
                                    Severity: Major
                                    Found in utils/toml/file.go - About 35 mins to fix

                                      Method txList.Filter has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (l *txList) Filter(costLimit *big.Int, gasLimit uint64) (types.Transactions, types.Transactions) {
                                          // If all transactions are below the threshold, short circuit
                                          if l.costcap.Cmp(costLimit) <= 0 && l.gascap <= gasLimit {
                                              return nil, nil
                                          }
                                      Severity: Major
                                      Found in evmcore/tx_list.go - About 35 mins to fix

                                        Function ApplyGenesis has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func ApplyGenesis(db ethdb.Database, net *lachesis.Config) (*EvmBlock, error) {
                                            if net == nil {
                                                return nil, ErrNoGenesis
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in evmcore/apply_genesis.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language