socketstream/socketstream

View on GitHub
lib/websocket/transports/engineio/client.js

Summary

Maintainability
F
2 wks
Test Coverage

File client.js has 2620 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function webpackUniversalModuleDefinition(root, factory) {
    if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if(typeof define === 'function' && define.amd)
        define([], factory);
Severity: Major
Found in lib/websocket/transports/engineio/client.js - About 1 wk to fix

    Function probe has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Socket.prototype.probe = function (name) {
          debug('probing transport "%s"', name);
          var transport = this.createTransport(name, { probe: 1 });
          var failed = false;
          var self = this;
    Severity: Major
    Found in lib/websocket/transports/engineio/client.js - About 3 hrs to fix

      Function create has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Request.prototype.create = function () {
            var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
      
            // SSL options for Node.js client
            opts.pfx = this.pfx;
      Severity: Major
      Found in lib/websocket/transports/engineio/client.js - About 3 hrs to fix

        Function Socket has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function Socket(uri, opts) {
              if (!(this instanceof Socket)) return new Socket(uri, opts);
        
              opts = opts || {};
        
        
        Severity: Major
        Found in lib/websocket/transports/engineio/client.js - About 2 hrs to fix

          Function doWrite has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              JSONPPolling.prototype.doWrite = function (data, fn) {
                var self = this;
          
                if (!this.form) {
                  var form = document.createElement('form');
          Severity: Major
          Found in lib/websocket/transports/engineio/client.js - About 2 hrs to fix

            Function parse has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function parse(str) {
                  str = String(str);
                  if (str.length > 100) {
                    return;
                  }
            Severity: Minor
            Found in lib/websocket/transports/engineio/client.js - About 2 hrs to fix

              Function encodePayloadAsArrayBuffer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  exports.encodePayloadAsArrayBuffer = function(packets, callback) {
                    if (!packets.length) {
                      return callback(new ArrayBuffer(0));
                    }
              
              
              Severity: Minor
              Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                Function decodeSymbol has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function decodeSymbol(strict) {
                        var byte1;
                        var byte2;
                        var byte3;
                        var byte4;
                Severity: Minor
                Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                  Function createDebug has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function createDebug(namespace) {
                  
                        var prevTime;
                  
                        function debug() {
                  Severity: Minor
                  Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                          if ((typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj)) ||
                            (typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
                            (withNativeBlob && obj instanceof Blob) ||
                            (withNativeFile && obj instanceof File)
                          ) {
                    Severity: Critical
                    Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                      Function decodePayload has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          exports.decodePayload = function (data, binaryType, callback) {
                            if (typeof data !== 'string') {
                              return exports.decodePayloadAsBinary(data, binaryType, callback);
                            }
                      
                      
                      Severity: Minor
                      Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                        Function write has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            WS.prototype.write = function (packets) {
                              var self = this;
                              this.writable = false;
                        
                              // encodePacket efficient as it uses WS framing
                        Severity: Minor
                        Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                          Function decodePayloadAsBinary has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              exports.decodePayloadAsBinary = function (data, binaryType, callback) {
                                if (typeof binaryType === 'function') {
                                  callback = binaryType;
                                  binaryType = null;
                                }
                          Severity: Minor
                          Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

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

                                Socket.prototype.createTransport = function (name) {
                                  debug('creating transport "%s"', name);
                                  var query = clone(this.query);
                            
                                  // append engine.io protocol identifier
                            Severity: Minor
                            Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

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

                                  WS.prototype.doOpen = function () {
                                    if (!this.check()) {
                                      // let probe timeout
                                      return;
                                    }
                              Severity: Minor
                              Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                Function onTransportOpen has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      function onTransportOpen() {
                                        if (self.onlyBinaryUpgrades) {
                                          var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
                                          failed = failed || upgradeLosesBinary;
                                        }
                                Severity: Minor
                                Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                  Function close has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      Socket.prototype.close = function () {
                                        if ('opening' === this.readyState || 'open' === this.readyState) {
                                          this.readyState = 'closing';
                                  
                                          var self = this;
                                  Severity: Minor
                                  Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                    Function debug has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function debug() {
                                            // disabled?
                                            if (!debug.enabled) return;
                                    
                                            var self = debug;
                                    Severity: Minor
                                    Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                      Function encodePayloadAsBlob has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          exports.encodePayloadAsBlob = function(packets, callback) {
                                            function encodeOne(packet, doneCallback) {
                                              exports.encodePacket(packet, true, true, function(encoded) {
                                                var binaryIdentifier = new Uint8Array(1);
                                                binaryIdentifier[0] = 1;
                                      Severity: Minor
                                      Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                        Function decodePacket has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            exports.decodePacket = function (data, binaryType, utf8decode) {
                                              if (data === undefined) {
                                                return err;
                                              }
                                              // String data
                                        Severity: Minor
                                        Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

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

                                              Polling.prototype.pause = function (onPause) {
                                                var self = this;
                                          
                                                this.readyState = 'pausing';
                                          
                                          
                                          Severity: Minor
                                          Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                            Function hasBinary has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                function hasBinary (obj) {
                                                  if (!obj || typeof obj !== 'object') {
                                                    return false;
                                                  }
                                            
                                            
                                            Severity: Minor
                                            Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

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

                                                  JSONPPolling.prototype.doPoll = function () {
                                                    var self = this;
                                                    var script = document.createElement('script');
                                              
                                                    if (this.script) {
                                              Severity: Minor
                                              Found in lib/websocket/transports/engineio/client.js - About 1 hr to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                      return false;
                                                Severity: Major
                                                Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return callback(err, 0, 1);
                                                  Severity: Major
                                                  Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                            return callback(err, 0, 1);
                                                    Severity: Major
                                                    Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                            return { type: packetslist[type], data: rest };
                                                      Severity: Major
                                                      Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                        return cachedClearTimeout.call(this, marker);
                                                        Severity: Major
                                                        Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                    return true;
                                                          Severity: Major
                                                          Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                            return cachedSetTimeout.call(this, fun, 0);
                                                            Severity: Major
                                                            Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                    return ms + 'ms';
                                                              Severity: Major
                                                              Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                                return codePoint;
                                                                Severity: Major
                                                                Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                            return { type: packetslist[type] };
                                                                  Severity: Major
                                                                  Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                            return hasBinary(obj.toJSON(), true);
                                                                    Severity: Major
                                                                    Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                                if (false === ret) return;
                                                                      Severity: Major
                                                                      Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                  return { type: packetslist[type], data: data.substring(1) };
                                                                        Severity: Major
                                                                        Found in lib/websocket/transports/engineio/client.js - About 30 mins to fix

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

                                                                                if (this.port && ('wss' === schema && Number(this.port) !== 443 || 'ws' === schema && Number(this.port) !== 80)) {
                                                                                  port = ':' + this.port;
                                                                                }
                                                                          Severity: Major
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 2 hrs to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 1599..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 78.

                                                                          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 (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) {
                                                                                  port = ':' + this.port;
                                                                                }
                                                                          Severity: Major
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 2 hrs to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 4542..4544

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

                                                                          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

                                                                                for (i = 0, len = exports.names.length; i < len; i++) {
                                                                                  if (exports.names[i].test(name)) {
                                                                                    return true;
                                                                                  }
                                                                                }
                                                                          Severity: Major
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 1 hr to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 3854..3858

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

                                                                          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

                                                                                for (i = 0, len = exports.skips.length; i < len; i++) {
                                                                                  if (exports.skips[i].test(name)) {
                                                                                    return false;
                                                                                  }
                                                                                }
                                                                          Severity: Major
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 1 hr to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 3859..3863

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

                                                                          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 (this.polling) {
                                                                                    debug('we are currently polling - waiting to pause');
                                                                                    total++;
                                                                                    this.once('pollComplete', function () {
                                                                                      debug('pre-pause polling complete');
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 50 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 1462..1469

                                                                          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 (!this.writable) {
                                                                                    debug('we are currently writing - waiting to pause');
                                                                                    total++;
                                                                                    this.once('drain', function () {
                                                                                      debug('pre-pause writing complete');
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 50 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 1453..1460

                                                                          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

                                                                                  try {
                                                                                      if (typeof setTimeout === 'function') {
                                                                                          cachedSetTimeout = setTimeout;
                                                                                      } else {
                                                                                          cachedSetTimeout = defaultSetTimout;
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 50 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 3491..3499

                                                                          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

                                                                                  try {
                                                                                      if (typeof clearTimeout === 'function') {
                                                                                          cachedClearTimeout = clearTimeout;
                                                                                      } else {
                                                                                          cachedClearTimeout = defaultClearTimeout;
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 50 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 3482..3490

                                                                          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

                                                                                return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 40 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 4564..4564

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

                                                                          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

                                                                                return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 40 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 1609..1609

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

                                                                          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

                                                                                      for (var i = 0; i < encoded.length; i++) {
                                                                                        view[i] = encoded.charCodeAt(i);
                                                                                      }
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 35 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 2259..2261

                                                                          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

                                                                                      for (var i = 0; i < p.length; i++) {
                                                                                        view[i] = p.charCodeAt(i);
                                                                                      }
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 35 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 2298..2300

                                                                          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

                                                                                      for (var i = 1; i < arguments.length; i++) {
                                                                                          args[i - 1] = arguments[i];
                                                                                      }
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 35 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 1929..1931

                                                                          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

                                                                                for (var i = 0; i < contentArray.length; i++) {
                                                                                  resultBuffer[i+1] = contentArray[i];
                                                                                }
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 35 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 3600..3602

                                                                          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

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

                                                                                if (this.script) {
                                                                                  this.script.parentNode.removeChild(this.script);
                                                                                  this.script = null;
                                                                                }
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 30 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 4143..4146

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

                                                                          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 (this.script) {
                                                                                  this.script.parentNode.removeChild(this.script);
                                                                                  this.script = null;
                                                                                }
                                                                          Severity: Minor
                                                                          Found in lib/websocket/transports/engineio/client.js and 1 other location - About 30 mins to fix
                                                                          lib/websocket/transports/engineio/client.js on lines 4167..4170

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

                                                                          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