socketstream/socketstream

View on GitHub

Showing 206 of 270 total issues

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

module.exports = function(ss,client,options){

  var bundler = ss.bundler.create({
    define: define,
    asset: asset
Severity: Minor
Found in lib/client/bundler/production.js - About 1 hr to fix

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

        connect: function(){
          var sock = new eio.Socket(config);
    
          sock.on('message', function(e) {
            var i, x, msg = e;
    Severity: Minor
    Found in lib/websocket/transports/engineio/wrapper.js - About 1 hr to fix

      Function reindentCode has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      service.reindentCode = function() {
        return function (text, spaces) {
          if (!text) return text;
          var lines = text.split(/\r?\n/);
          var prefix = '      '.substr(0, spaces || 0);
      Severity: Minor
      Found in docs/js/angular-bootstrap-prettify.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function exports has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function(ss, router, options, orchestrator) {
      
        return function(plan) {
      
          plan = plan || {};
      Severity: Minor
      Found in lib/tasks/defaults.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

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

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

                websocket: function(msg, meta, send) {
                  var handleError, msgLogName, req;
        
                  // RPC responder uses JSON both ways          
                  msg = JSON.parse(msg);
        Severity: Minor
        Found in lib/request/responders/rpc/index.js - About 1 hr to fix

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

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

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

            directive.jsFiddle = function(getEmbeddedTemplate, escape, script) {
              return {
                terminal: true,
                link: function(scope, element, attr) {
                  var name = '',
            Severity: Minor
            Found in docs/js/angular-bootstrap-prettify.js - About 1 hr to fix

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

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

                Function exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function(ss, clients, options) {
                
                  // Append the 'serveClient' method to the HTTP Response object  
                  res.serveClient = function(name) {
                    var self = this;
                Severity: Minor
                Found in lib/client/http.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function(ss,options) {
                  var mods = [];
                  return {
                    /**
                     * @ngdoc method
                Severity: Minor
                Found in lib/client/formatters.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                exports.UniqueSet = (function() {
                
                  function UniqueSet() {
                    this.data = {};
                  }
                Severity: Minor
                Found in lib/utils/unique_set.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

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

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

                        link: function(scope, element, attr) {
                          var name = '',
                            stylesheet = '<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">\n',
                            fields = {
                              html: '',
                    Severity: Minor
                    Found in docs/js/angular-bootstrap-prettify.js - About 1 hr to fix

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

                      directive.syntax = function() {
                        return {
                          restrict: 'A',
                          link: function(scope, element, attrs) {
                            function makeLink(type, text, link, icon) {
                      Severity: Minor
                      Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                        docsApp.serviceFactory.openPlunkr = function(templateMerge, formPostData, loadedUrls) {
                          return function(content) {
                            var allFiles = [].concat(content.js, content.css, content.html);
                            var indexHtmlContent = '<!doctype html>\n' +
                                '<html ng-app="{{module}}">\n' +
                        Severity: Minor
                        Found in docs/js/docs.js - About 1 hr to fix

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

                            function extractSourceSpans(node, isPreformatted) {
                              var nocode = /(?:^|\s)nocode(?:\s|$)/;
                            
                              var chunks = [];
                              var length = 0;
                          Severity: Minor
                          Found in docs/js/google-code-prettify.js - About 1 hr to fix

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

                                  this.addPane = function(element, attr) {
                                    var li = angular.element('<li><a href></a></li>'),
                                        a = li.find('a'),
                                        tab = {
                                          paneElement: element,
                            Severity: Minor
                            Found in docs/js/angular-bootstrap.js - About 1 hr to fix

                              Function exports has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                              module.exports = function(session, socketId) {
                                return {
                              
                                  // Lists all the channels the client is currently subscribed to    
                                  list: function() {
                              Severity: Minor
                              Found in lib/session/channels.js - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

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

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