Fantom-foundation/go-lachesis

View on GitHub

Showing 829 of 829 total issues

Method ContractCreatedDelegationIterator.Next has 7 return statements (exceeds 4 allowed).
Open

func (it *ContractCreatedDelegationIterator) Next() bool {
    // If the iterator failed, stop iterating
    if it.fail != nil {
        return false
    }
Severity: Major
Found in gossip/sfc110/contract.go - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if pool.locals.contains(offenders[i]) {
                            localGauge.Dec(int64(len(caps)))
                        }
    Severity: Major
    Found in evmcore/tx_pool.go - About 45 mins to fix

      Function New has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func New(path string, cache int, handles int, namespace string, close func() error, drop func()) (*Database, error) {
      Severity: Minor
      Found in kvdb/leveldb/leveldb.go - About 45 mins to fix

        Function File has 7 return statements (exceeds 4 allowed).
        Open

        func File(src, dst string) (err error) {
            in, err := os.Open(src)
            if err != nil {
                return
            }
        Severity: Major
        Found in utils/iocopy/file.go - About 45 mins to fix

          Method ProtocolManager.onNewEpochLoop has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
          Open

          func (pm *ProtocolManager) onNewEpochLoop() {
              defer pm.loopsWg.Done()
              for {
                  select {
                  case myEpoch := <-pm.newEpochsCh:
          Severity: Minor
          Found in gossip/handler.go - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method ContractOwnershipTransferredIterator.Next has 7 return statements (exceeds 4 allowed).
          Open

          func (it *ContractOwnershipTransferredIterator) Next() bool {
              // If the iterator failed, stop iterating
              if it.fail != nil {
                  return false
              }
          Severity: Major
          Found in gossip/sfc110/contract.go - About 45 mins to fix

            Method ContractPreparedToWithdrawDelegationIterator.Next has 7 return statements (exceeds 4 allowed).
            Open

            func (it *ContractPreparedToWithdrawDelegationIterator) Next() bool {
                // If the iterator failed, stop iterating
                if it.fail != nil {
                    return false
                }
            Severity: Major
            Found in gossip/sfc110/contract.go - About 45 mins to fix

              Method ContractWithdrawnStakeIterator.Next has 7 return statements (exceeds 4 allowed).
              Open

              func (it *ContractWithdrawnStakeIterator) Next() bool {
                  // If the iterator failed, stop iterating
                  if it.fail != nil {
                      return false
                  }
              Severity: Major
              Found in gossip/sfc204/contract.go - About 45 mins to fix

                Method ContractAdminChangedIterator.Next has 7 return statements (exceeds 4 allowed).
                Open

                func (it *ContractAdminChangedIterator) Next() bool {
                    // If the iterator failed, stop iterating
                    if it.fail != nil {
                        return false
                    }
                Severity: Major
                Found in gossip/sfcproxy/contract.go - About 45 mins to fix

                  Method ContractClaimedDelegationRewardIterator.Next has 7 return statements (exceeds 4 allowed).
                  Open

                  func (it *ContractClaimedDelegationRewardIterator) Next() bool {
                      // If the iterator failed, stop iterating
                      if it.fail != nil {
                          return false
                      }
                  Severity: Major
                  Found in gossip/sfc202/contract.go - About 45 mins to fix

                    Method ContractUpdatedDelegationIterator.Next has 7 return statements (exceeds 4 allowed).
                    Open

                    func (it *ContractUpdatedDelegationIterator) Next() bool {
                        // If the iterator failed, stop iterating
                        if it.fail != nil {
                            return false
                        }
                    Severity: Major
                    Found in gossip/sfc110/contract.go - About 45 mins to fix

                      Method ContractClaimedDelegationRewardIterator.Next has 7 return statements (exceeds 4 allowed).
                      Open

                      func (it *ContractClaimedDelegationRewardIterator) Next() bool {
                          // If the iterator failed, stop iterating
                          if it.fail != nil {
                              return false
                          }
                      Severity: Major
                      Found in gossip/sfc204/contract.go - About 45 mins to fix

                        Method ContractUnstashedRewardsIterator.Next has 7 return statements (exceeds 4 allowed).
                        Open

                        func (it *ContractUnstashedRewardsIterator) Next() bool {
                            // If the iterator failed, stop iterating
                            if it.fail != nil {
                                return false
                            }
                        Severity: Major
                        Found in gossip/sfc204/contract.go - About 45 mins to fix

                          Method ContractDeactivatedDelegationIterator.Next has 7 return statements (exceeds 4 allowed).
                          Open

                          func (it *ContractDeactivatedDelegationIterator) Next() bool {
                              // If the iterator failed, stop iterating
                              if it.fail != nil {
                                  return false
                              }
                          Severity: Major
                          Found in gossip/sfc110/contract.go - About 45 mins to fix

                            Method ContractPreparedToWithdrawStakeIterator.Next has 7 return statements (exceeds 4 allowed).
                            Open

                            func (it *ContractPreparedToWithdrawStakeIterator) Next() bool {
                                // If the iterator failed, stop iterating
                                if it.fail != nil {
                                    return false
                                }
                            Severity: Major
                            Found in gossip/sfc110/contract.go - About 45 mins to fix

                              Method ContractDeactivatedDelegationIterator.Next has 7 return statements (exceeds 4 allowed).
                              Open

                              func (it *ContractDeactivatedDelegationIterator) Next() bool {
                                  // If the iterator failed, stop iterating
                                  if it.fail != nil {
                                      return false
                                  }
                              Severity: Major
                              Found in gossip/sfc202/contract.go - About 45 mins to fix

                                Method ContractIncreasedStakeIterator.Next has 7 return statements (exceeds 4 allowed).
                                Open

                                func (it *ContractIncreasedStakeIterator) Next() bool {
                                    // If the iterator failed, stop iterating
                                    if it.fail != nil {
                                        return false
                                    }
                                Severity: Major
                                Found in gossip/sfc202/contract.go - About 45 mins to fix

                                  Method ContractLockingStakeIterator.Next has 7 return statements (exceeds 4 allowed).
                                  Open

                                  func (it *ContractLockingStakeIterator) Next() bool {
                                      // If the iterator failed, stop iterating
                                      if it.fail != nil {
                                          return false
                                      }
                                  Severity: Major
                                  Found in gossip/sfc202/contract.go - About 45 mins to fix

                                    Method ContractPreparedToWithdrawDelegationIterator.Next has 7 return statements (exceeds 4 allowed).
                                    Open

                                    func (it *ContractPreparedToWithdrawDelegationIterator) Next() bool {
                                        // If the iterator failed, stop iterating
                                        if it.fail != nil {
                                            return false
                                        }
                                    Severity: Major
                                    Found in gossip/sfc204/contract.go - About 45 mins to fix

                                      Method ContractUpdatedGasPowerAllocationRateIterator.Next has 7 return statements (exceeds 4 allowed).
                                      Open

                                      func (it *ContractUpdatedGasPowerAllocationRateIterator) Next() bool {
                                          // If the iterator failed, stop iterating
                                          if it.fail != nil {
                                              return false
                                          }
                                      Severity: Major
                                      Found in gossip/sfc204/contract.go - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language