socketstream/socketstream

View on GitHub

Showing 270 of 270 total issues

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

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      var thisUrl = url.parse(request.url, true),
                          clientName = thisUrl.pathname.split('/')[2],
                          clientId = thisUrl.pathname.split('/')[3],
                          bundler = ss.bundler.get({ name:clientName }),
                          params = thisUrl.query, //qs.parse(thisUrl.query),
                  Severity: Major
                  Found in lib/client/serve/dev.js and 1 other location - About 3 hrs to fix
                  lib/client/serve/dev.js on lines 20..25

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 99.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      var thisUrl = url.parse(request.url, true),
                          clientName = thisUrl.pathname.split('/')[2],
                          clientId = thisUrl.pathname.split('/')[3],
                          bundler = ss.bundler.get({ name:clientName }),
                          params = thisUrl.query, //qs.parse(thisUrl.query),
                  Severity: Major
                  Found in lib/client/serve/dev.js and 1 other location - About 3 hrs to fix
                  lib/client/serve/dev.js on lines 42..47

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 99.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                    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

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                  item = {
                                    type: 'table',
                                    header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
                                    align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
                                    cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
                            Severity: Major
                            Found in docs/js/marked.js and 1 other location - About 2 hrs to fix
                            docs/js/marked.js on lines 204..209

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 91.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                  item = {
                                    type: 'table',
                                    header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
                                    align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
                                    cells: cap[3].replace(/\n$/, '').split('\n')
                            Severity: Major
                            Found in docs/js/marked.js and 1 other location - About 2 hrs to fix
                            docs/js/marked.js on lines 375..380

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 91.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language