socketstream/socketstream

View on GitHub

Showing 270 of 270 total issues

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

    load: function(staticPath, assetsPath, sessionStore, sessionOptions) {
      if (!app) {
        // if ss.http.middleware isn't used before server start, no need to load it
        return;
      }
Severity: Major
Found in lib/http/index.js - About 2 hrs to fix

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

    module.exports = function(ss, router, options) {
    
      function serve(processor) {
        return function(request, response) {
          var path = utils.parseUrl(request.url);
    Severity: Major
    Found in lib/client/serve/ondemand.js - About 2 hrs to fix

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

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

        Function exports has 50 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/default.js - About 2 hrs to fix

          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 exports has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (ss, router/*, options*/) {
            
              ss.bundler.forEach(function(bundler) {
            
                router.on(bundler.dests.urls.css + '?*', serveCSS);
            Severity: Minor
            Found in lib/client/serve/dev.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 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 decodeSymbol has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

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

                          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 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 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language