grokify/mogo

View on GitHub

Showing 98 of 159 total issues

Method RegexpSet.FindAllString has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (set *RegexpSet) FindAllString(pattern string, s string, n int, useStore bool, key string) []string {
Severity: Minor
Found in regexp/regexputil/regexputil.go - About 35 mins to fix

    Function BuildGifAnimationSimpleRead has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func BuildGifAnimationSimpleRead(src *gif.GIF, delay int, names []string, f ToPalettedFunc, consistentSize bool) (*gif.GIF, error) {
    Severity: Minor
    Found in image/imageutil/animate.go - About 35 mins to fix

      Function TimeDeltaDowString has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func TimeDeltaDowString(base time.Time, wantDowS string, deltaUnits int, wantInclusive bool, wantStartOfDay bool) (time.Time, error) {
      Severity: Minor
      Found in time/timeutil/timeutil_delta.go - About 35 mins to fix

        Function LogOrNotAny has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func LogOrNotAny(ctx context.Context, logger *slog.Logger, level slog.Level, msg string, args ...any) {
        Severity: Minor
        Found in log/slogutil/slogutil.go - About 35 mins to fix

          Function TimeDeltaDow has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func TimeDeltaDow(base time.Time, wantDow time.Weekday, deltaUnits int, wantInclusive bool, wantStartOfDay bool) (time.Time, error) {
          Severity: Minor
          Found in time/timeutil/timeutil_delta.go - About 35 mins to fix

            Function TimeDeltaDowInt has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func TimeDeltaDowInt(base time.Time, wantDow time.Weekday, deltaUnits int, wantInclusive bool, wantStartOfDay bool) (time.Time, error) {
            Severity: Minor
            Found in time/timeutil/timeutil_delta.go - About 35 mins to fix

              Function ReadCSVFilesSingleColumnValuesString has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func ReadCSVFilesSingleColumnValuesString(files []string, sep rune, hasHeader, trimSpace bool, colIdx uint, condenseUniqueSort bool) ([]string, error) {
              Severity: Minor
              Found in encoding/csvutil/single_column.go - About 35 mins to fix

                Method RegexpSet.FindAllStringSubmatch has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func (set *RegexpSet) FindAllStringSubmatch(pattern string, s string, n int, useStore bool, key string) [][]string {
                Severity: Minor
                Found in regexp/regexputil/regexputil.go - About 35 mins to fix

                  Function ReadCSVFileSingleColumnValuesString has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func ReadCSVFileSingleColumnValuesString(filename string, sep rune, hasHeader, trimSpace bool, colIdx uint, condenseUniqueSort bool) ([]string, error) {
                  Severity: Minor
                  Found in encoding/csvutil/single_column.go - About 35 mins to fix

                    Function MergeFilterCSVFiles has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func MergeFilterCSVFiles(inPaths []string, outPath string, inComma rune, inStripBom bool, andFilter map[string]stringsutil.MatchInfo) error {
                    Severity: Minor
                    Found in encoding/csvutil/csvutil.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 String.UnmarshalJSON has 5 return statements (exceeds 4 allowed).
                        Open

                        func (s *String) UnmarshalJSON(data []byte) error {
                            var a any
                        
                            if err := json.Unmarshal(data, &a); err != nil {
                                panic(err)
                        Severity: Major
                        Found in encoding/jsonutil/tolerant_reader_types.go - About 35 mins to fix

                          Method MapStringInt.Sorted has 5 return statements (exceeds 4 allowed).
                          Open

                          func (msi MapStringInt) Sorted(sortBy string) []Record {
                              sortBy = strings.ToLower(strings.TrimSpace(sortBy))
                              records := []Record{}
                              for name, count := range msi {
                                  records = append(records, Record{Name: name, Value: count})
                          Severity: Major
                          Found in type/maputil/map_string_int.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 ReadImageHTTP has 5 return statements (exceeds 4 allowed).
                              Open

                              func ReadImageHTTP(imageURL string) (image.Image, string, error) {
                                  imageURL = strings.TrimSpace(imageURL)
                                  if !urlutil.IsHTTP(imageURL, true, true) {
                                      return nil, "", errors.New("url is not valid")
                                  }
                              Severity: Major
                              Found in image/imageutil/read.go - About 35 mins to fix

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

                                func NumQuartersInt32(start, end int32) (int, error) {
                                    start, end = mathutil.MinMaxInt32(start, end)
                                    if !IsQuarterInt32(start) {
                                        return -1, fmt.Errorf("quarterInt32 is not valid [%v] Must end in [1-4]", start)
                                    }
                                Severity: Major
                                Found in time/timeutil/quarter_int.go - About 35 mins to fix

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

                                  func BinFromDuration(d time.Duration) Bin {
                                      // cycle through default bins with non-standard durations.
                                      defBins := BinsDefault()
                                      for i, bin := range defBins { // asc
                                          if d == bin.Duration {
                                  Severity: Major
                                  Found in time/duration/durationbin/bins.go - About 35 mins to fix

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

                                    func CreateFileWithLines(filename string, lines []string, lineSuffix string, useBuffer bool) error {
                                        f, err := os.Create(filename)
                                        if err != nil {
                                            return err
                                        }
                                    Severity: Major
                                    Found in os/osutil/osutil.go - About 35 mins to fix

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

                                      func IsType(mediaType, s string) bool {
                                          mediaType = strings.ToLower(strings.TrimSpace(mediaType))
                                          s = strings.ToLower(strings.TrimSpace(s))
                                          if s == mediaType {
                                              return true
                                      Severity: Major
                                      Found in mime/mimeutil/mediatype.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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language