socketstream/socketstream

View on GitHub

Showing 270 of 270 total issues

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

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

          if (cap = this.rules.em.exec(src)) {
            src = src.substring(cap[0].length);
            out += '<em>'
              + this.output(cap[2] || cap[1])
              + '</em>';
      Severity: Major
      Found in docs/js/marked.js and 1 other location - About 2 hrs to fix
      docs/js/marked.js on lines 634..640

      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 90.

      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

      module.exports = function(ss) {
        return {
          extensions: ['js'],
          assetType: 'js',
          contentType: 'text/javascript; charset=utf-8',
      Severity: Major
      Found in lib/client/formatters/javascript.js and 1 other location - About 2 hrs to fix
      lib/client/formatters/css.js on lines 8..19

      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 90.

      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 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

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

      module.exports = function(ss) {
        return {
          extensions: ['css'],
          assetType: 'css',
          contentType: 'text/css',
      Severity: Major
      Found in lib/client/formatters/css.js and 1 other location - About 2 hrs to fix
      lib/client/formatters/javascript.js on lines 8..19

      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 90.

      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

          if (cap = this.rules.strong.exec(src)) {
            src = src.substring(cap[0].length);
            out += '<strong>'
              + this.output(cap[2] || cap[1])
              + '</strong>';
      Severity: Major
      Found in docs/js/marked.js and 1 other location - About 2 hrs to fix
      docs/js/marked.js on lines 643..649

      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 90.

      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 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

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

                      transport = (function() {
                        if (typeof nameOrModule === 'function') {
                          return nameOrModule;
                        } else {
                          modPath = './transports/' + nameOrModule;
                Severity: Major
                Found in lib/publish/transport.js and 1 other location - About 2 hrs to fix
                lib/request/index.js on lines 27..38

                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 87.

                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

                      mod = (function() {
                        if (typeof nameOrModule === 'function') {
                          return nameOrModule;
                        } else {
                          modPath = './responders/' + nameOrModule;
                Severity: Major
                Found in lib/request/index.js and 1 other location - About 2 hrs to fix
                lib/publish/transport.js on lines 19..30

                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 87.

                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 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

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

                        } else if (match = partialId.match(MODULE_FILTER)) {
                          match[1] = page.moduleName || match[1];
                          breadcrumb.push({ name: match[1], url: sectionPath + '/' + match[1] });
                          breadcrumb.push({ name: match[2] });
                        } else if (match = partialId.match(MODULE_CONTROLLER)) {
                  Severity: Major
                  Found in docs/js/docs.js and 2 other locations - About 2 hrs to fix
                  docs/js/docs.js on lines 333..354
                  docs/js/docs.js on lines 337..354

                  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 86.

                  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 3 locations. Consider refactoring.
                  Open

                        } else if (match = partialId.match(MODULE_TYPE)) {
                          match[1] = page.moduleName || match[1];
                          breadcrumb.push({ name: match[1], url: sectionPath + '/' + match[1] });
                          breadcrumb.push({ name: match[2] });
                        }  else if (match = partialId.match(MODULE_SERVICE)) {
                  Severity: Major
                  Found in docs/js/docs.js and 2 other locations - About 2 hrs to fix
                  docs/js/docs.js on lines 319..354
                  docs/js/docs.js on lines 333..354

                  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 86.

                  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 3 locations. Consider refactoring.
                  Open

                        } else if (match = partialId.match(MODULE_CUSTOM)) {
                          match[1] = page.moduleName || match[1];
                          breadcrumb.push({ name: match[1], url: sectionPath + '/' + match[1] });
                          breadcrumb.push({ name: match[3] });
                        } else if (match = partialId.match(MODULE_TYPE)) {
                  Severity: Major
                  Found in docs/js/docs.js and 2 other locations - About 2 hrs to fix
                  docs/js/docs.js on lines 319..354
                  docs/js/docs.js on lines 337..354

                  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 86.

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