grokify/mogo

View on GitHub

Showing 87 of 144 total issues

Method SliceFloat64.BuildStats has 6 return statements (exceeds 4 allowed).
Open

func (sf64 *SliceFloat64) BuildStats() (SliceFloat64Stats, error) {
    stats := NewSliceFloat64Stats()
    stats.Len = sf64.Len()
    max, err := sf64.Max()
    if err != nil {
Severity: Major
Found in math/mathutil/slicefloat64.go - About 40 mins to fix

    Function ToBool has 6 return statements (exceeds 4 allowed).
    Open

    func ToBool(v any) bool {
        if v == nil {
            return false
        } else if valBool, ok := v.(bool); ok {
            return valBool
    Severity: Major
    Found in type/interfaceutil/interfaceutil.go - About 40 mins to fix

      Function ValidAlphabets has 6 return statements (exceeds 4 allowed).
      Open

      func ValidAlphabets(a1, a2 string, a2optional bool) error {
          if a1 == "" {
              return errors.New("alphabet 1 cannot be empty")
          } else if !stringsutil.UniqueRunes(a1) {
              return errors.New("alphabet 1 chars are not unique")
      Severity: Major
      Found in encoding/basex/encoding.go - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if !(inclExists && inclNotExists) &&
                    ((!inclExists && exists) || (!inclNotExists && !exists)) {
        Severity: Major
        Found in path/filepathutil/filepathutil.go - About 40 mins to fix

          Function AddFileToArchive has 6 return statements (exceeds 4 allowed).
          Open

          func AddFileToArchive(tw *tar.Writer, filename, archivename string) error {
              // Open the file which will be written into the archive
              file, err := os.Open(filename)
              if err != nil {
                  return err
          Severity: Major
          Found in archive/tarutil/writer.go - About 40 mins to fix

            Function CopyFile has 6 return statements (exceeds 4 allowed).
            Open

            func CopyFile(src, dst string) error {
                r, err := os.Open(src)
                if err != nil {
                    return err
                }
            Severity: Major
            Found in os/osutil/copy.go - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if t.Before(tr.Min) || t.After(tr.Max) ||
                      (!inclusiveMin && t.Equal(tr.Min)) ||
                      (!inclusiveMax && t.Equal(tr.Max)) {
              Severity: Major
              Found in time/timeutil/time_range.go - About 40 mins to fix

                Function AnyStringToQuarterTime has 6 return statements (exceeds 4 allowed).
                Open

                func AnyStringToQuarterTime(yyyyqSrcStr string) time.Time {
                    yyyyqSrcStr = strings.TrimSpace(yyyyqSrcStr)
                    // If not a string, return now time.
                    if len(yyyyqSrcStr) != 5 {
                        return time.Now().UTC()
                Severity: Major
                Found in time/timeutil/quarter_int.go - About 40 mins to fix

                  Function AddFileToZip has 6 return statements (exceeds 4 allowed).
                  Open

                  func AddFileToZip(zipWriter *zip.Writer, filename string, removePaths bool) error {
                      fileToZip, err := os.Open(filename)
                      if err != nil {
                          return err
                      }
                  Severity: Major
                  Found in compress/ziputil/create_achive.go - About 40 mins to fix

                    Function DT6sToString has 6 return statements (exceeds 4 allowed).
                    Open

                    func DT6sToString(startDT6, endDT6 int32, layout, presentText, prefixText, joinText, suffixText string) (string, error) {
                        if startDT6 <= 0 && endDT6 <= 0 {
                            return "", nil
                        }
                        startText, endText, err := DT6sToStrings(startDT6, endDT6, layout, presentText)
                    Severity: Major
                    Found in time/month/strconv.go - About 40 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 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

                          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

                            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 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 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 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 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

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

                                        func JoinInterface(arr []any, sep string, stripRepeatedSep bool, stripEmbeddedSep bool, altSep string) string {
                                        Severity: Minor
                                        Found in type/stringsutil/stringsutil.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language