RLOpenCatalyst/core

View on GitHub
client/cat3/customlib/socket.io/socket.io.js

Summary

Maintainability
F
1 mo
Test Coverage

File socket.io.js has 3772 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.io=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

    module.exports = _dereq_('./lib/');

},{"./lib/":2}],2:[function(_dereq_,module,exports){
Severity: Major
Found in client/cat3/customlib/socket.io/socket.io.js - About 1 wk to fix

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

    },{}],47:[function(_dereq_,module,exports){
        /*! JSON v3.2.6 | http://bestiejs.github.io/json3 | Copyright 2012-2013, Kit Cambridge | http://kit.mit-license.org */
        ;(function (window) {
            // Convenience aliases.
            var getClass = {}.toString, isProperty, forEach, undef;
    Severity: Major
    Found in client/cat3/customlib/socket.io/socket.io.js - About 2 days to fix

      Function 13 has 406 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"./socket":13,"engine.io-parser":25}],13:[function(_dereq_,module,exports){
          (function (global){
              /**
               * Module dependencies.
               */
      Severity: Major
      Found in client/cat3/customlib/socket.io/socket.io.js - About 2 days to fix

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

        },{}],25:[function(_dereq_,module,exports){
            (function (global){
                /**
                 * Module dependencies.
                 */
        Severity: Major
        Found in client/cat3/customlib/socket.io/socket.io.js - About 1 day to fix

          Function 3 has 273 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"./manager":3,"./socket":5,"./url":6,"debug":10,"socket.io-parser":44}],3:[function(_dereq_,module,exports){
          
              /**
               * Module dependencies.
               */
          Severity: Major
          Found in client/cat3/customlib/socket.io/socket.io.js - About 1 day to fix

            Function 5 has 199 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{}],5:[function(_dereq_,module,exports){
            
                /**
                 * Module dependencies.
                 */
            Severity: Major
            Found in client/cat3/customlib/socket.io/socket.io.js - About 7 hrs to fix

              Function 17 has 198 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              },{"./polling":18,"component-inherit":21}],17:[function(_dereq_,module,exports){
                  (function (global){
                      /**
                       * Module requirements.
                       */
              Severity: Major
              Found in client/cat3/customlib/socket.io/socket.io.js - About 7 hrs to fix

                Function 31 has 184 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{}],31:[function(_dereq_,module,exports){
                    (function (global){
                        /*! http://mths.be/utf8js v2.0.0 by @mathias */
                        ;(function(root) {
                
                
                Severity: Major
                Found in client/cat3/customlib/socket.io/socket.io.js - About 7 hrs to fix

                  Function 44 has 179 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  },{"./is-buffer":45,"isarray":46}],44:[function(_dereq_,module,exports){
                  
                      /**
                       * Module dependencies.
                       */
                  Severity: Major
                  Found in client/cat3/customlib/socket.io/socket.io.js - About 7 hrs to fix

                    Function 18 has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    },{"./polling":18,"component-emitter":9,"component-inherit":21,"debug":22,"xmlhttprequest":20}],18:[function(_dereq_,module,exports){
                        /**
                         * Module dependencies.
                         */
                    
                    
                    Severity: Major
                    Found in client/cat3/customlib/socket.io/socket.io.js - About 5 hrs to fix

                      Function 16 has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      },{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,"xmlhttprequest":20}],16:[function(_dereq_,module,exports){
                          (function (global){
                      
                              /**
                               * Module requirements.
                      Severity: Major
                      Found in client/cat3/customlib/socket.io/socket.io.js - About 5 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                                            if (stringifySupported) {
                                                // A test function object with a custom `toJSON` method.
                                                (value = function () {
                                                    return 1;
                                                }).toJSON = value;
                        Severity: Critical
                        Found in client/cat3/customlib/socket.io/socket.io.js - About 4 hrs to fix

                          Function 19 has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          },{"../transport":14,"component-inherit":21,"debug":22,"engine.io-parser":25,"parseqs":33,"xmlhttprequest":20}],19:[function(_dereq_,module,exports){
                              /**
                               * Module dependencies.
                               */
                          
                          
                          Severity: Major
                          Found in client/cat3/customlib/socket.io/socket.io.js - About 4 hrs to fix

                            Function lex has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            var lex = function () {
                                                var source = Source, length = source.length, value, begin, position, isSigned, charCode;
                                                while (Index < length) {
                                                    charCode = source.charCodeAt(Index);
                                                    switch (charCode) {
                            Severity: Major
                            Found in client/cat3/customlib/socket.io/socket.io.js - About 4 hrs to fix

                              Function 43 has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              },{}],43:[function(_dereq_,module,exports){
                                  (function (global){
                                      /*global Blob,File*/
                              
                                      /**
                              Severity: Major
                              Found in client/cat3/customlib/socket.io/socket.io.js - About 3 hrs to fix

                                Function 23 has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                },{"./debug":23}],23:[function(_dereq_,module,exports){
                                
                                    /**
                                     * This is the common logic for both the Node.js and web browser
                                     * implementations of `debug()`.
                                Severity: Major
                                Found in client/cat3/customlib/socket.io/socket.io.js - About 3 hrs 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 })
                                                  , failed = false
                                                  , self = this;
                                  Severity: Major
                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 3 hrs to fix

                                    Function serialize has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                    var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
                                                        var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;
                                                        try {
                                                            // Necessary for host object support.
                                                            value = object[property];
                                    Severity: Major
                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 3 hrs to fix

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

                                              function has(name) {
                                                  if (has[name] !== undef) {
                                                      // Return cached feature test result.
                                                      return has[name];
                                                  }
                                      Severity: Major
                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

                                        Function 9 has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        },{}],9:[function(_dereq_,module,exports){
                                        
                                            /**
                                             * Expose `Emitter`.
                                             */
                                        Severity: Major
                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

                                          Function 22 has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          },{}],22:[function(_dereq_,module,exports){
                                          
                                              /**
                                               * This is the web browser implementation of `debug()`.
                                               *
                                          Severity: Major
                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

                                            Function 10 has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            },{}],10:[function(_dereq_,module,exports){
                                            
                                                /**
                                                 * Expose `debug()` as the module.
                                                 */
                                            Severity: Major
                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

                                              Function 14 has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                              },{"./transport":14,"./transports":15,"component-emitter":9,"debug":22,"engine.io-parser":25,"indexof":40,"parsejson":32,"parseqs":33,"parseuri":34}],14:[function(_dereq_,module,exports){
                                                  /**
                                                   * Module dependencies.
                                                   */
                                              
                                              
                                              Severity: Major
                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

                                                Function 24 has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                },{"ms":24}],24:[function(_dereq_,module,exports){
                                                    /**
                                                     * Helpers.
                                                     */
                                                
                                                
                                                Severity: Major
                                                Found in client/cat3/customlib/socket.io/socket.io.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 client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

                                                    Function get has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                                    var get = function (value) {
                                                                        var results, hasMembers;
                                                                        if (value == "$") {
                                                                            // Unexpected end of input.
                                                                            abort();
                                                    Severity: Major
                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 2 hrs to fix

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

                                                              Request.prototype.create = function(){
                                                                  var xhr = this.xhr = new XMLHttpRequest({ agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR });
                                                                  var self = this;
                                                      
                                                                  try {
                                                      Severity: Major
                                                      Found in client/cat3/customlib/socket.io/socket.io.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 client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                      function decodeSymbol() {
                                                                          var byte1;
                                                                          var byte2;
                                                                          var byte3;
                                                                          var byte4;
                                                          Severity: Minor
                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                            Function Socket has 45 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: Minor
                                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                  function decodeString(str) {
                                                                      var p = {};
                                                                      var i = 0;
                                                              
                                                                      // look up type
                                                              Severity: Minor
                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                                Function connect has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        Manager.prototype.connect = function(fn){
                                                                            debug('readyState %s', this.readyState);
                                                                            if (~this.readyState.indexOf('open')) return this;
                                                                
                                                                            debug('opening %s', this.uri);
                                                                Severity: Minor
                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                  },{}],29:[function(_dereq_,module,exports){
                                                                      /*
                                                                       * base64-arraybuffer
                                                                       * https://github.com/niklasvh/base64-arraybuffer
                                                                       *
                                                                  Severity: Minor
                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                        function debug(namespace) {
                                                                    
                                                                            // define the `disabled` version
                                                                            function disabled() {
                                                                            }
                                                                    Severity: Minor
                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                                      Function decodePayloadAsBinary has 41 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 client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                                        Function 6 has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                        },{"./on":4,"component-bind":8,"component-emitter":9,"debug":10,"has-binary":36,"socket.io-parser":44,"to-array":48}],6:[function(_dereq_,module,exports){
                                                                            (function (global){
                                                                        
                                                                                /**
                                                                                 * Module dependencies.
                                                                        Severity: Minor
                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                                          Function decodePayload has 40 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 client/cat3/customlib/socket.io/socket.io.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 client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                  Manager.prototype.reconnect = function(){
                                                                                      if (this.reconnecting || this.skipReconnect) return this;
                                                                              
                                                                                      var self = this;
                                                                              
                                                                              
                                                                              Severity: Minor
                                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                },{}],30:[function(_dereq_,module,exports){
                                                                                    (function (global){
                                                                                        /**
                                                                                         * Create a blob builder even when vendor prefixes exist
                                                                                         */
                                                                                Severity: Minor
                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                  },{}],36:[function(_dereq_,module,exports){
                                                                                      (function (global){
                                                                                  
                                                                                          /*
                                                                                           * Module requirements.
                                                                                  Severity: Minor
                                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                            function url(uri, loc){
                                                                                                var obj = uri;
                                                                                    
                                                                                                // default to window.location
                                                                                                var loc = loc || global.location;
                                                                                    Severity: Minor
                                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                              exports.removeBlobs = function(data, callback) {
                                                                                                  function _removeBlobs(obj, curKey, containingObject) {
                                                                                                      if (!obj) return obj;
                                                                                      
                                                                                                      // convert any blob
                                                                                      Severity: Minor
                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                                                        Consider simplifying this complex logical expression.
                                                                                        Open

                                                                                                        if ( (global.Buffer && global.Buffer.isBuffer(obj)) ||
                                                                                                            (global.ArrayBuffer && obj instanceof ArrayBuffer) ||
                                                                                                            (global.Blob && obj instanceof Blob) ||
                                                                                                            (global.File && obj instanceof File)
                                                                                                        ) {
                                                                                        Severity: Critical
                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

                                                                                          Function 41 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                          },{}],41:[function(_dereq_,module,exports){
                                                                                          
                                                                                              /**
                                                                                               * HOP ref.
                                                                                               */
                                                                                          Severity: Minor
                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                            },{"component-emitter":9,"engine.io-parser":25}],15:[function(_dereq_,module,exports){
                                                                                                (function (global){
                                                                                                    /**
                                                                                                     * Module dependencies
                                                                                                     */
                                                                                            Severity: Minor
                                                                                            Found in client/cat3/customlib/socket.io/socket.io.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 client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                },{"./lib/":2}],2:[function(_dereq_,module,exports){
                                                                                                
                                                                                                    /**
                                                                                                     * Module dependencies.
                                                                                                     */
                                                                                                Severity: Minor
                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                          function enabled() {
                                                                                                  
                                                                                                              var self = enabled;
                                                                                                  
                                                                                                              // set `diff` timestamp
                                                                                                  Severity: Minor
                                                                                                  Found in client/cat3/customlib/socket.io/socket.io.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 client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                      },{"debug":10,"parseuri":42}],7:[function(_dereq_,module,exports){
                                                                                                      
                                                                                                          /**
                                                                                                           * Expose `Backoff`.
                                                                                                           */
                                                                                                      Severity: Minor
                                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                            function Manager(uri, opts){
                                                                                                                if (!(this instanceof Manager)) return new Manager(uri, opts);
                                                                                                                if (uri && ('object' == typeof uri)) {
                                                                                                                    opts = uri;
                                                                                                                    uri = undefined;
                                                                                                        Severity: Minor
                                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                              Polling.prototype.pause = function(onPause){
                                                                                                                  var pending = 0;
                                                                                                                  var self = this;
                                                                                                          
                                                                                                                  this.readyState = 'pausing';
                                                                                                          Severity: Minor
                                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                function parse(str) {
                                                                                                                    var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
                                                                                                                    if (!match) return;
                                                                                                                    var n = parseFloat(match[1]);
                                                                                                                    var type = (match[2] || 'ms').toLowerCase();
                                                                                                            Severity: Minor
                                                                                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                      function hasBinary(data) {
                                                                                                              
                                                                                                                          function _hasBinary(obj) {
                                                                                                                              if (!obj) return false;
                                                                                                              
                                                                                                              
                                                                                                              Severity: Minor
                                                                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                        exports.decodePacket = function (data, binaryType, utf8decode) {
                                                                                                                            // String data
                                                                                                                            if (typeof data == 'string' || data === undefined) {
                                                                                                                                if (data.charAt(0) == 'b') {
                                                                                                                                    return exports.decodeBase64Packet(data.substr(1), binaryType);
                                                                                                                Severity: Minor
                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                          exports.deconstructPacket = function(packet){
                                                                                                                              var buffers = [];
                                                                                                                              var packetData = packet.data;
                                                                                                                  
                                                                                                                              function _deconstructPacket(data) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                                function _removeBlobs(obj, curKey, containingObject) {
                                                                                                                                    if (!obj) return obj;
                                                                                                                    
                                                                                                                                    // convert any blob
                                                                                                                                    if ((global.Blob && obj instanceof Blob) ||
                                                                                                                    Severity: Minor
                                                                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                          Decoder.prototype.add = function(obj) {
                                                                                                                              var packet;
                                                                                                                              if ('string' == typeof obj) {
                                                                                                                                  packet = decodeString(obj);
                                                                                                                                  if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json
                                                                                                                      Severity: Minor
                                                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 1 hr to fix

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

                                                                                                                                        var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
                                                                                                                        Severity: Major
                                                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 50 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                                          if (parseSupported) {
                                                                                                                                                              try {
                                                                                                                                                                  // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
                                                                                                                                                                  parseSupported = !parse('"\t"');
                                                                                                                                                              } catch (exception) {}
                                                                                                                          Severity: Major
                                                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                            Open

                                                                                                                                                            if (element !== undef) {
                                                                                                                                                                // According to ES 5.1 section 15.12.3: "If `gap` {whitespace}
                                                                                                                                                                // is not the empty string, let `member` {quote(property) + ":"}
                                                                                                                                                                // be the concatenation of `member` and the `space` character."
                                                                                                                                                                // The "`space` character" refers to the literal space
                                                                                                                            Severity: Major
                                                                                                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                              Open

                                                                                                                                                          if (stack[length] === value) {
                                                                                                                                                              // Cyclic structures cannot be serialized by `JSON.stringify`.
                                                                                                                                                              throw TypeError();
                                                                                                                                                          }
                                                                                                                              Severity: Major
                                                                                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                Open

                                                                                                                                                            for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
                                                                                                                                Severity: Major
                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                  Open

                                                                                                                                                          } else if (className == stringClass) {
                                                                                                                                                              whitespace = width.length <= 10 ? width : width.slice(0, 10);
                                                                                                                                                          }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                    Open

                                                                                                                                                                    if (charCode < 32) {
                                                                                                                                                                        result += unicodePrefix + toPaddedString(2, charCode.toString(16));
                                                                                                                                                                        break;
                                                                                                                                                                    }
                                                                                                                                    Severity: Major
                                                                                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                      Open

                                                                                                                                                                  if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
                                                                                                                                                                      callback(property);
                                                                                                                                                                  }
                                                                                                                                      Severity: Major
                                                                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                                        Open

                                                                                                                                                                        if (charCode >= 48 && charCode <= 57) {
                                                                                                                                                                            // Leading zeroes are interpreted as octal literals.
                                                                                                                                                                            if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
                                                                                                                                                                                // Illegal octal literal.
                                                                                                                                                                                abort();
                                                                                                                                        Severity: Major
                                                                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                                          Open

                                                                                                                                                                      for (;; hasMembers || (hasMembers = true)) {
                                                                                                                                                                          value = lex();
                                                                                                                                                                          // A closing square bracket marks the end of the array literal.
                                                                                                                                                                          if (value == "]") {
                                                                                                                                                                              break;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                                            Open

                                                                                                                                                                    } else if (value == "{") {
                                                                                                                                                                        // Parses a JSON object, returning a new JavaScript object.
                                                                                                                                                                        results = {};
                                                                                                                                                                        for (;; hasMembers || (hasMembers = true)) {
                                                                                                                                                                            value = lex();
                                                                                                                                            Severity: Major
                                                                                                                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                                              Open

                                                                                                                                                                          for (length = value.length; length--;) {
                                                                                                                                                                              update(value, length, callback);
                                                                                                                                                                          }
                                                                                                                                              Severity: Major
                                                                                                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                                Open

                                                                                                                                                                        } else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) {
                                                                                                                                                                            // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the
                                                                                                                                                                            // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3
                                                                                                                                                                            // ignores all `toJSON` methods on these objects unless they are
                                                                                                                                                                            // defined directly on an instance.
                                                                                                                                                Severity: Major
                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                  Open

                                                                                                                                                                              if (value > -1 / 0 && value < 1 / 0) {
                                                                                                                                                                                  // Dates are serialized according to the `Date#toJSON` method
                                                                                                                                                                                  // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15
                                                                                                                                                                                  // for the ISO 8601 date time string format.
                                                                                                                                                                                  if (getDay) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                                    Open

                                                                                                                                                                                for (index = 0, length = value.length; index < length; index++) {
                                                                                                                                                                                    element = serialize(index, value, callback, properties, whitespace, indentation, stack);
                                                                                                                                                                                    results.push(element === undef ? "null" : element);
                                                                                                                                                                                }
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                                      Open

                                                                                                                                                                                      for (value = "@", Index++; Index < length;) {
                                                                                                                                                                                          charCode = source.charCodeAt(Index);
                                                                                                                                                                                          if (charCode < 32) {
                                                                                                                                                                                              // Unescaped ASCII control characters (those with a code unit
                                                                                                                                                                                              // less than the space character) are not permitted.
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                                                        Open

                                                                                                                                                                                        if (charCode == 45) {
                                                                                                                                                                                            isSigned = true;
                                                                                                                                                                                            charCode = source.charCodeAt(++Index);
                                                                                                                                                                                        }
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                                                          Open

                                                                                                                                                                                          if (source.slice(Index, Index + 4) == "true") {
                                                                                                                                                                                              Index += 4;
                                                                                                                                                                                              return true;
                                                                                                                                                                                          } else if (source.slice(Index, Index + 5) == "false") {
                                                                                                                                                                                              Index += 5;
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                                                            Open

                                                                                                                                                                                            if (isSigned) {
                                                                                                                                                                                                abort();
                                                                                                                                                                                            }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                                                              Open

                                                                                                                                                                                          if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {
                                                                                                                                                                                              callback(property);
                                                                                                                                                                                          }
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                                                Open

                                                                                                                                                                                            if ((width -= width % 1) > 0) {
                                                                                                                                                                                                for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
                                                                                                                                                                                            }
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                                  Open

                                                                                                                                                                                                  if (source.charCodeAt(Index) == 34) {
                                                                                                                                                                                                      // Advance to the next character and return the revived string.
                                                                                                                                                                                                      Index++;
                                                                                                                                                                                                      return value;
                                                                                                                                                                                                  }
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 45 mins to fix

                                                                                                                                                                    Consider simplifying this complex logical expression.
                                                                                                                                                                    Open

                                                                                                                                                                                                                        if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
                                                                                                                                                                                                                            // Invalid Unicode escape sequence.
                                                                                                                                                                                                                            abort();
                                                                                                                                                                                                                        }
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 40 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                                          return { type: packetslist[type] };
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                                                    return callback(err, 0, 1);
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                              return "$";
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                            return false;
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                                      if (false === ret) return;
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                                        return result;
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                  Open

                                                                                                                                                                                                                      return null;
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                    Open

                                                                                                                                                                                            return ms + 'ms';
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                                      Open

                                                                                                                                                                                                                          return false;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                                        Open

                                                                                                                                                                                                        return callback(err, 0, 1);
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                                          Open

                                                                                                                                                                                                                  return codePoint;
                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                          Found in client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

                                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                                            Open

                                                                                                                                                                                                            return data;
                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                            Found in client/cat3/customlib/socket.io/socket.io.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 client/cat3/customlib/socket.io/socket.io.js - About 30 mins to fix

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

                                                                                                                                                                                                            if (namespaces[0] === '-') {
                                                                                                                                                                                                                exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                exports.names.push(new RegExp('^' + namespaces + '$'));
                                                                                                                                                                                                            }
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 1431..1436

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

                                                                                                                                                                                                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 (name[0] === '-') {
                                                                                                                                                                                                                debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
                                                                                                                                                                                                            }
                                                                                                                                                                                                            else {
                                                                                                                                                                                                                debug.names.push(new RegExp('^' + name + '$'));
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3828..3832

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

                                                                                                                                                                                                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

                                                                                                                                                                                                    Manager.prototype.reconnectionDelayMax = function(v){
                                                                                                                                                                                                        if (!arguments.length) return this._reconnectionDelayMax;
                                                                                                                                                                                                        this._reconnectionDelayMax = v;
                                                                                                                                                                                                        this.backoff && this.backoff.setMax(v);
                                                                                                                                                                                                        return this;
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 227..232
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 234..239

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

                                                                                                                                                                                                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

                                                                                                                                                                                                    Manager.prototype.randomizationFactor = function(v){
                                                                                                                                                                                                        if (!arguments.length) return this._randomizationFactor;
                                                                                                                                                                                                        this._randomizationFactor = v;
                                                                                                                                                                                                        this.backoff && this.backoff.setJitter(v);
                                                                                                                                                                                                        return this;
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 227..232
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 249..254

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

                                                                                                                                                                                                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

                                                                                                                                                                                                    Manager.prototype.reconnectionDelay = function(v){
                                                                                                                                                                                                        if (!arguments.length) return this._reconnectionDelay;
                                                                                                                                                                                                        this._reconnectionDelay = v;
                                                                                                                                                                                                        this.backoff && this.backoff.setMin(v);
                                                                                                                                                                                                        return this;
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 234..239
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 249..254

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

                                                                                                                                                                                                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

                                                                                                                                                                                                                            result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]";
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 6450..6450

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

                                                                                                                                                                                                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

                                                                                                                                                                                                                            result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}";
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 6433..6433

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

                                                                                                                                                                                                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 && (('wss' == schema && this.port != 443)
                                                                                                                                                                                                            || ('ws' == schema && this.port != 80))) {
                                                                                                                                                                                                            port = ':' + this.port;
                                                                                                                                                                                                        }
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3244..3247

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

                                                                                                                                                                                                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 && this.port != 443) ||
                                                                                                                                                                                                            ('http' == schema && this.port != 80))) {
                                                                                                                                                                                                            port = ':' + this.port;
                                                                                                                                                                                                        }
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3452..3455

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

                                                                                                                                                                                                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 client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3861..3865

                                                                                                                                                                                                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.names.length; i < len; i++) {
                                                                                                                                                                                                            if (exports.names[i].test(name)) {
                                                                                                                                                                                                                return true;
                                                                                                                                                                                                            }
                                                                                                                                                                                                        }
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3856..3860

                                                                                                                                                                                                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 (var i = 0, len = debug.skips.length; i < len; i++) {
                                                                                                                                                                                                            if (debug.skips[i].test(name)) {
                                                                                                                                                                                                                return false;
                                                                                                                                                                                                            }
                                                                                                                                                                                                        }
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 1483..1487

                                                                                                                                                                                                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 (var i = 0, len = debug.names.length; i < len; i++) {
                                                                                                                                                                                                            if (debug.names[i].test(name)) {
                                                                                                                                                                                                                return true;
                                                                                                                                                                                                            }
                                                                                                                                                                                                        }
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 1478..1482

                                                                                                                                                                                                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

                                                                                                                                                                                                    Manager.prototype.reconnectionAttempts = function(v){
                                                                                                                                                                                                        if (!arguments.length) return this._reconnectionAttempts;
                                                                                                                                                                                                        this._reconnectionAttempts = v;
                                                                                                                                                                                                        return this;
                                                                                                                                                                                                    };
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 263..267

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

                                                                                                                                                                                                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 (hasMembers) {
                                                                                                                                                                                                                                    if (value == ",") {
                                                                                                                                                                                                                                        value = lex();
                                                                                                                                                                                                                                        if (value == "]") {
                                                                                                                                                                                                                                            // Unexpected trailing `,` in array literal.
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 6729..6740

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

                                                                                                                                                                                                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 (hasMembers) {
                                                                                                                                                                                                                                    if (value == ",") {
                                                                                                                                                                                                                                        value = lex();
                                                                                                                                                                                                                                        if (value == "}") {
                                                                                                                                                                                                                                            // Unexpected trailing `,` in object literal.
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 6699..6710

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

                                                                                                                                                                                                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

                                                                                                                                                                                                    Manager.prototype.timeout = function(v){
                                                                                                                                                                                                        if (!arguments.length) return this._timeout;
                                                                                                                                                                                                        this._timeout = v;
                                                                                                                                                                                                        return this;
                                                                                                                                                                                                    };
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 213..217

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

                                                                                                                                                                                                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 client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3106..3113

                                                                                                                                                                                                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 client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 3097..3104

                                                                                                                                                                                                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

                                                                                                                                                                                                        Request.prototype.onError = function(err){
                                                                                                                                                                                                            this.emit('error', err);
                                                                                                                                                                                                            this.cleanup();
                                                                                                                                                                                                        };
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 2891..2894

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

                                                                                                                                                                                                        Request.prototype.onData = function(data){
                                                                                                                                                                                                            this.emit('data', data);
                                                                                                                                                                                                            this.onSuccess();
                                                                                                                                                                                                        };
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 2902..2905

                                                                                                                                                                                                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

                                                                                                                                                                                                                    for (var i = 0; i < data.length; i++) {
                                                                                                                                                                                                                        data[i] = _reconstructPacket(data[i]);
                                                                                                                                                                                                                    }
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 2 other locations - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 4483..4485
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 5423..5425

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

                                                                                                                                                                                                                    for (var i = 0; i < data.length; i++) {
                                                                                                                                                                                                                        newData[i] = _deconstructPacket(data[i]);
                                                                                                                                                                                                                    }
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 2 other locations - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 4483..4485
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 5460..5462

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

                                                                                                                                                                                                                    for (var i = 0; i < lenStr.length; i++) {
                                                                                                                                                                                                                        lengthAry[i] = parseInt(lenStr[i]);
                                                                                                                                                                                                                    }
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 2 other locations - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 5423..5425
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 5460..5462

                                                                                                                                                                                                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 < encoded.length; i++) {
                                                                                                                                                                                                                            view[i] = encoded.charCodeAt(i);
                                                                                                                                                                                                                        }
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 4431..4433

                                                                                                                                                                                                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 client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 4470..4472

                                                                                                                                                                                                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 client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 30 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 2518..2521

                                                                                                                                                                                                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 client/cat3/customlib/socket.io/socket.io.js and 1 other location - About 30 mins to fix
                                                                                                                                                                                                client/cat3/customlib/socket.io/socket.io.js on lines 2542..2545

                                                                                                                                                                                                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