oglimmer/ggo

View on GitHub
web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js

Summary

Maintainability
F
1 mo
Test Coverage

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

        AtmosphereRequest: function (options) {

            /**
             * {Object} Request parameters.
             *
Severity: Major
Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 wk to fix

    File atmosphere-javascript-2.3.2.js has 2578 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright 2015 Async-IO.org
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
    Severity: Major
    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 wk to fix

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

                  function _executeRequest(request) {
                      var rq = _request;
                      if ((request != null) || (typeof (request) !== 'undefined')) {
                          rq = request;
                      }
      Severity: Major
      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 day to fix

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

                    function _executeWebSocket(webSocketOpened) {
        
                        _response.transport = "websocket";
        
                        var location = _buildWebSocketUrl(_request.url);
        Severity: Major
        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 6 hrs to fix

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

                      function _local(request) {
                          var trace, connector, orphan, name = "atmosphere-" + request.url, connectors = {
                              storage: function () {
                                  function onstorage(event) {
                                      if (event.key === name && event.newValue) {
          Severity: Major
          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 6 hrs to fix

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

                                ajaxRequest.onreadystatechange = function () {
                                    _debug("ajaxRequest.onreadystatechange, new state: " + ajaxRequest.readyState);
                                    if (_abortingConnection) {
                                        _debug("onreadystatechange has been ignored due to _abortingConnection flag");
                                        return;
            Severity: Major
            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 5 hrs to fix

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

                          function share() {
                              var storageService, name = "atmosphere-" + _request.url, servers = {
                                  // Powered by the storage event and the localStorage
                                  // http://www.w3.org/TR/webstorage/#event-storage
                                  storage: function () {
              Severity: Major
              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

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

                            function _configureIE(request) {
                                var rq = _request;
                                if ((request != null) && (typeof (request) !== 'undefined')) {
                                    rq = request;
                                }
                Severity: Major
                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

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

                              function _jsonp(request) {
                                  // When CORS is enabled, make sure we force the proper transport.
                                  request.transport = "jsonp";
                  
                                  var rq = _request, script;
                  Severity: Major
                  Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

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

                                function _executeSSE(sseOpened) {
                    
                                    _response.transport = "sse";
                    
                                    var location = _buildSSEUrl();
                    Severity: Major
                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

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

                                  function _configureXDR(request) {
                                      var rq = _request;
                                      if ((request != null) && (typeof (request) !== 'undefined')) {
                                          rq = request;
                                      }
                      Severity: Major
                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 3 hrs to fix

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

                                            open: function () {
                                                var callback = "atmosphere" + (++guid);
                        
                                                function _reconnectOnFailure() {
                                                    rq.lastIndex = 0;
                        Severity: Major
                        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 3 hrs to fix

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

                                              open: function () {
                                                  var iframe = doc.createElement("iframe");
                          
                                                  url = _attachHeaders(rq);
                                                  if (rq.data !== '') {
                          Severity: Major
                          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 3 hrs to fix

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

                                        function _f(response, f) {
                                            switch (response.state) {
                                                case "messageReceived":
                                                    _debug("Firing onMessage");
                                                    _requestCount = 0;
                            Severity: Major
                            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 2 hrs to fix

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

                                              _websocket.onclose = function (message) {
                                                  _debug("websocket.onclose");
                                                  clearTimeout(_request.id);
                                                  if (_response.state === 'closed')
                                                      return;
                              Severity: Major
                              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 2 hrs to fix

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

                                        stringifyJSON: function (value) {
                                            var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, meta = {
                                                '\b': '\\b',
                                                '\t': '\\t',
                                                '\n': '\\n',
                                Severity: Major
                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 2 hrs to fix

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

                                              function _invokeCallback() {
                                                  var call = function (index, func) {
                                                      func(_response);
                                                  };
                                  
                                  
                                  Severity: Minor
                                  Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                function _handleProtocol(request, message) {
                                    
                                                    var nMessage = message;
                                                    if (request.transport === 'polling') return nMessage;
                                    
                                    
                                    Severity: Minor
                                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                  function _doRequest(ajaxRequest, request, create) {
                                                      // Prevent Android to cache request
                                                      var url = request.url;
                                                      if (request.dispatchUrl != null && request.method === 'POST') {
                                                          url += request.dispatchUrl;
                                      Severity: Minor
                                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                    return window.JSON && window.JSON.stringify ? window.JSON.stringify(value) : (function str(key, holder) {
                                                        var i, v, len, partial, value = holder[key], type = typeof value;
                                        
                                                        if (value && typeof value === "object" && typeof value.toJSON === "function") {
                                                            value = value.toJSON(key);
                                        Severity: Minor
                                        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                              windowref: function () {
                                                                  // Internet Explorer raises an invalid argument error
                                                                  // when calling the window.open method with the name containing non-word characters
                                                                  var neim = name.replace(/\W/g, ""), container = document.getElementById(neim), win;
                                          
                                          
                                          Severity: Minor
                                          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                        function _execute() {
                                                            // Shared across multiple tabs/windows.
                                                            if (_request.shared) {
                                                                _localStorageService = _local(_request);
                                                                if (_localStorageService != null) {
                                            Severity: Minor
                                            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                          function _trackMessageSize(message, request, response) {
                                                              message = _handleProtocol(request, message);
                                                              if (message.length === 0)
                                                                  return true;
                                              
                                              
                                              Severity: Minor
                                              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                    storage: function () {
                                                                        function onstorage(event) {
                                                                            if (event.key === name && event.newValue) {
                                                                                listener(event.newValue);
                                                                            }
                                                Severity: Minor
                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                          function poll() {
                                                                              var url = rq.url;
                                                                              if (rq.dispatchUrl != null) {
                                                                                  url += rq.dispatchUrl;
                                                                              }
                                                  Severity: Minor
                                                  Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                            each: function (obj, callback, args) {
                                                                if (!obj) return;
                                                                var value, i = 0, length = obj.length, isArray = atmosphere.util.isArray(obj);
                                                    
                                                                if (args) {
                                                    Severity: Minor
                                                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                  function _attachHeaders(request, url) {
                                                                      var rq = _request;
                                                                      if ((request != null) && (typeof (request) !== 'undefined')) {
                                                                          rq = request;
                                                                      }
                                                      Severity: Minor
                                                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                    function _clearState() {
                                                                        _response.partialMessage = "";
                                                                        if (_request.id) {
                                                                            clearTimeout(_request.id);
                                                                        }
                                                        Severity: Minor
                                                        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                      function _getPushRequest(message) {
                                                                          var msg = _getStringMessage(message);
                                                          
                                                                          var rq = {
                                                                              connected: false,
                                                          Severity: Minor
                                                          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                                storage: function () {
                                                                                    function onstorage(event) {
                                                                                        // When a deletion, newValue initialized to null
                                                                                        if (event.key === name && event.newValue) {
                                                                                            listener(event.newValue);
                                                            Severity: Minor
                                                            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                              _sse.onerror = function (message) {
                                                                                  _debug("sse.onerror");
                                                                                  clearTimeout(_request.id);
                                                              
                                                                                  if (_request.heartbeatTimer) {
                                                              Severity: Minor
                                                              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                                function listener(string) {
                                                                                    var command = atmosphere.util.parseJSON(string), data = command.data;
                                                                
                                                                                    if (command.target === "c") {
                                                                                        switch (command.type) {
                                                                Severity: Minor
                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                              function _disconnect() {
                                                                                  if (_request.enableProtocol && !_request.disableDisconnect && !_request.firstMessage) {
                                                                                      var query = "X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=" + _request.uuid;
                                                                  
                                                                                      atmosphere.util.each(_request.headers, function (name, value) {
                                                                  Severity: Minor
                                                                  Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                            WebsocketApiAdapter: function (request) {
                                                                                var _socket, _adapter;
                                                                    
                                                                                /**
                                                                                 * Overrides the onMessage callback in given request.
                                                                    Severity: Minor
                                                                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                              param: function (params) {
                                                                                  var prefix, s = [];
                                                                      
                                                                                  function add(key, value) {
                                                                                      value = atmosphere.util.isFunction(value) ? value() : (value == null ? "" : value);
                                                                      Severity: Minor
                                                                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

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

                                                                                            windowref: function () {
                                                                                                var win = window.open("", name.replace(/\W/g, ""));
                                                                        
                                                                                                if (!win || win.closed || !win.callbacks) {
                                                                                                    return;
                                                                        Severity: Minor
                                                                        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 hr to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                                  if (_response.status !== 500 && ajaxRequest.responseText.length > rq.lastIndex) {
                                                                                                                      try {
                                                                                                                          _response.status = ajaxRequest.status;
                                                                                                                          _response.headers = atmosphere.util.parseHeaders(ajaxRequest.getAllResponseHeaders());
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                                    if (data.heir === guid) {
                                                                                                                        _execute();
                                                                                                                    } else {
                                                                                                                        setTimeout(function () {
                                                                                                                            _execute();
                                                                            Severity: Major
                                                                            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                                      if (!_response.ffTryingReconnect) {
                                                                                                                          _triggerOpen(rq);
                                                                                                                      }
                                                                              Severity: Major
                                                                              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                                        if (v) {
                                                                                                                            partial.push(quote(i) + ":" + v);
                                                                                                                        }
                                                                                Severity: Major
                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                                      if (skipCallbackInvocation) {
                                                                                                                          return;
                                                                                                                      }
                                                                                  Severity: Major
                                                                                  Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 45 mins to fix

                                                                                    Consider simplifying this complex logical expression.
                                                                                    Open

                                                                                                                    if (!cdoc.body || !cdoc.body.firstChild || cdoc.body.firstChild.nodeName.toLowerCase() !== "pre") {
                                                                                                                        // Injects a plaintext element which renders text without interpreting the HTML and cannot be stopped
                                                                                                                        // it is deprecated in HTML5, but still works
                                                                                                                        var head = cdoc.head || cdoc.getElementsByTagName("head")[0] || cdoc.documentElement || cdoc;
                                                                                                                        var script = cdoc.createElement("script");
                                                                                    Severity: Major
                                                                                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 40 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                                              return;
                                                                                      Severity: Major
                                                                                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                    return false;
                                                                                        Severity: Major
                                                                                        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                                          return;
                                                                                          Severity: Major
                                                                                          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                            return true;
                                                                                            Severity: Major
                                                                                            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                                  return false;
                                                                                              Severity: Major
                                                                                              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 30 mins to fix

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

                                                                                                                    atmosphere.util.each(_request.headers, function (name, value) {
                                                                                                                        var h = atmosphere.util.isFunction(value) ? value.call(this, _request, _request, _response) : value;
                                                                                                                        if (h != null) {
                                                                                                                            query += "&" + encodeURIComponent(name) + "=" + encodeURIComponent(h);
                                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 3 hrs to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 1806..1811

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

                                                                                                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

                                                                                                                atmosphere.util.each(rq.headers, function (name, value) {
                                                                                                                    var h = atmosphere.util.isFunction(value) ? value.call(this, rq, request, _response) : value;
                                                                                                                    if (h != null) {
                                                                                                                        url += "&" + encodeURIComponent(name) + "=" + encodeURIComponent(h);
                                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 3 hrs to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 433..438

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

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

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

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

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

                                                                                                Refactorings

                                                                                                Further Reading

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

                                                                                                                            try {
                                                                                                                                _response.status = ajaxRequest.status;
                                                                                                                                _response.headers = atmosphere.util.parseHeaders(ajaxRequest.getAllResponseHeaders());
                                                                                                
                                                                                                                                _readHeaders(ajaxRequest, rq);
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 2 hrs to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 2052..2060

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 78.

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

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

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

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

                                                                                                Refactorings

                                                                                                Further Reading

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

                                                                                                                                            try {
                                                                                                                                                _response.status = ajaxRequest.status;
                                                                                                                                                _response.headers = atmosphere.util.parseHeaders(ajaxRequest.getAllResponseHeaders());
                                                                                                
                                                                                                                                                _readHeaders(ajaxRequest, _request);
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 2 hrs to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 2088..2095

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 78.

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

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

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

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

                                                                                                Refactorings

                                                                                                Further Reading

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

                                                                                                                        if (rq.connectTimeout > 0) {
                                                                                                                            rq.id = setTimeout(function () {
                                                                                                                                if (rq.requestCount === 0) {
                                                                                                                                    _clearState();
                                                                                                                                    _prepareCallback("Connect timeout", "closed", 200, rq.transport);
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 2 hrs to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 2163..2170

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

                                                                                                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 (request.connectTimeout > 0) {
                                                                                                                        request.id = setTimeout(function () {
                                                                                                                            if (request.requestCount === 0) {
                                                                                                                                _clearState();
                                                                                                                                _prepareCallback("Connect timeout", "closed", 200, request.transport);
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 2 hrs to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 2358..2365

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

                                                                                                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

                                                                                                                            signal: function (type, data) {
                                                                                                                                if (!win.closed && win.fire) {
                                                                                                                                    win.fire(atmosphere.util.stringifyJSON({
                                                                                                                                        target: "p",
                                                                                                                                        type: type,
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 1 hr to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 934..942

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

                                                                                                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

                                                                                                                            signal: function (type, data) {
                                                                                                                                if (!win.closed && win.fire) {
                                                                                                                                    win.fire(atmosphere.util.stringifyJSON({
                                                                                                                                        target: "c",
                                                                                                                                        type: type,
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 1 hr to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 721..729

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

                                                                                                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

                                                                                                        on: function (elem, type, fn) {
                                                                                                            if (elem.addEventListener) {
                                                                                                                elem.addEventListener(type, fn, false);
                                                                                                            } else if (elem.attachEvent) {
                                                                                                                elem.attachEvent("on" + type, fn);
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 1 hr to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 3245..3251

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

                                                                                                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

                                                                                                        off: function (elem, type, fn) {
                                                                                                            if (elem.removeEventListener) {
                                                                                                                elem.removeEventListener(type, fn, false);
                                                                                                            } else if (elem.detachEvent) {
                                                                                                                elem.detachEvent("on" + type, fn);
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 1 hr to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 3238..3244

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

                                                                                                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 (rq.reconnectInterval > 0) {
                                                                                                                                            rq.reconnectId = setTimeout(function () {
                                                                                                                                                _ieStreaming(rq);
                                                                                                                                            }, rq.reconnectInterval);
                                                                                                                                        } else {
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 1 hr to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 2499..2505

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

                                                                                                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 (rq.reconnectInterval > 0) {
                                                                                                                                        rq.reconnectId = setTimeout(function () {
                                                                                                                                            _ieStreaming(rq);
                                                                                                                                        }, rq.reconnectInterval);
                                                                                                                                    } else {
                                                                                                Severity: Major
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 1 hr to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 2483..2489

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

                                                                                                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

                                                                                                                            signal: function (type, data) {
                                                                                                                                storage.setItem(name, atmosphere.util.stringifyJSON({
                                                                                                                                    target: "c",
                                                                                                                                    type: type,
                                                                                                                                    data: data
                                                                                                Severity: Minor
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 50 mins to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 689..695

                                                                                                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

                                                                                                                            signal: function (type, data) {
                                                                                                                                storage.setItem(name, atmosphere.util.stringifyJSON({
                                                                                                                                    target: "p",
                                                                                                                                    type: type,
                                                                                                                                    data: data
                                                                                                Severity: Minor
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 50 mins to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 882..888

                                                                                                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 (atmosphere.util.browser.msie && +atmosphere.util.browser.version.split(".")[0] < 10) {
                                                                                                Severity: Minor
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 35 mins to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 3421..3421

                                                                                                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

                                                                                                        if (atmosphere.util.browser.msie || (atmosphere.util.browser.mozilla && +atmosphere.util.browser.version.split(".")[0] === 1)) {
                                                                                                Severity: Minor
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 35 mins to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 1870..1870

                                                                                                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

                                                                                                                } else if (_request.transport === 'websocket') {
                                                                                                                    if (!_supportWebsocket()) {
                                                                                                                        _reconnectWithFallbackTransport("Websocket is not supported, using request.fallbackTransport (" + _request.fallbackTransport
                                                                                                                        + ")");
                                                                                                                    } else {
                                                                                                Severity: Minor
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 35 mins to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 652..659

                                                                                                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

                                                                                                                } else if (_request.transport === 'sse') {
                                                                                                                    if (!_supportSSE()) {
                                                                                                                        _reconnectWithFallbackTransport("Server Side Events(SSE) is not supported, using request.fallbackTransport ("
                                                                                                                        + _request.fallbackTransport + ")");
                                                                                                                    } else {
                                                                                                Severity: Minor
                                                                                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js and 1 other location - About 35 mins to fix
                                                                                                web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js on lines 645..659

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 46.

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

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

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

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

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                There are no issues that match your filters.

                                                                                                Category
                                                                                                Status