rueian/rueidis

View on GitHub

Showing 637 of 651 total issues

Method pipe.handlePush has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
Open

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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method clusterClient.doMulti has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
Open

func (c *clusterClient) doMulti(ctx context.Context, slot uint16, multi []Completed, toReplica bool) []RedisResult {
retry:
    cc, err := c.pick(ctx, slot, toReplica)
    if err != nil {
        return fillErrs(len(multi), err)
Severity: Minor
Found in cluster.go - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

func (f *countingBloomFilter) indexes(keys []string) []string {
    allIndexes := make([]string, 0, len(keys)*int(f.hashIterations))
    size := uint64(f.size)
    for _, key := range keys {
        h1, h2 := hash([]byte(key))
Severity: Major
Found in rueidisprob/countingbloomfilter.go and 1 other location - About 1 hr to fix
rueidisprob/bloomfilter.go on lines 235..245

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

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

    if dlOk {
        if p.timeout > 0 {
            defaultDeadline := time.Now().Add(p.timeout)
            if dl.After(defaultDeadline) {
                dl = defaultDeadline
Severity: Major
Found in pipe.go and 1 other location - About 1 hr to fix
pipe.go on lines 1064..1076

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

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

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

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

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

Refactorings

Further Reading

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

func (c *bloomFilter) indexes(keys []string) []string {
    allIndexes := make([]string, 0, len(keys)*int(c.hashIterations))
    size := uint64(c.size)
    for _, key := range keys {
        h1, h2 := hash([]byte(key))
Severity: Major
Found in rueidisprob/bloomfilter.go and 1 other location - About 1 hr to fix
rueidisprob/countingbloomfilter.go on lines 245..255

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

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

        if ok {
            if p.timeout > 0 {
                defaultDeadline := time.Now().Add(p.timeout)
                if dl.After(defaultDeadline) {
                    dl = defaultDeadline
Severity: Major
Found in pipe.go and 1 other location - About 1 hr to fix
pipe.go on lines 1152..1164

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

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

Method pipe.handlePush has 62 lines of code (exceeds 50 allowed). Consider refactoring.
Open

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

    Function streamTo has 60 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func streamTo(i *bufio.Reader, w io.Writer) (n int64, err error, clean bool) {
    next:
        var typ byte
        if typ, err = i.ReadByte(); err != nil {
            return 0, err, false
    Severity: Minor
    Found in resp.go - About 1 hr to fix

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

      func (m *RedisMessage) AsLMPop() (kvs KeyValues, err error) {
          if err = m.Error(); err != nil {
              return KeyValues{}, err
          }
          if len(m.values) >= 2 {
      Severity: Major
      Found in message.go and 1 other location - About 1 hr to fix
      message.go on lines 1013..1024

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

      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 (m *RedisMessage) AsZMPop() (kvs KeyZScores, err error) {
          if err = m.Error(); err != nil {
              return KeyZScores{}, err
          }
          if len(m.values) >= 2 {
      Severity: Major
      Found in message.go and 1 other location - About 1 hr to fix
      message.go on lines 995..1006

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

      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 Sinter) Key(key ...string) SinterKey {
          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 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 Sunion) Key(key ...string) SunionKey {
          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 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 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 EvalRoNumkeys) 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 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 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 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 SintercardNumkeys) Key(key ...string) SintercardKey {
          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 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 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 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

      Severity
      Category
      Status
      Source
      Language