Fantom-foundation/go-lachesis

View on GitHub
eventcheck/basiccheck/basic_check.go

Summary

Maintainability
A
1 hr
Test Coverage

Consider simplifying this complex logical expression.
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 {
Severity: Major
Found in eventcheck/basiccheck/basic_check.go - About 40 mins to fix

    Method Checker.Validate has 6 return statements (exceeds 4 allowed).
    Open

    func (v *Checker) Validate(e *inter.Event) error {
        if e.Version != 0 {
            return ErrVersion
        }
        if err := v.checkLimits(e); err != nil {
    Severity: Major
    Found in eventcheck/basiccheck/basic_check.go - About 40 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

        There are no issues that match your filters.

        Category
        Status