hdachev/fakeredis

View on GitHub
lib/backend.js

Summary

Maintainability
F
2 wks
Test Coverage

File backend.js has 1440 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";


// Error replies.

Severity: Major
Found in lib/backend.js - About 3 days to fix

    Function Backend has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.Backend = function () {
      var state
        , dbs = {}
        , delrev = {}
        , rev = 0
    Severity: Minor
    Found in lib/backend.js - About 2 days 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

    prototype has 134 functions (exceeds 20 allowed). Consider refactoring.
    Open

    exports.Backend.prototype = {
    
    
      // Keys.
    
    
    Severity: Major
    Found in lib/backend.js - About 2 days to fix

      Function Backend has 190 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.Backend = function () {
        var state
          , dbs = {}
          , delrev = {}
          , rev = 0
      Severity: Major
      Found in lib/backend.js - About 7 hrs to fix

        Function zOpStore has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
        Open

        , zOpStore: function (union, key, keys, weights, aggregate) {
            var K = this.getSetOrZsetKey(keys[0]);
            if (K instanceof ERROR) return K;
        
            var out = {}, member, x = 0, weight = (weights === null ? 1 : weights[0]);
        Severity: Minor
        Found in lib/backend.js - About 5 hrs 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

        Function SORT has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

        , SORT: function () {
            var self = this, args = arr(arguments), n = args.length;
            if (!n) return new BAD_ARGS;
        
            // Parse.
        Severity: Minor
        Found in lib/backend.js - About 4 hrs 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

        Function SORT has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        , SORT: function () {
            var self = this, args = arr(arguments), n = args.length;
            if (!n) return new BAD_ARGS;
        
            // Parse.
        Severity: Major
        Found in lib/backend.js - About 3 hrs to fix

          Function SET has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          , SET: function () {
              if (arguments.length < 2) return BAD_ARGS;
              var argc = 0;
              var key = arguments[argc++];
              var value = arguments[argc++];
          Severity: Minor
          Found in lib/backend.js - About 3 hrs 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

          Function slice has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          var slice = function (arr, start, stop, asCount) {
            start = str2int(start);
            stop = str2int(stop);
            if (start instanceof ERROR) return start;
            if (stop instanceof ERROR) return stop;
          Severity: Minor
          Found in lib/backend.js - About 3 hrs 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

          Function LREM has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          , LREM: function (key, count, value) {
              var K = this.getKey(LIST, key);
              if (K instanceof ERROR) return K;
              count = str2int(count);
              if (count instanceof ERROR) return count;
          Severity: Minor
          Found in lib/backend.js - About 2 hrs 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

          Function _scan has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          , _scan: function (allKeys, size, cursor, opt1, opt1val, opt2, opt2val) {
              cursor = str2int(cursor);
              if (cursor instanceof ERROR)
                return cursor;
          
          
          Severity: Minor
          Found in lib/backend.js - About 2 hrs 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

          Function zParseOpStore has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          , zParseOpStore: function (union, args) {
              var key = args[0], N = str2int(args[1]);
              if (N instanceof ERROR) return N;
              if (N < 1) return BAD_ZUIS;
              if (args.length < N + 2) return BAD_ARGS;
          Severity: Minor
          Found in lib/backend.js - About 2 hrs 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

          Function SET has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          , SET: function () {
              if (arguments.length < 2) return BAD_ARGS;
              var argc = 0;
              var key = arguments[argc++];
              var value = arguments[argc++];
          Severity: Major
          Found in lib/backend.js - About 2 hrs to fix

            Function SUNION has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            , SUNION: function () {
                var i, n = arguments.length, out = [];
                if (!n) return BAD_ARGS;
            
                for (i = 0; i < n; i++) {
            Severity: Minor
            Found in lib/backend.js - 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

            Function _scan has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            , _scan: function (allKeys, size, cursor, opt1, opt1val, opt2, opt2val) {
                cursor = str2int(cursor);
                if (cursor instanceof ERROR)
                  return cursor;
            
            
            Severity: Minor
            Found in lib/backend.js - About 1 hr to fix

              Function sCombine has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              , sCombine: function (diff, args) {
                  var i, n = args.length;
                  if (!n)
                    return BAD_ARGS;
              
              
              Severity: Minor
              Found in lib/backend.js - 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

              Function structPut has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              , structPut: function (type, validate, revArgs, args) {
                  var key = args[0], i, n = args.length, x = 0;
              
                  if (n < 3 || ((n - 1) % 2)) return BAD_ARGS;
                  var K = this.getKey(type, key, true);
              Severity: Minor
              Found in lib/backend.js - 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

              Function zOpStore has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              , zOpStore: function (union, key, keys, weights, aggregate) {
                  var K = this.getSetOrZsetKey(keys[0]);
                  if (K instanceof ERROR) return K;
              
                  var out = {}, member, x = 0, weight = (weights === null ? 1 : weights[0]);
              Severity: Minor
              Found in lib/backend.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                      if ((p && sub.pattern !== null && (channel === null || sub.pattern === channel)) || (!p && sub.pattern === null && (channel === null || sub.channel === channel))) {
                        x--;
                        subs.splice(i, 1);
                        process.nextTick(client.pushMessage.bind(client, p ? 'punsubscribe' : 'unsubscribe', p ? sub.pattern : sub.channel, x));
                        i--; n--;
                Severity: Critical
                Found in lib/backend.js - About 1 hr to fix

                  Function lPopMany has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  , lPopMany: function (left, keys) {
                      var K = [], value, i, n = keys.length;
                      if (!n) return BAD_ARGS;
                      for (i = 0; i < n; i++) {
                        K[i] = this.getKey(LIST, keys[i]);
                  Severity: Minor
                  Found in lib/backend.js - 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

                  Function slice has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var slice = function (arr, start, stop, asCount) {
                    start = str2int(start);
                    stop = str2int(stop);
                    if (start instanceof ERROR) return start;
                    if (stop instanceof ERROR) return stop;
                  Severity: Minor
                  Found in lib/backend.js - About 1 hr to fix

                    Function zGetRangeByScore has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    , zGetRangeByScore: function (rev, args) {
                        var key = args[0], min = args[rev ? 2 : 1], max = args[rev ? 1 : 2]
                          , scores, limit, offset, count;
                    
                        if (args.length < 3)
                    Severity: Minor
                    Found in lib/backend.js - About 55 mins 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

                    Function structDel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    , structDel: function (type, args) {
                        var key = args[0]
                          , i, n = args.length
                          , x;
                    
                    
                    Severity: Minor
                    Found in lib/backend.js - About 55 mins 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

                    Function _scan has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    , _scan: function (allKeys, size, cursor, opt1, opt1val, opt2, opt2val) {
                    Severity: Major
                    Found in lib/backend.js - About 50 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                              else for (member in out) if (!(member in K.value)) {
                                delete out[member];
                                x--;
                              }
                      Severity: Major
                      Found in lib/backend.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (!(member in out)) {
                                    x++;
                                    out[member] = K.value[member]* weight;
                                  }
                        
                        
                        Severity: Major
                        Found in lib/backend.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ((diff && (K && K.value[out[j]])) || (!diff && !(K && K.value[out[j]]))) {
                                    out.splice(j, 1);
                                    j--;
                                    m--;
                                  }
                          Severity: Major
                          Found in lib/backend.js - About 40 mins to fix

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

                            , zOpStore: function (union, key, keys, weights, aggregate) {
                            Severity: Minor
                            Found in lib/backend.js - About 35 mins to fix

                              Function zSort has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              , zSort: function (rev, key, min, max) {
                                  var K = this.getKey(ZSET, key);
                                  if (K instanceof ERROR) return K;
                                  if (!K) return [];
                              
                              
                              Severity: Minor
                              Found in lib/backend.js - About 35 mins 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

                              Function SETBIT has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              , SETBIT: function (key, offset, state) {
                                  /*jshint -W018*/
                                  offset = str2int(offset);
                                  if (!(offset >  - 1)) return BAD_BIT1;
                                  state = str2int(state);
                              Severity: Minor
                              Found in lib/backend.js - About 35 mins 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

                              Function zUnwrap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              , zUnwrap: function (range, scores) {
                                  var i, n = range.length, out = n ?[] : range;
                                  if (n)
                                    for (i = 0; i < n; i++) {
                                      out.push(range[i].member);
                              Severity: Minor
                              Found in lib/backend.js - About 35 mins 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

                              Function FAKE_DUMP has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              , FAKE_DUMP: function (pattern) {
                                  var keys = this.KEYS(pattern), i, n = keys.length, out = [], key, type;
                              
                                  for (i = 0; i < n; i++) {
                                    key = keys[i];
                              Severity: Minor
                              Found in lib/backend.js - About 35 mins 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

                              Avoid too many return statements within this function.
                              Open

                                    if (this.EXISTS(key)) return null;
                              Severity: Major
                              Found in lib/backend.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return this.zOpStore(union, key, keys, weights || null, aggregate || this.zsum);
                                Severity: Major
                                Found in lib/backend.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return [nextCursor, keys];
                                  Severity: Major
                                  Found in lib/backend.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          if (!this.EXISTS(key)) return null;
                                    Severity: Major
                                    Found in lib/backend.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                          return OK;
                                      Severity: Major
                                      Found in lib/backend.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return 1;
                                        Severity: Major
                                        Found in lib/backend.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                              if (args.length) return BAD_SYNTAX;
                                          Severity: Major
                                          Found in lib/backend.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                if (scoreFail) return BAD_SORT;
                                            Severity: Major
                                            Found in lib/backend.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                  return x;
                                              Severity: Major
                                              Found in lib/backend.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                      if (typeof store !== 'string') return BAD_SYNTAX;
                                                Severity: Major
                                                Found in lib/backend.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                        if (weights.map(str2float).some(function (w) { return w instanceof ERROR; })) return BAD_FLOAT;
                                                  Severity: Major
                                                  Found in lib/backend.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                          return BAD_ARGS;
                                                    Severity: Major
                                                    Found in lib/backend.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                          return OK;
                                                      Severity: Major
                                                      Found in lib/backend.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                              return out;
                                                        Severity: Major
                                                        Found in lib/backend.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                      return BAD_INT;
                                                          Severity: Major
                                                          Found in lib/backend.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                  return BAD_TYPE;
                                                            Severity: Major
                                                            Found in lib/backend.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                    return this.LLEN(store);
                                                              Severity: Major
                                                              Found in lib/backend.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                      return count;
                                                                Severity: Major
                                                                Found in lib/backend.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                      return arr;
                                                                  Severity: Major
                                                                  Found in lib/backend.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                          if (aggregate !== 'sum' && aggregate !== 'min' && aggregate !== 'max') return BAD_SYNTAX;
                                                                    Severity: Major
                                                                    Found in lib/backend.js - About 30 mins to fix

                                                                      Function lPush has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                      , lPush: function (left, make, args) {
                                                                          var i, n = args.length, key = args[0];
                                                                          var K = this.getKey(LIST, key, make);
                                                                          if (K instanceof ERROR) return K;
                                                                          if (n < 2) return BAD_ARGS;
                                                                      Severity: Minor
                                                                      Found in lib/backend.js - About 25 mins 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

                                                                      Function str2float has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                      var str2float = function (string) {
                                                                        var value = Number(string);
                                                                        if (typeof string !== 'string') throw new Error("WOOT! str2float: '" + string + "' not a string.");
                                                                        if (string === '+inf') value = Number.POSITIVE_INFINITY;
                                                                        else if (string === '-inf') value = Number.NEGATIVE_INFINITY;
                                                                      Severity: Minor
                                                                      Found in lib/backend.js - About 25 mins 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

                                                                      Function LINSERT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                      , LINSERT: function (key, relpos, pivot, value) {
                                                                          var K = this.getKey(LIST, key), x;
                                                                          if (K instanceof ERROR) return K;
                                                                      
                                                                          relpos = relpos.toUpperCase();
                                                                      Severity: Minor
                                                                      Found in lib/backend.js - About 25 mins 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

                                                                      Function SADD has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                      , SADD: function () {
                                                                          var key = arguments[0]
                                                                            , i, n = arguments.length
                                                                            , x = 0;
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in lib/backend.js - About 25 mins 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

                                                                      Function HMGET has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                      , HMGET: function () {
                                                                          var K = this.getKey(HASH, arguments[0]);
                                                                          if (K instanceof ERROR) return K;
                                                                      
                                                                          var i, n = arguments.length, values = [];
                                                                      Severity: Minor
                                                                      Found in lib/backend.js - About 25 mins 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

                                                                      , ZREMRANGEBYSCORE: function (key, min, max) {
                                                                          var members = this.ZRANGEBYSCORE(key, min, max), n = members.length;
                                                                          if (n)
                                                                            n = this.ZREM.apply(this, [key].concat(members));
                                                                      
                                                                      
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 2 hrs to fix
                                                                      lib/backend.js on lines 1586..1592

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

                                                                      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

                                                                      , ZREMRANGEBYRANK: function (key, start, stop) {
                                                                          var members = this.ZRANGE(key, start, stop), n = members.length;
                                                                          if (n)
                                                                            n = this.ZREM.apply(this, [key].concat(members));
                                                                      
                                                                      
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 2 hrs to fix
                                                                      lib/backend.js on lines 1594..1600

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

                                                                      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

                                                                      var ERROR = function (message) {
                                                                        this.getError = function () { return message; };
                                                                        this.toString = function () { return "<ERROR<" + message + ">>"; };
                                                                      };
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 28..31

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

                                                                      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

                                                                      var STATUS = function (message) {
                                                                        this.getStatus = function () { return message; };
                                                                        this.toString = function () { return "<STATUS<" + message + ">>"; };
                                                                      };
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 6..9

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

                                                                      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

                                                                      , HSCAN: function () {
                                                                          return this._scan(this.HGETALL(arguments[0]), 2, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
                                                                        }
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 530..532

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

                                                                      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

                                                                      , PSETEX: function (key, timediff, value) {
                                                                          /*jshint -W018*/
                                                                          if (!(str2int(timediff) > 0))
                                                                            return BAD_SETEX;
                                                                      
                                                                      
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 870..878

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

                                                                      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

                                                                      , SETEX: function (key, timediff, value) {
                                                                          /*jshint -W018*/
                                                                          if (!(str2int(timediff) > 0))
                                                                            return BAD_SETEX;
                                                                      
                                                                      
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 860..868

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

                                                                      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

                                                                      , SSCAN: function () {
                                                                          return this._scan(this.SMEMBERS(arguments[0]), 1, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
                                                                        }
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 534..536

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

                                                                      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

                                                                            out.sort(function (a, b) {
                                                                              return (a.score - b.score) || (a.member < b.member ? - 1 : 1);
                                                                            });
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 1468..1470

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

                                                                      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

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

                                                                          if (/^asc|desc$/i.test(args[0])) {
                                                                            desc = /^desc$/i.test(args[0]);
                                                                            args.splice(0, 1);
                                                                            seenAscDesc = true;
                                                                          }
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 1755..1759

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

                                                                      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

                                                                              case 'PX': {
                                                                                if (arguments.length === argc)
                                                                                  return BAD_ARGS;
                                                                                optPX = arguments[argc++];
                                                                                /*jshint -W018*/
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 618..626

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

                                                                      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

                                                                            out.sort(function (b, a) {
                                                                              return (a.score - b.score) || (a.member < b.member ? - 1 : 1);
                                                                            });
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 1473..1475

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

                                                                      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

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

                                                                            if (/^asc|desc$/i.test(args[0])) {
                                                                              desc = /^desc$/i.test(args[0]);
                                                                              args.splice(0, 1);
                                                                              seenAscDesc = true;
                                                                            }
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 1740..1744

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

                                                                      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

                                                                              case 'EX': {
                                                                                if (arguments.length === argc)
                                                                                  return BAD_ARGS;
                                                                                optEX = arguments[argc++];
                                                                                /*jshint -W018*/
                                                                      Severity: Major
                                                                      Found in lib/backend.js and 1 other location - About 1 hr to fix
                                                                      lib/backend.js on lines 627..635

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

                                                                      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 ((xlo = min.substr(0, 1) === '('))
                                                                          min = str2float(min.substr(1));
                                                                        else
                                                                          min = str2float(min);
                                                                      Severity: Minor
                                                                      Found in lib/backend.js and 1 other location - About 50 mins to fix
                                                                      lib/backend.js on lines 87..90

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

                                                                      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 ((xhi = max.substr(0, 1) === '('))
                                                                          max = str2float(max.substr(1));
                                                                        else
                                                                          max = str2float(max);
                                                                      Severity: Minor
                                                                      Found in lib/backend.js and 1 other location - About 50 mins to fix
                                                                      lib/backend.js on lines 79..82

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

                                                                      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

                                                                      , BRPOP: function () {
                                                                          var a = this.bArgs(arguments);
                                                                          if (a instanceof ERROR) return a;
                                                                          return this.lPopMany(false, a);
                                                                        }
                                                                      Severity: Minor
                                                                      Found in lib/backend.js and 1 other location - About 40 mins to fix
                                                                      lib/backend.js on lines 1085..1089

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

                                                                      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

                                                                      , BLPOP: function () {
                                                                          var a = this.bArgs(arguments);
                                                                          if (a instanceof ERROR) return a;
                                                                          return this.lPopMany(true, a);
                                                                        }
                                                                      Severity: Minor
                                                                      Found in lib/backend.js and 1 other location - About 40 mins to fix
                                                                      lib/backend.js on lines 1091..1095

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

                                                                      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 (!d && by) d = a.by < b.by ? - 1 : a.by > b.by ? 1 : 0;
                                                                      Severity: Minor
                                                                      Found in lib/backend.js and 1 other location - About 35 mins to fix
                                                                      lib/backend.js on lines 1823..1823

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

                                                                      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 (!d) d = a.id < b.id ? - 1 : a.id > b.id ? 1 : 0;
                                                                      Severity: Minor
                                                                      Found in lib/backend.js and 1 other location - About 35 mins to fix
                                                                      lib/backend.js on lines 1822..1822

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

                                                                      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

                                                                      There are no issues that match your filters.

                                                                      Category
                                                                      Status