rueian/rueidis

View on GitHub
internal/cmds/gen_search.go

Summary

Maintainability
F
2 wks
Test Coverage
B
83%

File gen_search.go has 5454 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated DO NOT EDIT

package cmds

import "strconv"
Severity: Major
Found in internal/cmds/gen_search.go - About 2 wks to fix

    FtSearchQuery has 26 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type FtSearchQuery Incomplete
    Severity: Minor
    Found in internal/cmds/gen_search.go - About 3 hrs to fix

      Builder has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

      func (b Builder) FtAggregate() (c FtAggregate) {
          c = FtAggregate{cs: get(), ks: b.ks, cf: int16(readonly)}
          c.cs.s = append(c.cs.s, "FT.AGGREGATE")
          return c
      }
      Severity: Minor
      Found in internal/cmds/gen_search.go - About 2 hrs to fix

        FtSearchNocontent has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type FtSearchNocontent Incomplete
        Severity: Minor
        Found in internal/cmds/gen_search.go - About 2 hrs to fix

          FtSearchVerbatim has 24 methods (exceeds 20 allowed). Consider refactoring.
          Open

          type FtSearchVerbatim Incomplete
          Severity: Minor
          Found in internal/cmds/gen_search.go - About 2 hrs to fix

            FtSearchNostopwords has 23 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type FtSearchNostopwords Incomplete
            Severity: Minor
            Found in internal/cmds/gen_search.go - About 2 hrs to fix

              FtSearchWithscores has 22 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type FtSearchWithscores Incomplete
              Severity: Minor
              Found in internal/cmds/gen_search.go - About 2 hrs to fix

                FtSearchWithpayloads has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type FtSearchWithpayloads Incomplete
                Severity: Minor
                Found in internal/cmds/gen_search.go - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func (c FtCreateFieldAs) Vector(algo string, nargs int64, args ...string) FtCreateFieldFieldTypeVector {
                      c.cs.s = append(c.cs.s, "VECTOR", algo, strconv.FormatInt(nargs, 10))
                      c.cs.s = append(c.cs.s, args...)
                      return (FtCreateFieldFieldTypeVector)(c)
                  }
                  Severity: Minor
                  Found in internal/cmds/gen_search.go and 1 other location - About 45 mins to fix
                  internal/cmds/gen_search.go on lines 1819..1823

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 114.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func (c FtCreateFieldFieldName) Vector(algo string, nargs int64, args ...string) FtCreateFieldFieldTypeVector {
                      c.cs.s = append(c.cs.s, "VECTOR", algo, strconv.FormatInt(nargs, 10))
                      c.cs.s = append(c.cs.s, args...)
                      return (FtCreateFieldFieldTypeVector)(c)
                  }
                  Severity: Minor
                  Found in internal/cmds/gen_search.go and 1 other location - About 45 mins to fix
                  internal/cmds/gen_search.go on lines 1786..1790

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 114.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status