hdachev/fakeredis

View on GitHub
redis.test.js

Summary

Maintainability
F
1 wk
Test Coverage

File redis.test.js has 1041 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This is a slightly modified version of the redis@0.10.1 test suite.
// I'll mark all modifications with /*MODIF*/ to keep track of what I change.

function requireLibUtil() { /*MODIF*/
    try {
Severity: Major
Found in redis.test.js - About 2 days to fix

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

    tests.SORT = function () {
        var name = "SORT";
    
        client.del('y');
        client.del('x');
    Severity: Major
    Found in redis.test.js - About 3 hrs to fix

      Function detect_buffers has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      tests.detect_buffers = function () {
          var name = "detect_buffers", detect_client = redis.createClient(null, null, {detect_buffers: true});
      
          detect_client.on("ready", function () {
              // single Buffer or String
      Severity: Major
      Found in redis.test.js - About 2 hrs to fix

        Function SCAN has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        tests.SCAN = function(){
            var name = 'SCAN';
            var resultArray = [];
        
            client.flushdb();
        Severity: Major
        Found in redis.test.js - About 2 hrs to fix

          Function SINTER has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          tests.SINTER = function () {
              var name = "SINTER";
          
              client.del('sa');
              client.del('sb');
          Severity: Minor
          Found in redis.test.js - About 1 hr to fix

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

            tests.HMGET = function () {
                var key1 = "test hash 1", key2 = "test hash 2", key3 = 123456789, name = "HMGET";
            
                // redis-like hmset syntax
                client.HMSET(key1, "0123456789", "abcdefghij", "some manner of key", "a type of value", require_string("OK", name));
            Severity: Minor
            Found in redis.test.js - About 1 hr to fix

              Function SUNIONSTORE has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              tests.SUNIONSTORE = function () {
                  var name = "SUNIONSTORE";
              
                  client.del('sa');
                  client.del('sb');
              Severity: Minor
              Found in redis.test.js - About 1 hr to fix

                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

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

                    client.MGET("mget keys 1", "mget keys 2", "mget keys 3", function (err, results) {
                        assert.strictEqual(null, err, "result sent back unexpected error: " + err);
                        assert.strictEqual(3, results.length, name);
                        assert.strictEqual("mget val 1", results[0].toString(), name);
                        assert.strictEqual("mget val 2", results[1].toString(), name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 3 hrs to fix
                redis.test.js on lines 1431..1437

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

                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

                    client.MGET(["mget keys 1", "mget keys 2", "mget keys 3"], function (err, results) {
                        assert.strictEqual(null, err, "result sent back unexpected error: " + err);
                        assert.strictEqual(3, results.length, name);
                        assert.strictEqual("mget val 1", results[0].toString(), name);
                        assert.strictEqual("mget val 2", results[1].toString(), name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 3 hrs to fix
                redis.test.js on lines 1424..1430

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

                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

                    client.smembers("set0", function (err, res) {
                        assert.strictEqual(res.length, 3);
                        assert.ok(~res.indexOf("member3"));
                        assert.ok(~res.indexOf("member4"));
                        assert.ok(~res.indexOf("member5"));
                Severity: Major
                Found in redis.test.js and 1 other location - About 3 hrs to fix
                redis.test.js on lines 1545..1551

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

                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

                    client.smembers("set1", function (err, res) {
                        assert.strictEqual(res.length, 3);
                        assert.ok(~res.indexOf("member0"));
                        assert.ok(~res.indexOf("member1"));
                        assert.ok(~res.indexOf("member2"));
                Severity: Major
                Found in redis.test.js and 1 other location - About 3 hrs to fix
                redis.test.js on lines 1595..1601

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

                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

                    client.sinter('sb', 'sc', function (err, intersection) {
                        if (err) {
                            assert.fail(err, name);
                        }
                        assert.equal(intersection.length, 2, name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 2 hrs to fix
                redis.test.js on lines 1739..1745

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

                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

                    client.sinter('sa', 'sb', function (err, intersection) {
                        if (err) {
                            assert.fail(err, name);
                        }
                        assert.equal(intersection.length, 2, name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 2 hrs to fix
                redis.test.js on lines 1747..1753

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

                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

                    client4.get(new Buffer("string key 1"), function (err, reply) {
                        assert.strictEqual(null, err, name);
                        assert.strictEqual(true, Buffer.isBuffer(reply), name);
                        assert.strictEqual("<Buffer 73 74 72 69 6e 67 20 76 61 6c 75 65>", reply.inspect(), name);
                    });
                Severity: Major
                Found in redis.test.js and 1 other location - About 2 hrs to fix
                redis.test.js on lines 726..730

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

                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

                        detect_client.get(new Buffer("string key 1"), function (err, reply) {
                            assert.strictEqual(null, err, name);
                            assert.strictEqual(true, Buffer.isBuffer(reply), name);
                            assert.strictEqual("<Buffer 73 74 72 69 6e 67 20 76 61 6c 75 65>", reply.inspect(), name);
                        });
                Severity: Major
                Found in redis.test.js and 1 other location - About 2 hrs to fix
                redis.test.js on lines 2275..2279

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

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

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

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

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

                Refactorings

                Further Reading

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

                    client.HMGET(key1, "0123456789", "some manner of key", function (err, reply) {
                        assert.strictEqual("abcdefghij", reply[0].toString(), name);
                        assert.strictEqual("a type of value", reply[1].toString(), name);
                    });
                Severity: Major
                Found in redis.test.js and 2 other locations - About 1 hr to fix
                redis.test.js on lines 977..980
                redis.test.js on lines 982..985

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

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

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

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

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

                Refactorings

                Further Reading

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

                    client.HMGET(key2, "0123456789", "some manner of key", function (err, reply) {
                        assert.strictEqual("abcdefghij", reply[0].toString(), name);
                        assert.strictEqual("a type of value", reply[1].toString(), name);
                    });
                Severity: Major
                Found in redis.test.js and 2 other locations - About 1 hr to fix
                redis.test.js on lines 972..975
                redis.test.js on lines 982..985

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

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

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

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

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

                Refactorings

                Further Reading

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

                    client.HMGET(key3, "0123456789", "some manner of key", function (err, reply) {
                        assert.strictEqual("abcdefghij", reply[0].toString(), name);
                        assert.strictEqual("a type of value", reply[1].toString(), name);
                    });
                Severity: Major
                Found in redis.test.js and 2 other locations - About 1 hr to fix
                redis.test.js on lines 972..975
                redis.test.js on lines 977..980

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

                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

                    client.sort('y', 'asc', 'alpha', function (err, sorted) {
                        if (err) {
                            assert.fail(err, name);
                        }
                        assert.deepEqual(buffers_to_strings(sorted), ['a', 'b', 'c', 'd'], name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 1 hr to fix
                redis.test.js on lines 1919..1924

                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

                    client.sort('y', 'desc', 'alpha', function (err, sorted) {
                        if (err) {
                            assert.fail(err, name);
                        }
                        assert.deepEqual(buffers_to_strings(sorted), ['d', 'c', 'b', 'a'], name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 1 hr to fix
                redis.test.js on lines 1912..1917

                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

                    client.sort('x', 'desc', function (err, sorted) {
                        if (err) {
                            assert.fail(err, name);
                        }
                        assert.deepEqual(buffers_to_strings(sorted), [9, 4, 3, 2], name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 1 hr to fix
                redis.test.js on lines 1929..1934

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

                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

                    client.sort('x', 'asc', function (err, sorted) {
                        if (err) {
                            assert.fail(err, name);
                        }
                        assert.deepEqual(buffers_to_strings(sorted), [2, 3, 4, 9], name);
                Severity: Major
                Found in redis.test.js and 1 other location - About 1 hr to fix
                redis.test.js on lines 1936..1941

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

                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

                tests.PUNSUB_EMPTY = function () {
                  // test situation where punsubscribe reply[1] is null
                  var name = "PUNSUB_EMPTY";
                  client3.punsubscribe(); // punsubscribe from all so can test null
                  client3.punsubscribe(); // reply[1] will be null
                Severity: Major
                Found in redis.test.js and 1 other location - About 1 hr to fix
                redis.test.js on lines 1045..1051

                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

                tests.UNSUB_EMPTY = function () {
                  // test situation where unsubscribe reply[1] is null
                  var name = "UNSUB_EMPTY";
                  client3.unsubscribe(); // unsubscribe from all so can test null
                  client3.unsubscribe(); // reply[1] will be null
                Severity: Major
                Found in redis.test.js and 1 other location - About 1 hr to fix
                redis.test.js on lines 1053..1059

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

                bclient.on("error", function (err) {
                    console.error("bclient: " + err.stack);
                    process.exit();
                });
                Severity: Minor
                Found in redis.test.js and 2 other locations - About 35 mins to fix
                redis.test.js on lines 2322..2325
                redis.test.js on lines 2326..2329

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

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

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

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

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

                Refactorings

                Further Reading

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

                client3.on("error", function (err) {
                    console.error("client3: " + err.stack);
                    process.exit();
                });
                Severity: Minor
                Found in redis.test.js and 2 other locations - About 35 mins to fix
                redis.test.js on lines 2322..2325
                redis.test.js on lines 2330..2333

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

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

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

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

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

                Refactorings

                Further Reading

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

                client2.on("error", function (err) {
                    console.error("client2: " + err.stack);
                    process.exit();
                });
                Severity: Minor
                Found in redis.test.js and 2 other locations - About 35 mins to fix
                redis.test.js on lines 2326..2329
                redis.test.js on lines 2330..2333

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

                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