rueian/rueidis

View on GitHub

Showing 505 of 649 total issues

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

func (c ZinterstoreNumkeys) Key(key ...string) ZinterstoreKey {
    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 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 1067..1080
internal/cmds/gen_sorted_set.go on lines 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 EvalshaNumkeys) Key(key ...string) EvalshaKey {
    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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 PfmergeDestkey) Sourcekey(sourcekey ...string) PfmergeSourcekey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range sourcekey {
            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 55..68
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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 SdiffstoreDestination) Key(key ...string) SdiffstoreKey {
    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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 ZintercardNumkeys) Key(key ...string) ZintercardKey {
    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 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 929..942
internal/cmds/gen_sorted_set.go on lines 1067..1080
internal/cmds/gen_sorted_set.go on lines 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 SunionstoreDestination) Key(key ...string) SunionstoreKey {
    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 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_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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 EvalNumkeys) 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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 Ssubscribe) Channel(channel ...string) SsubscribeChannel {
    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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 BlmpopNumkeys) Key(key ...string) BlmpopKey {
    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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 Mget) Key(key ...string) MgetKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_string.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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
internal/cmds/gen_stream.go on lines 1116..1129
internal/cmds/gen_stream.go on lines 1240..1253
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 TfcallNumkeys) Key(key ...string) TfcallKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_triggers_and_functions.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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 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 FcallRoNumkeys) Key(key ...string) FcallRoKey {
    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 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_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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 Sdiff) 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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 ZinterNumkeys) Key(key ...string) ZinterKey {
    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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 XreadgroupStreams) Key(key ...string) XreadgroupKey {
    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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
internal/cmds/gen_stream.go on lines 1116..1129
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 BzmpopNumkeys) Key(key ...string) BzmpopKey {
    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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 ZdiffNumkeys) Key(key ...string) ZdiffKey {
    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 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 ZmpopNumkeys) 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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 BitopDestkey) Key(key ...string) BitopKey {
    if c.ks&NoSlot == NoSlot {
        for _, k := range key {
            c.ks = NoSlot | slot(k)
            break
Severity: Major
Found in internal/cmds/gen_bitmap.go and 45 other locations - About 1 hr to fix
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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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 Touch) Key(key ...string) TouchKey {
    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 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 2379..2392
internal/cmds/gen_sorted_set.go on lines 2529..2542
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

Severity
Category
Status
Source
Language