grokify/mogo

View on GitHub

Showing 90 of 147 total issues

Method Times.RangeLower has 5 return statements (exceeds 4 allowed).
Open

func (ts Times) RangeLower(t time.Time, inclusive bool) (time.Time, error) {
    if len(ts) == 0 {
        return t, ErrEmptyTimeSlice
    }
    sortedTS := ts.Dedupe()
Severity: Major
Found in time/timeutil/times.go - About 35 mins to fix

    Method TimeMore.SeasonMeteorological has 5 return statements (exceeds 4 allowed).
    Open

    func (tm TimeMore) SeasonMeteorological() Yearquarter {
        m := tm.time.Month()
        if m < 3 {
            return Winter // Starts December 1
        } else if m < 6 {
    Severity: Major
    Found in time/timeutil/timemore.go - About 35 mins to fix

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

      func UserToAbsolute(file string) (string, error) {
          file = strings.TrimSpace(file)
          parts := strings.Split(file, string(os.PathSeparator))
          if len(parts) == 0 {
              return file, nil
      Severity: Major
      Found in path/filepathutil/filepathutil.go - About 35 mins to fix

        Method TimeRange.IntersectionDuration has 5 return statements (exceeds 4 allowed).
        Open

        func (tr *TimeRange) IntersectionDuration(tr2 TimeRange) time.Duration {
            tr.Normalize()
            tr2.Normalize()
            if tr2.Min.After(tr.Max) || tr2.Max.Before(tr.Min) {
                // No overlap
        Severity: Major
        Found in time/timeutil/time_range.go - About 35 mins to fix

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

          func WriteCSVFiltered(reader *csv.Reader, writer *csv.Writer, andFilter map[string]stringsutil.MatchInfo, writeHeader bool) error {
              csvHeader := CSVHeader{}
              i := -1
              for {
                  line, err := reader.Read()
          Severity: Major
          Found in encoding/csvutil/write.go - About 35 mins to fix

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

            func NewRequest(method, url string, params url.Values, files []FileInfo) (*http.Request, error) {
                mb := NewMultipartBuilder()
                err := mb.WriteURLValues(params)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in mime/multipartutil/multipart_request.go - About 35 mins to fix

              Method Times.RangeUpper has 5 return statements (exceeds 4 allowed).
              Open

              func (ts Times) RangeUpper(t time.Time, inclusive bool) (time.Time, error) {
                  if len(ts) == 0 {
                      return t, ErrEmptyTimeSlice
                  }
                  sortedTS := ts.Dedupe()
              Severity: Major
              Found in time/timeutil/times.go - About 35 mins to fix

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

                func StartEndDT6s(dt6s []int32) (int32, int32) {
                    if len(dt6s) == 0 {
                        return -1, -1
                    }
                
                
                Severity: Major
                Found in time/month/strconv.go - About 35 mins to fix

                  Method RangeFloat64.binarySearch has 5 return statements (exceeds 4 allowed).
                  Open

                  func (rng *RangeFloat64) binarySearch(v float64, l, r int32) (int32, error) {
                      rng.iter += 1
                      if rng.iter > MaxTries {
                          return int32(0), fmt.Errorf("too many (%v) binary search iterations", MaxTries)
                      }
                  Severity: Major
                  Found in math/mathutil/rangefloat64.go - About 35 mins to fix

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

                    func RatioInt(x1, y1, x2, y2 int) (int, int) {
                        if x2 > 0 && y2 > 0 {
                            return x2, y2
                        } else if x2 <= 0 && y2 <= 0 {
                            return x1, y1
                    Severity: Major
                    Found in math/ratio/ratio.go - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language