socketstream/socketstream

View on GitHub

Showing 270 of 270 total issues

File index.js has 424 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Client-Side Bundler of assets in development and production
'use strict';

var fs = require('fs'),
    path = require('path'),
Severity: Minor
Found in lib/client/bundler/index.js - About 6 hrs to fix

    Function generate has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.generate = function(program) {
    
      var appjs,
          codeExtension = program.coffee && 'coffee' || 'js',
          selectedFormatters = [],
    Severity: Major
    Found in lib/cli/generate.js - About 5 hrs to fix

      Function tabbable has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

      directive.tabbable = function() {
        return {
          restrict: 'C',
          compile: function(element) {
            var navTabs = angular.element('<ul class="nav nav-tabs"></ul>'),
      Severity: Minor
      Found in docs/js/angular-bootstrap.js - About 5 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

              users: function() {
                var users = arguments[0] instanceof Array? arguments[0] : [arguments[0]],
                    event = arguments[1],
                    params = (3 <= arguments.length ? __slice.call(arguments, 2) : []),
                    obj = {
      Severity: Major
      Found in lib/publish/index.js and 1 other location - About 5 hrs to fix
      lib/publish/index.js on lines 83..95

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

      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

              channels: function() {
                var channels = arguments[0] instanceof Array? arguments[0] : [arguments[0]],
                    event = arguments[1],
                    params = (3 <= arguments.length ? __slice.call(arguments, 2) : []),
                    obj = {
      Severity: Major
      Found in lib/publish/index.js and 1 other location - About 5 hrs to fix
      lib/publish/index.js on lines 59..71

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

      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 140 lines of code (exceeds 25 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: Major
      Found in lib/client/index.js - About 5 hrs to fix

        Function exports has a Cognitive Complexity of 36 (exceeds 5 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: Minor
        Found in lib/client/template_engine.js - About 5 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 tok has 129 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Parser.prototype.tok = function() {
          switch (this.token.type) {
            case 'space': {
              return '';
            }
        Severity: Major
        Found in docs/js/marked.js - About 5 hrs to fix

          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

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

                function locals() {
                  var result = {}, k;
              
                  // mixin system locals
                  for(k in system.assets.locals) {
              Severity: Major
              Found in lib/client/bundler/proto.js and 1 other location - About 4 hrs to fix
              lib/client/bundler/proto.js on lines 221..239

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

              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

                function constants() {
                  var result = {}, k;
              
                  // mixin system constants
                  for(k in system.assets.constants) {
              Severity: Major
              Found in lib/client/bundler/proto.js and 1 other location - About 4 hrs to fix
              lib/client/bundler/proto.js on lines 241..259

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

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

                      Severity
                      Category
                      Status
                      Source
                      Language