socketstream/socketstream

View on GitHub

Showing 206 of 270 total issues

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

    Request.prototype.create = function () {
      var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };

      // SSL options for Node.js client
      opts.pfx = this.pfx;
Severity: Major
Found in lib/websocket/transports/engineio/client.js - About 3 hrs to fix

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

    module.exports = function(responderId, config, ss) {
      var code, name;
      name = config && config.name || 'rpc';
    
      // Serve client code  
    Severity: Major
    Found in lib/request/responders/rpc/index.js - About 3 hrs to fix

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

      module.exports = function(ss, router, options) {
      
        return {
          plan: function(args) {
            var plan = {}, httpServer = args[0];
      Severity: Major
      Found in lib/tasks/index.js - About 2 hrs to fix

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

        module.exports = function() {
          return {
            transport: require('./transport')(),
        
            /**
        Severity: Minor
        Found in lib/publish/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 a Cognitive Complexity of 21 (exceeds 5 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: Minor
        Found in lib/tasks/live_reload.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 Socket has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function Socket(uri, opts) {
              if (!(this instanceof Socket)) return new Socket(uri, opts);
        
              opts = opts || {};
        
        
        Severity: Major
        Found in lib/websocket/transports/engineio/client.js - About 2 hrs to fix

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

              function allowAnywhereFoldCaseAndRenumberGroups(regex) {
                // Split into character sets, escape sequences, punctuation strings
                // like ('(', '(?:', ')', '^'), and runs of characters that do not
                // include any of the above.
                var parts = regex.source.match(
          Severity: Major
          Found in docs/js/google-code-prettify.js - About 2 hrs to fix

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

            module.exports = function(ss, middleware) {
              var api, dir, request;
              dir = pathlib.join(ss.root, 'server/rpc');
              api = apiTree.createApiTree(dir);
              return (request = function(req, res) {
            Severity: Major
            Found in lib/request/responders/rpc/request.js - About 2 hrs to fix

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

              module.exports = function(ss) {
              /*
               * Require a module by id that is located.
               * - builtin module in context
               * - module relative to app.js
              Severity: Minor
              Found in lib/utils/require.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 controller has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  controller: ['$scope', '$element', function($scope, $element) {
                    var navTabs = $element.contents().eq(0),
                        ngModel = $element.controller('ngModel') || {},
                        tabs = [],
                        selectedTab;
              Severity: Major
              Found in docs/js/angular-bootstrap.js - About 2 hrs to fix

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

                  EventEmitter.prototype.emit = function() {
                    this._events || init.call(this);
                
                    var type = arguments[0];
                
                
                Severity: Major
                Found in lib/client/system/modules/eventemitter2.js - About 2 hrs to fix

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

                  module.exports = function(ss, messageEmitter, httpServer, config, sessionOptions){
                    config = config || {};
                    config.server = config.server || {};
                    config.client = config.client || {};
                  
                  
                  Severity: Major
                  Found in lib/websocket/transports/engineio/index.js - About 2 hrs to fix

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

                        var decorate = function (job) {
                          var sourceCode = job.sourceCode, basePos = job.basePos;
                          /** Even entries are positions in source in ascending order.  Odd enties
                            * are style markers (e.g., PR_COMMENT) that run from that position until
                            * the end.
                    Severity: Major
                    Found in docs/js/google-code-prettify.js - About 2 hrs to fix

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

                          interfaces: function(middleware) {
                      
                            // Get request handler      
                            var request;
                            request = require('./request')(ss, middleware);
                      Severity: Major
                      Found in lib/request/responders/rpc/index.js - About 2 hrs to fix

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

                        module.exports = function(ss, messageEmitter, httpServer, config, sessionOptions){
                          config = config || {};
                          config.server = config.server || {};
                          config.client = config.client || {};
                        
                        
                        Severity: Minor
                        Found in lib/websocket/transports/engineio/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 marked has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function marked(src, opt, callback) {
                          if (callback || typeof opt === 'function') {
                            if (!callback) {
                              callback = opt;
                              opt = null;
                        Severity: Major
                        Found in docs/js/marked.js - About 2 hrs to fix

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

                          module.exports = function() {
                            return {
                              transport: require('./transport')(),
                          
                              /**
                          Severity: Major
                          Found in lib/publish/index.js - About 2 hrs to fix

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

                                entries: function entries(client, assetType) {
                            
                                  var _entries = [],
                                      bundler = getBundler(client),
                                      includeType,
                            Severity: Major
                            Found in lib/client/bundler/index.js - About 2 hrs to fix

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

                                  function doWork() {
                                    var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ?
                                                   clock['now']() + 250 /* ms */ :
                                                   Infinity);
                                    for (; k < elements.length && clock['now']() < endTime; k++) {
                              Severity: Major
                              Found in docs/js/google-code-prettify.js - About 2 hrs to fix

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

                                  $scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) {
                                    var parts = path.split('/'),
                                      sectionId = parts[1],
                                      partialId = parts[2],
                                      page, sectionName = $scope.sections[(NG_DOCS.html5Mode ? '' : '#/') + sectionId];
                                Severity: Major
                                Found in docs/js/docs.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language