socketstream/socketstream

View on GitHub

Showing 206 of 270 total issues

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

    function caseFoldCharset(charSet) {
      var charsetParts = charSet.substring(1, charSet.length - 1).match(
          new RegExp(
              '\\\\u[0-9A-Fa-f]{4}'
              + '|\\\\x[0-9A-Fa-f]{2}'
Severity: Major
Found in docs/js/google-code-prettify.js - About 2 hrs to fix

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

                    function($templateCache,   $browser,  docsRootScope, $location,   $sniffer,   $animate,   $exceptionHandler) {
      return {
        terminal: true,
        link: function(scope, element, attrs) {
          var modules = ['ngAnimate'],
    Severity: Major
    Found in docs/js/angular-bootstrap-prettify.js - About 2 hrs to fix

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

      module.exports = function(serverStatus, message, config){
      
        if (JSON.stringify(config) === '{}') {
          config = { 
              secure  : document.location.protocol === "https:"
      Severity: Major
      Found in lib/websocket/transports/engineio/wrapper.js - About 2 hrs to fix

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

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

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

              api: function(transport) {
                var methods = {
          
                  /**
                   * @ngdoc function
          Severity: Major
          Found in lib/publish/index.js - About 2 hrs to fix

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

            module.exports = function(ss, options) {
            
              //set default timings
              if (!options.onChange)  {options.onChange = {};} // dubious side effect here
              if (!options.onChange.delayTime) {options.onChange.delayTime   = 100;}
            Severity: Major
            Found in lib/tasks/live_reload.js - About 2 hrs to fix

              File angular-bootstrap-prettify.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              var directive = {};
              var service = { value: {} };
              
              
              Severity: Minor
              Found in docs/js/angular-bootstrap-prettify.js - About 2 hrs to fix

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

                exports = module.exports = function serveStatic (prefix,root, options) {
                  if (!root) {
                    throw new TypeError('root path required')
                  }
                
                
                Severity: Major
                Found in lib/utils/serve-static.js - About 2 hrs to fix

                  Function UniqueSet has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.UniqueSet = (function() {
                  
                    function UniqueSet() {
                      this.data = {};
                    }
                  Severity: Minor
                  Found in lib/utils/unique_set.js - About 2 hrs 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 link has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      link: function(scope, element, attrs) {
                        var modules = ['ngAnimate'],
                            embedRootScope,
                            deregisterEmbedRootScope;
                  
                  
                  Severity: Major
                  Found in docs/js/angular-bootstrap-prettify.js - About 2 hrs to fix

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

                    module.exports = function(ss) {
                      var middleware, responderCount, responders, useDefaults;
                      middleware = require('./middleware')(ss);
                      responderCount = 0;
                      responders = {};
                    Severity: Major
                    Found in lib/request/index.js - About 2 hrs to fix

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

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

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

                          EventEmitter.prototype.off = function(type, listener) {
                            if (typeof listener !== 'function') {
                              throw new Error('removeListener only takes instances of Function');
                            }
                        
                        
                        Severity: Major
                        Found in lib/client/system/modules/eventemitter2.js - About 2 hrs to fix

                          Function find has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                          exports.find = function(sessionId, socketId, cb) {
                            return sessionStore.load(sessionId, function(err, session) {
                              // Create a new session if we don't have this sessionId in memory
                              // Note: in production you should be using Redis or another
                              // persistent store so this should rarely happen
                          Severity: Minor
                          Found in lib/session/index.js - About 2 hrs 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 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

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