Showing 291 of 829 total issues
Method Checker.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (v *Checker) Validate(e *inter.Event) error {
addrs, epoch := v.reader.GetEpochPubKeys()
if e.Epoch != epoch {
return epochcheck.ErrNotRelevant
}
Method txJournal.rotate
has 6 return statements (exceeds 4 allowed). Open
Open
func (journal *txJournal) rotate(all map[common.Address]types.Transactions) error {
// Close the current journal (if any is open)
if journal.writer != nil {
if err := journal.writer.Close(); err != nil {
return err
Method Store.MigrateMultiDelegations
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Store) MigrateMultiDelegations() error {
{ // migrate s.table.Delegations
newKeys := make([][]byte, 0, 10000)
newValues := make([][]byte, 0, 10000)
{
Method Checkers.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (v *Checkers) Validate(e *inter.Event, parents []*inter.EventHeaderData) error {
if err := v.Basiccheck.Validate(e); err != nil {
return err
}
if err := v.Epochcheck.Validate(e); err != nil {
Method iterator.Next
has 6 return statements (exceeds 4 allowed). Open
Open
func (it *iterator) Next() bool {
it.lock.Lock()
defer it.lock.Unlock()
if it.Error() != nil {
Method Migration.Exec
has 6 return statements (exceeds 4 allowed). Open
Open
func (m *Migration) Exec(curr IDStore) error {
currID := curr.GetID()
myID := m.ID()
if m.veryFirst() {
Method TxPool.reset
has 6 return statements (exceeds 4 allowed). Open
Open
func (pool *TxPool) reset(oldHead, newHead *EvmHeader) {
// If we're reorging an old state, reinject all dropped transactions
var reinject types.Transactions
if oldHead != nil && oldHead.Hash != newHead.ParentHash {
Method SendTxArgs.setDefaults
has 6 return statements (exceeds 4 allowed). Open
Open
func (args *SendTxArgs) setDefaults(ctx context.Context, b Backend) error {
if args.GasPrice == nil {
price, err := b.SuggestPrice(ctx)
if err != nil {
return err
Method Poset.calcFrameIdx
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *Poset) calcFrameIdx(e *inter.Event, checkOnly bool) (frame idx.Frame, isRoot bool) {
if len(e.Parents) == 0 {
// special case for very first events in the epoch
return 1, true
}
Consider simplifying this complex logical expression. Open
Open
if e.Seq >= math.MaxInt32/2 || e.Epoch >= math.MaxInt32/2 || e.Frame >= math.MaxInt32/2 ||
e.Lamport >= math.MaxInt32/2 || e.GasPowerUsed >= math.MaxInt64/2 || e.GasPowerLeft.Max() >= math.MaxInt64/2 {
Method Checker.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (v *Checker) Validate(e *inter.Event) error {
if e.Version != 0 {
return ErrVersion
}
if err := v.checkLimits(e); err != nil {
Method EventSystem.SubscribeLogs
has 6 return statements (exceeds 4 allowed). Open
Open
func (es *EventSystem) SubscribeLogs(crit ethereum.FilterQuery, logs chan []*types.Log) (*Subscription, error) {
var from, to rpc.BlockNumber
if crit.FromBlock == nil {
from = rpc.LatestBlockNumber
} else {
Method PeerPacksDownloader.binarySearchReq
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *PeerPacksDownloader) binarySearchReq() (requestIndex idx.Pack, requestFull bool, syncedUp bool) {
it := d.packInfos.Iterator()
var prevIdx *idx.Pack
for it.End(); it.Prev(); {
Method Service.processEvent
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Service) processEvent(realEngine Consensus, e *inter.Event) error {
// s.engineMu is locked here
if s.stopped {
return errStopped
}
Method Filter.Logs
has 6 return statements (exceeds 4 allowed). Open
Open
func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) {
// If we're doing singleton block filtering, execute and return
if f.block != hash.Zero {
header, err := f.backend.HeaderByHash(ctx, f.block)
if err != nil {
Function DoEstimateGas
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, gasCap uint64) (hexutil.Uint64, error) {
Function GenerateChain
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func GenerateChain(config *params.ChainConfig, parent *EvmBlock, db ethdb.Database, n int, gen func(int, *BlockGen)) ([]*EvmBlock, []types.Receipts, DummyChain) {
Function ForEachRandEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
nodes []idx.StakerID,
eventCount int,
parentCount int,
r *rand.Rand,
callback ForEachEvent,
Method ContractFilterer.WatchCreatedWithdrawRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (_Contract *ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {
Method ContractFilterer.WatchUpdatedDelegation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (_Contract *ContractFilterer) WatchUpdatedDelegation(opts *bind.WatchOpts, sink chan<- *ContractUpdatedDelegation, delegator []common.Address, oldStakerID []*big.Int, newStakerID []*big.Int) (event.Subscription, error) {