socketstream/socketstream

View on GitHub

Showing 206 of 270 total issues

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

module.exports = function(ss,options) {
  var mods = [];

  // Set the Default Engine - simply wraps each template in a <script> tag
  var defaultEngine = require('./template_engines/default')(ss.root,null,options);
Severity: Major
Found in lib/client/template_engine.js - About 4 hrs to fix

    Function generate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.generate = function(program) {
    
      var appjs,
          codeExtension = program.coffee && 'coffee' || 'js',
          selectedFormatters = [],
    Severity: Minor
    Found in lib/cli/generate.js - About 4 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 32 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(root) {
      return {
        /* Return API */
        get middleware() {
          if (!app) {
    Severity: Minor
    Found in lib/http/index.js - About 4 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 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

      module.exports = function(ss) {
        // make bundler methods available for default and other implementations
        ss.bundler = require('./bundler/index')(ss,options);
      
        // extend http response API
      Severity: Minor
      Found in lib/client/index.js - About 4 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 output has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      InlineLexer.prototype.output = function(src) {
        var out = ''
          , link
          , text
          , href
      Severity: Major
      Found in docs/js/marked.js - About 4 hrs to fix

        File eventemitter2.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        ;!function(exports, undefined) {
        
          var isArray = Array.isArray ? Array.isArray : function _isArray(obj) {
            return Object.prototype.toString.call(obj) === "[object Array]";
          };
        Severity: Minor
        Found in lib/client/system/modules/eventemitter2.js - About 4 hrs to fix

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

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

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

              function updateSearch() {
                var cache = {},
                    pages = sections[$location.path().split('/')[1]],
                    modules = $scope.modules = [],
                    otherPages = $scope.pages = [],
            Severity: Major
            Found in docs/js/docs.js - About 4 hrs to fix

              Function serveStatic has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              exports = module.exports = function serveStatic (prefix,root, options) {
                if (!root) {
                  throw new TypeError('root path required')
                }
              
              
              Severity: Minor
              Found in lib/utils/serve-static.js - About 3 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 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(root) {
                return {
                  /* Return API */
                  get middleware() {
                    if (!app) {
              Severity: Major
              Found in lib/http/index.js - About 3 hrs to fix

                Function createSimpleLexer has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
                    var shortcuts = {};
                    var tokenizer;
                    (function () {
                      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
                Severity: Major
                Found in docs/js/google-code-prettify.js - About 3 hrs to fix

                  Function numberLines has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function numberLines(node, opt_startLineNum, isPreformatted) {
                      var nocode = /(?:^|\s)nocode(?:\s|$)/;
                      var lineBreak = /\r\n?|\n/;
                    
                      var document = node.ownerDocument;
                  Severity: Major
                  Found in docs/js/google-code-prettify.js - About 3 hrs to fix

                    Function prettyPrint has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function prettyPrint(opt_whenDone) {
                        function byTagName(tn) { return document.getElementsByTagName(tn); }
                        // fetch a list of nodes to rewrite
                        var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
                        var elements = [];
                    Severity: Major
                    Found in docs/js/google-code-prettify.js - About 3 hrs to fix

                      Function popoverElement has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var popoverElement = function() {
                        var object = {
                          init : function() {
                            this.element = angular.element(
                              '<div class="popover popover-incode top">' +
                      Severity: Major
                      Found in docs/js/angular-bootstrap.js - About 3 hrs to fix

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

                        module.exports = function(ss, router, options) {
                        
                          return {
                            plan: function(args) {
                              var plan = {}, httpServer = args[0];
                        Severity: Minor
                        Found in lib/tasks/index.js - About 3 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 probe has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            Socket.prototype.probe = function (name) {
                              debug('probing transport "%s"', name);
                              var transport = this.createTransport(name, { probe: 1 });
                              var failed = false;
                              var self = this;
                        Severity: Major
                        Found in lib/websocket/transports/engineio/client.js - About 3 hrs to fix

                          Function recombineTagsAndDecorations has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function recombineTagsAndDecorations(job) {
                              var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
                              isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8;
                              var newlineRe = /\n/g;
                            
                          Severity: Major
                          Found in docs/js/google-code-prettify.js - About 3 hrs to fix

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

                              function sourceDecorator(options) {
                                var shortcutStylePatterns = [], fallthroughStylePatterns = [];
                                if (options['tripleQuotedStrings']) {
                                  // '''multi-line-string''', 'single-line-string', and double-quoted
                                  shortcutStylePatterns.push(
                            Severity: Major
                            Found in docs/js/google-code-prettify.js - About 3 hrs to fix

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

                              directive.tabbable = function() {
                                return {
                                  restrict: 'C',
                                  compile: function(element) {
                                    var navTabs = angular.element('<ul class="nav nav-tabs"></ul>'),
                              Severity: Major
                              Found in docs/js/angular-bootstrap.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language