Showing 130 of 649 total issues
Builder
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (b Builder) Xack() (c Xack) {
c = Xack{cs: get(), ks: b.ks}
c.cs.s = append(c.cs.s, "XACK")
return c
}
FtSearchNostopwords
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type FtSearchNostopwords Incomplete
Method locker.try
has 84 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (m *locker) try(ctx context.Context, cancel context.CancelFunc, name string, g *gate) context.CancelFunc {
var err error
val := random()
deadline := time.Now().Add(m.validity)
FtSearchWithscores
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type FtSearchWithscores Incomplete
Builder
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (b Builder) Blmove() (c Blmove) {
c = Blmove{cs: get(), ks: b.ks, cf: int16(blockTag)}
c.cs.s = append(c.cs.s, "BLMOVE")
return c
}
Method lru.Flights
has 82 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *lru) Flights(now time.Time, multi []CacheableTTL, results []RedisResult, entries map[int]CacheEntry) (missed []int) {
var moves []*list.Element
c.mu.RLock()
for i, ct := range multi {
File gen_cluster.go
has 507 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Code generated DO NOT EDIT
package cmds
import "strconv"
Builder
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (b Builder) Append() (c Append) {
c = Append{cs: get(), ks: b.ks}
c.cs.s = append(c.cs.s, "APPEND")
return c
}
FtSearchWithpayloads
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type FtSearchWithpayloads Incomplete
sentinelClient
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type sentinelClient struct {
mConn atomic.Value
sConn conn
mOpt *ClientOption
sOpt *ClientOption
TsMrevrangeTotimestamp
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type TsMrevrangeTotimestamp Incomplete
TsMrangeTotimestamp
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type TsMrangeTotimestamp Incomplete
Method pipe.DoMultiCache
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p *pipe) DoMultiCache(ctx context.Context, multi ...CacheableTTL) *redisresults {
if p.cache == nil {
commands := make([]Completed, len(multi))
for i, ct := range multi {
commands[i] = Completed(ct.Cmd)
File gen_bitmap.go
has 504 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Code generated DO NOT EDIT
package cmds
import "strconv"
Function ParseURL
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func ParseURL(str string) (opt ClientOption, err error) {
u, err := url.Parse(str)
if err != nil {
return opt, err
}
Method clusterClient._pickMulti
has 73 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *clusterClient) _pickMulti(multi []Completed) (retries *connretry, last uint16, toReplica bool) {
last = cmds.InitSlot
init := false
for _, cmd := range multi {
Method Client.Get
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *Client) Get(ctx context.Context, ttl time.Duration, key string, fn func(ctx context.Context, key string) (val string, err error)) (string, error) {
ctx, cancel := context.WithTimeout(ctx, ttl)
defer cancel()
retry:
wait := c.register(key)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method RedisMessage.AsFtSearch
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (m *RedisMessage) AsFtSearch() (total int64, docs []FtSearchDoc, err error) {
if err = m.Error(); err != nil {
return 0, nil, err
}
if m.IsMap() {
Method sentinelClient.listWatch
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *sentinelClient) listWatch(cc conn) (target string, sentinels []string, err error) {
ctx := context.Background()
sentinelsCMD := c.cmd.SentinelSentinels().Master(c.mOpt.Sentinel.MasterSet).Build()
getMasterCMD := c.cmd.SentinelGetMasterAddrByName().Master(c.mOpt.Sentinel.MasterSet).Build()
replicasCMD := c.cmd.SentinelReplicas().Master(c.mOpt.Sentinel.MasterSet).Build()
Method clusterClient._pickMultiCache
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *clusterClient) _pickMultiCache(multi []CacheableTTL) *connretrycache {
c.mu.RLock()
defer c.mu.RUnlock()
count := conncountp.Get(len(c.conns), len(c.conns))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"