rueian/rueidis

View on GitHub

Showing 522 of 673 total issues

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

func (c Brpop) Key(key ...string) BrpopKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_list.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 378..391
internal/cmds/gen_cms.go on lines 186..199
internal/cmds/gen_generic.go on lines 81..94
internal/cmds/gen_generic.go on lines 151..164
internal/cmds/gen_generic.go on lines 1755..1768
internal/cmds/gen_generic.go on lines 1860..1873
internal/cmds/gen_hyperloglog.go on lines 55..68
internal/cmds/gen_hyperloglog.go on lines 112..125
internal/cmds/gen_json.go on lines 668..681
internal/cmds/gen_list.go on lines 143..156
internal/cmds/gen_list.go on lines 197..210
internal/cmds/gen_list.go on lines 591..604
internal/cmds/gen_pubsub.go on lines 263..276
internal/cmds/gen_pubsub.go on lines 333..346
internal/cmds/gen_scripting.go on lines 61..74
internal/cmds/gen_scripting.go on lines 150..163
internal/cmds/gen_scripting.go on lines 248..261
internal/cmds/gen_scripting.go on lines 337..350
internal/cmds/gen_scripting.go on lines 442..455
internal/cmds/gen_scripting.go on lines 538..551
internal/cmds/gen_set.go on lines 82..95
internal/cmds/gen_set.go on lines 139..152
internal/cmds/gen_set.go on lines 184..197
internal/cmds/gen_set.go on lines 270..283
internal/cmds/gen_set.go on lines 305..318
internal/cmds/gen_set.go on lines 675..688
internal/cmds/gen_set.go on lines 732..745
internal/cmds/gen_sorted_set.go on lines 56..69
internal/cmds/gen_sorted_set.go on lines 110..123
internal/cmds/gen_sorted_set.go on lines 162..175
internal/cmds/gen_sorted_set.go on lines 489..502
internal/cmds/gen_sorted_set.go on lines 560..573
internal/cmds/gen_sorted_set.go on lines 715..728
internal/cmds/gen_sorted_set.go on lines 821..834
internal/cmds/gen_sorted_set.go on lines 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2401..2414
internal/cmds/gen_sorted_set.go on lines 2551..2564
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
internal/cmds/gen_string.go on lines 575..588
internal/cmds/gen_tdigest.go on lines 293..306
internal/cmds/gen_transactions.go on lines 65..78
internal/cmds/gen_triggers_and_functions.go on lines 68..81
internal/cmds/gen_triggers_and_functions.go on lines 154..167

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

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 46 locations. Consider refactoring.
Open

func (c TdigestMergeNumkeys) SourceKey(sourceKey ...string) TdigestMergeSourceKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range sourceKey {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_tdigest.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 378..391
internal/cmds/gen_cms.go on lines 186..199
internal/cmds/gen_generic.go on lines 81..94
internal/cmds/gen_generic.go on lines 151..164
internal/cmds/gen_generic.go on lines 1755..1768
internal/cmds/gen_generic.go on lines 1860..1873
internal/cmds/gen_hyperloglog.go on lines 55..68
internal/cmds/gen_hyperloglog.go on lines 112..125
internal/cmds/gen_json.go on lines 668..681
internal/cmds/gen_list.go on lines 143..156
internal/cmds/gen_list.go on lines 197..210
internal/cmds/gen_list.go on lines 249..262
internal/cmds/gen_list.go on lines 591..604
internal/cmds/gen_pubsub.go on lines 263..276
internal/cmds/gen_pubsub.go on lines 333..346
internal/cmds/gen_scripting.go on lines 61..74
internal/cmds/gen_scripting.go on lines 150..163
internal/cmds/gen_scripting.go on lines 248..261
internal/cmds/gen_scripting.go on lines 337..350
internal/cmds/gen_scripting.go on lines 442..455
internal/cmds/gen_scripting.go on lines 538..551
internal/cmds/gen_set.go on lines 82..95
internal/cmds/gen_set.go on lines 139..152
internal/cmds/gen_set.go on lines 184..197
internal/cmds/gen_set.go on lines 270..283
internal/cmds/gen_set.go on lines 305..318
internal/cmds/gen_set.go on lines 675..688
internal/cmds/gen_set.go on lines 732..745
internal/cmds/gen_sorted_set.go on lines 56..69
internal/cmds/gen_sorted_set.go on lines 110..123
internal/cmds/gen_sorted_set.go on lines 162..175
internal/cmds/gen_sorted_set.go on lines 489..502
internal/cmds/gen_sorted_set.go on lines 560..573
internal/cmds/gen_sorted_set.go on lines 715..728
internal/cmds/gen_sorted_set.go on lines 821..834
internal/cmds/gen_sorted_set.go on lines 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2401..2414
internal/cmds/gen_sorted_set.go on lines 2551..2564
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
internal/cmds/gen_string.go on lines 575..588
internal/cmds/gen_transactions.go on lines 65..78
internal/cmds/gen_triggers_and_functions.go on lines 68..81
internal/cmds/gen_triggers_and_functions.go on lines 154..167

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

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 46 locations. Consider refactoring.
Open

func (c Watch) Key(key ...string) WatchKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_transactions.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 378..391
internal/cmds/gen_cms.go on lines 186..199
internal/cmds/gen_generic.go on lines 81..94
internal/cmds/gen_generic.go on lines 151..164
internal/cmds/gen_generic.go on lines 1755..1768
internal/cmds/gen_generic.go on lines 1860..1873
internal/cmds/gen_hyperloglog.go on lines 55..68
internal/cmds/gen_hyperloglog.go on lines 112..125
internal/cmds/gen_json.go on lines 668..681
internal/cmds/gen_list.go on lines 143..156
internal/cmds/gen_list.go on lines 197..210
internal/cmds/gen_list.go on lines 249..262
internal/cmds/gen_list.go on lines 591..604
internal/cmds/gen_pubsub.go on lines 263..276
internal/cmds/gen_pubsub.go on lines 333..346
internal/cmds/gen_scripting.go on lines 61..74
internal/cmds/gen_scripting.go on lines 150..163
internal/cmds/gen_scripting.go on lines 248..261
internal/cmds/gen_scripting.go on lines 337..350
internal/cmds/gen_scripting.go on lines 442..455
internal/cmds/gen_scripting.go on lines 538..551
internal/cmds/gen_set.go on lines 82..95
internal/cmds/gen_set.go on lines 139..152
internal/cmds/gen_set.go on lines 184..197
internal/cmds/gen_set.go on lines 270..283
internal/cmds/gen_set.go on lines 305..318
internal/cmds/gen_set.go on lines 675..688
internal/cmds/gen_set.go on lines 732..745
internal/cmds/gen_sorted_set.go on lines 56..69
internal/cmds/gen_sorted_set.go on lines 110..123
internal/cmds/gen_sorted_set.go on lines 162..175
internal/cmds/gen_sorted_set.go on lines 489..502
internal/cmds/gen_sorted_set.go on lines 560..573
internal/cmds/gen_sorted_set.go on lines 715..728
internal/cmds/gen_sorted_set.go on lines 821..834
internal/cmds/gen_sorted_set.go on lines 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2401..2414
internal/cmds/gen_sorted_set.go on lines 2551..2564
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
internal/cmds/gen_string.go on lines 575..588
internal/cmds/gen_tdigest.go on lines 293..306
internal/cmds/gen_triggers_and_functions.go on lines 68..81
internal/cmds/gen_triggers_and_functions.go on lines 154..167

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

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 46 locations. Consider refactoring.
Open

func (c Sunsubscribe) Channel(channel ...string) SunsubscribeChannel {
    if c.ks&NoSlot == NoSlot {
        for _, k := range channel {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_pubsub.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 378..391
internal/cmds/gen_cms.go on lines 186..199
internal/cmds/gen_generic.go on lines 81..94
internal/cmds/gen_generic.go on lines 151..164
internal/cmds/gen_generic.go on lines 1755..1768
internal/cmds/gen_generic.go on lines 1860..1873
internal/cmds/gen_hyperloglog.go on lines 55..68
internal/cmds/gen_hyperloglog.go on lines 112..125
internal/cmds/gen_json.go on lines 668..681
internal/cmds/gen_list.go on lines 143..156
internal/cmds/gen_list.go on lines 197..210
internal/cmds/gen_list.go on lines 249..262
internal/cmds/gen_list.go on lines 591..604
internal/cmds/gen_pubsub.go on lines 263..276
internal/cmds/gen_scripting.go on lines 61..74
internal/cmds/gen_scripting.go on lines 150..163
internal/cmds/gen_scripting.go on lines 248..261
internal/cmds/gen_scripting.go on lines 337..350
internal/cmds/gen_scripting.go on lines 442..455
internal/cmds/gen_scripting.go on lines 538..551
internal/cmds/gen_set.go on lines 82..95
internal/cmds/gen_set.go on lines 139..152
internal/cmds/gen_set.go on lines 184..197
internal/cmds/gen_set.go on lines 270..283
internal/cmds/gen_set.go on lines 305..318
internal/cmds/gen_set.go on lines 675..688
internal/cmds/gen_set.go on lines 732..745
internal/cmds/gen_sorted_set.go on lines 56..69
internal/cmds/gen_sorted_set.go on lines 110..123
internal/cmds/gen_sorted_set.go on lines 162..175
internal/cmds/gen_sorted_set.go on lines 489..502
internal/cmds/gen_sorted_set.go on lines 560..573
internal/cmds/gen_sorted_set.go on lines 715..728
internal/cmds/gen_sorted_set.go on lines 821..834
internal/cmds/gen_sorted_set.go on lines 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2401..2414
internal/cmds/gen_sorted_set.go on lines 2551..2564
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
internal/cmds/gen_string.go on lines 575..588
internal/cmds/gen_tdigest.go on lines 293..306
internal/cmds/gen_transactions.go on lines 65..78
internal/cmds/gen_triggers_and_functions.go on lines 68..81
internal/cmds/gen_triggers_and_functions.go on lines 154..167

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

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 46 locations. Consider refactoring.
Open

func (c Unlink) Key(key ...string) UnlinkKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_generic.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 378..391
internal/cmds/gen_cms.go on lines 186..199
internal/cmds/gen_generic.go on lines 81..94
internal/cmds/gen_generic.go on lines 151..164
internal/cmds/gen_generic.go on lines 1755..1768
internal/cmds/gen_hyperloglog.go on lines 55..68
internal/cmds/gen_hyperloglog.go on lines 112..125
internal/cmds/gen_json.go on lines 668..681
internal/cmds/gen_list.go on lines 143..156
internal/cmds/gen_list.go on lines 197..210
internal/cmds/gen_list.go on lines 249..262
internal/cmds/gen_list.go on lines 591..604
internal/cmds/gen_pubsub.go on lines 263..276
internal/cmds/gen_pubsub.go on lines 333..346
internal/cmds/gen_scripting.go on lines 61..74
internal/cmds/gen_scripting.go on lines 150..163
internal/cmds/gen_scripting.go on lines 248..261
internal/cmds/gen_scripting.go on lines 337..350
internal/cmds/gen_scripting.go on lines 442..455
internal/cmds/gen_scripting.go on lines 538..551
internal/cmds/gen_set.go on lines 82..95
internal/cmds/gen_set.go on lines 139..152
internal/cmds/gen_set.go on lines 184..197
internal/cmds/gen_set.go on lines 270..283
internal/cmds/gen_set.go on lines 305..318
internal/cmds/gen_set.go on lines 675..688
internal/cmds/gen_set.go on lines 732..745
internal/cmds/gen_sorted_set.go on lines 56..69
internal/cmds/gen_sorted_set.go on lines 110..123
internal/cmds/gen_sorted_set.go on lines 162..175
internal/cmds/gen_sorted_set.go on lines 489..502
internal/cmds/gen_sorted_set.go on lines 560..573
internal/cmds/gen_sorted_set.go on lines 715..728
internal/cmds/gen_sorted_set.go on lines 821..834
internal/cmds/gen_sorted_set.go on lines 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2401..2414
internal/cmds/gen_sorted_set.go on lines 2551..2564
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
internal/cmds/gen_string.go on lines 575..588
internal/cmds/gen_tdigest.go on lines 293..306
internal/cmds/gen_transactions.go on lines 65..78
internal/cmds/gen_triggers_and_functions.go on lines 68..81
internal/cmds/gen_triggers_and_functions.go on lines 154..167

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

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 46 locations. Consider refactoring.
Open

func (c Pfcount) Key(key ...string) PfcountKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_hyperloglog.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 378..391
internal/cmds/gen_cms.go on lines 186..199
internal/cmds/gen_generic.go on lines 81..94
internal/cmds/gen_generic.go on lines 151..164
internal/cmds/gen_generic.go on lines 1755..1768
internal/cmds/gen_generic.go on lines 1860..1873
internal/cmds/gen_hyperloglog.go on lines 112..125
internal/cmds/gen_json.go on lines 668..681
internal/cmds/gen_list.go on lines 143..156
internal/cmds/gen_list.go on lines 197..210
internal/cmds/gen_list.go on lines 249..262
internal/cmds/gen_list.go on lines 591..604
internal/cmds/gen_pubsub.go on lines 263..276
internal/cmds/gen_pubsub.go on lines 333..346
internal/cmds/gen_scripting.go on lines 61..74
internal/cmds/gen_scripting.go on lines 150..163
internal/cmds/gen_scripting.go on lines 248..261
internal/cmds/gen_scripting.go on lines 337..350
internal/cmds/gen_scripting.go on lines 442..455
internal/cmds/gen_scripting.go on lines 538..551
internal/cmds/gen_set.go on lines 82..95
internal/cmds/gen_set.go on lines 139..152
internal/cmds/gen_set.go on lines 184..197
internal/cmds/gen_set.go on lines 270..283
internal/cmds/gen_set.go on lines 305..318
internal/cmds/gen_set.go on lines 675..688
internal/cmds/gen_set.go on lines 732..745
internal/cmds/gen_sorted_set.go on lines 56..69
internal/cmds/gen_sorted_set.go on lines 110..123
internal/cmds/gen_sorted_set.go on lines 162..175
internal/cmds/gen_sorted_set.go on lines 489..502
internal/cmds/gen_sorted_set.go on lines 560..573
internal/cmds/gen_sorted_set.go on lines 715..728
internal/cmds/gen_sorted_set.go on lines 821..834
internal/cmds/gen_sorted_set.go on lines 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2401..2414
internal/cmds/gen_sorted_set.go on lines 2551..2564
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
internal/cmds/gen_string.go on lines 575..588
internal/cmds/gen_tdigest.go on lines 293..306
internal/cmds/gen_transactions.go on lines 65..78
internal/cmds/gen_triggers_and_functions.go on lines 68..81
internal/cmds/gen_triggers_and_functions.go on lines 154..167

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

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 3 locations. Consider refactoring.
Open

func (m *DedicatedClient) DoMulti(arg0 context.Context, arg1 ...rueidis.Completed) []rueidis.RedisResult {
    m.ctrl.T.Helper()
    varargs := []any{arg0}
    for _, a := range arg1 {
        varargs = append(varargs, a)
Severity: Major
Found in mock/client.go and 2 other locations - About 1 hr to fix
mock/client.go on lines 147..156
mock/client.go on lines 185..194

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

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 3 locations. Consider refactoring.
Open

func (m *Client) DoMulti(arg0 context.Context, arg1 ...rueidis.Completed) []rueidis.RedisResult {
    m.ctrl.T.Helper()
    varargs := []any{arg0}
    for _, a := range arg1 {
        varargs = append(varargs, a)
Severity: Major
Found in mock/client.go and 2 other locations - About 1 hr to fix
mock/client.go on lines 185..194
mock/client.go on lines 290..299

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

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 3 locations. Consider refactoring.
Open

func (m *Client) DoMultiCache(arg0 context.Context, arg1 ...rueidis.CacheableTTL) []rueidis.RedisResult {
    m.ctrl.T.Helper()
    varargs := []any{arg0}
    for _, a := range arg1 {
        varargs = append(varargs, a)
Severity: Major
Found in mock/client.go and 2 other locations - About 1 hr to fix
mock/client.go on lines 147..156
mock/client.go on lines 290..299

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

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 ToVector64(s string) []float64 {
    bs := unsafe.Slice(unsafe.StringData(s), len(s))
    vs := make([]float64, 0, len(bs)/8)
    for i := 0; i < len(bs); i += 8 {
        vs = append(vs, math.Float64frombits(binary.LittleEndian.Uint64(bs[i:i+8])))
Severity: Major
Found in binary.go and 1 other location - About 1 hr to fix
binary.go on lines 36..43

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

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 ToVector32(s string) []float32 {
    bs := unsafe.Slice(unsafe.StringData(s), len(s))
    vs := make([]float32, 0, len(bs)/4)
    for i := 0; i < len(bs); i += 4 {
        vs = append(vs, math.Float32frombits(binary.LittleEndian.Uint32(bs[i:i+4])))
Severity: Major
Found in binary.go and 1 other location - About 1 hr to fix
binary.go on lines 60..67

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

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 46 locations. Consider refactoring.
Open

func (c EvalKey) Key(key ...string) EvalKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_scripting.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c EvalRoKey) Key(key ...string) EvalRoKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_scripting.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c LmpopKey) Key(key ...string) LmpopKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_list.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c PfcountKey) Key(key ...string) PfcountKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_hyperloglog.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c SdiffKey) Key(key ...string) SdiffKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_set.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c UnlinkKey) Key(key ...string) UnlinkKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_generic.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c XreadKey) Key(key ...string) XreadKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_stream.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c ZmpopKey) Key(key ...string) ZmpopKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_sorted_set.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_sorted_set.go on lines 2506..2519
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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 46 locations. Consider refactoring.
Open

func (c ZunionstoreKey) Key(key ...string) ZunionstoreKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_sorted_set.go and 45 other locations - About 1 hr to fix
internal/cmds/gen_bitmap.go on lines 395..408
internal/cmds/gen_cms.go on lines 203..216
internal/cmds/gen_generic.go on lines 98..111
internal/cmds/gen_generic.go on lines 168..181
internal/cmds/gen_generic.go on lines 1772..1785
internal/cmds/gen_generic.go on lines 1877..1890
internal/cmds/gen_hyperloglog.go on lines 72..85
internal/cmds/gen_hyperloglog.go on lines 134..147
internal/cmds/gen_json.go on lines 685..698
internal/cmds/gen_list.go on lines 116..129
internal/cmds/gen_list.go on lines 214..227
internal/cmds/gen_list.go on lines 266..279
internal/cmds/gen_list.go on lines 564..577
internal/cmds/gen_pubsub.go on lines 280..293
internal/cmds/gen_pubsub.go on lines 355..368
internal/cmds/gen_scripting.go on lines 34..47
internal/cmds/gen_scripting.go on lines 118..131
internal/cmds/gen_scripting.go on lines 221..234
internal/cmds/gen_scripting.go on lines 305..318
internal/cmds/gen_scripting.go on lines 415..428
internal/cmds/gen_scripting.go on lines 506..519
internal/cmds/gen_set.go on lines 99..112
internal/cmds/gen_set.go on lines 156..169
internal/cmds/gen_set.go on lines 201..214
internal/cmds/gen_set.go on lines 236..249
internal/cmds/gen_set.go on lines 322..335
internal/cmds/gen_set.go on lines 692..705
internal/cmds/gen_set.go on lines 749..762
internal/cmds/gen_sorted_set.go on lines 29..42
internal/cmds/gen_sorted_set.go on lines 127..140
internal/cmds/gen_sorted_set.go on lines 179..192
internal/cmds/gen_sorted_set.go on lines 462..475
internal/cmds/gen_sorted_set.go on lines 538..551
internal/cmds/gen_sorted_set.go on lines 665..678
internal/cmds/gen_sorted_set.go on lines 787..800
internal/cmds/gen_sorted_set.go on lines 884..897
internal/cmds/gen_sorted_set.go on lines 1040..1053
internal/cmds/gen_sorted_set.go on lines 2351..2364
internal/cmds/gen_stream.go on lines 1094..1107
internal/cmds/gen_stream.go on lines 1211..1224
internal/cmds/gen_string.go on lines 592..605
internal/cmds/gen_tdigest.go on lines 317..330
internal/cmds/gen_transactions.go on lines 82..95
internal/cmds/gen_triggers_and_functions.go on lines 34..47
internal/cmds/gen_triggers_and_functions.go on lines 120..133

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

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

Severity
Category
Status
Source
Language