hdachev/fakeredis

View on GitHub

Showing 133 of 133 total issues

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

        TODO found
        Open

        // TODO - add test for HMSET with optional callbacks
        Severity: Minor
        Found in redis.test.js by fixme

        TODO found
        Open

            // MODIF TODO FIX
        Severity: Minor
        Found in redis.test.js by fixme

        TODO found
        Open

                // MODIF TODO FIX
        Severity: Minor
        Found in redis.test.js by fixme

        TODO found
        Open

        // TODO - need a better way to test auth, maybe auto-config a local Redis server or something.
        Severity: Minor
        Found in redis.test.js by fixme

        TODO found
        Open

            // TODO - sort by hash value
        Severity: Minor
        Found in redis.test.js by fixme
        Severity
        Category
        Status
        Source
        Language