rueian/rueidis

View on GitHub

Showing 130 of 651 total issues

Avoid deeply nested control flow statements.
Open

                    if _, ok := err.(*RedisError); ok {
                        err = ErrDoCacheAborted
                    }
Severity: Major
Found in pipe.go - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if !m.noloop {
                                <-csc
                            }
    Severity: Major
    Found in rueidislock/lock.go - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          for i := 0; i < len(multi) && !blocked; i++ {
                              blocked = blocked || multi[i].IsBlock()
                          }
      Severity: Major
      Found in pipe.go - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if i != j {
                                msg.values[i] = v
                            }
        Severity: Major
        Found in pipe.go - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if r[k.string], err = strconv.ParseInt(v.string, 0, 64); err != nil {
                                  return nil, err
                              }
          Severity: Major
          Found in message.go - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    switch record.values[j].string {
                                    case "id":
                                        docs[d].Key = record.values[j+1].string
                                    case "extra_attributes":
                                        docs[d].Doc, _ = record.values[j+1].AsStrMap()
            Severity: Major
            Found in message.go - About 45 mins to fix

              Function NewClient has 7 return statements (exceeds 4 allowed).
              Open

              func NewClient(clientOption rueidis.ClientOption, opts ...Option) (rueidis.Client, error) {
                  oclient, err := newClient(opts...)
                  if err != nil {
                      return nil, err
                  }
              Severity: Major
              Found in rueidisotel/metrics.go - About 45 mins to fix

                Method RedisMessage.AsXRangeEntry has 6 return statements (exceeds 4 allowed).
                Open

                func (m *RedisMessage) AsXRangeEntry() (XRangeEntry, error) {
                    values, err := m.ToArray()
                    if err != nil {
                        return XRangeEntry{}, err
                    }
                Severity: Major
                Found in message.go - About 40 mins to fix

                  Method pipe.handlePush has 6 return statements (exceeds 4 allowed).
                  Open

                  func (p *pipe) handlePush(values []RedisMessage) (reply bool, unsubscribe bool) {
                      if len(values) < 2 {
                          return
                      }
                      // TODO: handle other push data
                  Severity: Major
                  Found in pipe.go - About 40 mins to fix

                    Method RedisMessage.AsXRead has 6 return statements (exceeds 4 allowed).
                    Open

                    func (m *RedisMessage) AsXRead() (ret map[string][]XRangeEntry, err error) {
                        if err = m.Error(); err != nil {
                            return nil, err
                        }
                        if m.IsMap() {
                    Severity: Major
                    Found in message.go - About 40 mins to fix

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

                      func readBlobString(i *bufio.Reader) (m RedisMessage, err error) {
                          m.string, err = readB(i)
                          if err == errChunked {
                              sb := strings.Builder{}
                              for {
                      Severity: Major
                      Found in resp.go - About 40 mins to fix

                        Method sentinelClient._switchTarget has 6 return statements (exceeds 4 allowed).
                        Open

                        func (c *sentinelClient) _switchTarget(addr string) (err error) {
                            var target conn
                            if atomic.LoadUint32(&c.stop) == 1 {
                                return nil
                            }
                        Severity: Major
                        Found in sentinel.go - About 40 mins to fix

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

                          func NewBloomFilter(
                              client rueidis.Client,
                              name string,
                              expectedNumberOfItems uint,
                              falsePositiveRate float64,
                          Severity: Major
                          Found in rueidisprob/bloomfilter.go - About 40 mins to fix

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

                            func NewClient(option ClientOption) (client Client, err error) {
                                if option.ReadBufferEachConn < 32 { // the buffer should be able to hold an int64 string at least
                                    option.ReadBufferEachConn = DefaultReadBuffer
                                }
                                if option.WriteBufferEachConn < 32 {
                            Severity: Major
                            Found in rueidis.go - About 40 mins to fix

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

                              func newMux(dst string, option *ClientOption, init, dead wire, wireFn wireFn, wireNoBgFn wireFn) *mux {
                              Severity: Minor
                              Found in mux.go - About 35 mins to fix

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

                                func startSpan(tracer trace.Tracer, ctx context.Context, op string, size int, attrs trace.SpanStartEventOption) (context.Context, trace.Span) {
                                Severity: Minor
                                Found in rueidisotel/trace.go - About 35 mins to fix

                                  Method bloomFilter.ExistsMulti has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (c *bloomFilter) ExistsMulti(ctx context.Context, keys []string) ([]bool, error) {
                                      if len(keys) == 0 {
                                          return nil, nil
                                      }
                                  
                                  
                                  Severity: Major
                                  Found in rueidisprob/bloomfilter.go - About 35 mins to fix

                                    Method locker.waitgate has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (m *locker) waitgate(ctx context.Context, name string) (g *gate, err error) {
                                        m.mu.Lock()
                                        g, ok := m.gates[name]
                                        if !ok {
                                            if m.gates == nil {
                                    Severity: Major
                                    Found in rueidislock/lock.go - About 35 mins to fix

                                      Method RedisMessage.AsZScores has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (m *RedisMessage) AsZScores() ([]ZScore, error) {
                                          arr, err := m.ToArray()
                                          if err != nil {
                                              return nil, err
                                          }
                                      Severity: Major
                                      Found in message.go - About 35 mins to fix

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

                                        func readI(i *bufio.Reader) (v int64, err error) {
                                            bs, err := i.ReadSlice('\n')
                                            if err != nil {
                                                return 0, err
                                            }
                                        Severity: Major
                                        Found in resp.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language