socketstream/socketstream

View on GitHub

Showing 270 of 270 total issues

File client.js has 2620 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function webpackUniversalModuleDefinition(root, factory) {
    if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if(typeof define === 'function' && define.amd)
        define([], factory);
Severity: Major
Found in lib/websocket/transports/engineio/client.js - About 1 wk to fix

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

    module.exports = function(ss,options) {
    
      var proto = require('./proto')(ss, bundlers, bundlerById, options),
          compressor = uglifyjs.Compressor({warnings:false});
    
    
    Severity: Minor
    Found in lib/client/bundler/index.js - About 2 days 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

    File google-code-prettify.js has 934 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright (C) 2006 Google Inc.
    //
    // Licensed under the Apache License, Version 2.0 (the "License");
    // you may not use this file except in compliance with the License.
    // You may obtain a copy of the License at
    Severity: Major
    Found in docs/js/google-code-prettify.js - About 2 days to fix

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

        function asset(entry, opts, cb) {
          ss.bundler.loadFile(entry, opts, null,
            function(output) {
              switch(entry.bundle) {
                case 'html':
      Severity: Major
      Found in lib/client/bundler/production.js and 1 other location - About 2 days to fix
      lib/client/bundler/default.js on lines 60..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 359.

      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

        function asset(entry, opts, cb) {
          ss.bundler.loadFile(entry, opts, null,
            function(output) {
              switch(entry.bundle) {
                case 'html':
      Severity: Major
      Found in lib/client/bundler/default.js and 1 other location - About 2 days to fix
      lib/client/bundler/production.js on lines 31..66

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

      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 392 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(ss,options) {
      
        var proto = require('./proto')(ss, bundlers, bundlerById, options),
            compressor = uglifyjs.Compressor({warnings:false});
      
      
      Severity: Major
      Found in lib/client/bundler/index.js - About 1 day to fix

        File marked.js has 815 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * marked - a markdown parser
         * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
         * https://github.com/chjj/marked
         */
        Severity: Major
        Found in docs/js/marked.js - About 1 day to fix

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

          module.exports = function(ss, bundlers, bundlerById, options) {
          
            return {
              /**
               * @ngdoc method
          Severity: Minor
          Found in lib/client/bundler/proto.js - About 1 day 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

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

          function loadStaticDirs(staticPath,assetsPath) {
            /* Get a list of all static files we know about (used to prevent connect.session from loading unnecessarily) */
          
            if (fs.existsSync(staticPath)) {
              staticDirs = staticDirs.concat(fs.readdirSync(staticPath));
          Severity: Major
          Found in lib/http/minimal.strategy.js and 1 other location - About 1 day to fix
          lib/http/default.strategy.js on lines 58..83

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

          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

          function loadStaticDirs(staticPath,assetsPath) {
            /* Get a list of all static files we know about (used to prevent connect.session from loading unnecessarily) */
          
            if (fs.existsSync(staticPath)) {
              staticDirs = staticDirs.concat(fs.readdirSync(staticPath));
          Severity: Major
          Found in lib/http/default.strategy.js and 1 other location - About 1 day to fix
          lib/http/minimal.strategy.js on lines 54..79

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

          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 DocsController has 230 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          docsApp.controller.DocsController = function($scope, $location, $window, sections) {
            var INDEX_PATH = /^(\/|\/index[^\.]*.html)$/,
                GLOBALS = /^angular\.([^\.]+)$/,
                MODULE = /^([^\.]+)$/,
                MODULE_MOCK = /^angular\.mock\.([^\.]+)$/,
          Severity: Major
          Found in docs/js/docs.js - About 1 day to fix

            Function DocsController has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

            docsApp.controller.DocsController = function($scope, $location, $window, sections) {
              var INDEX_PATH = /^(\/|\/index[^\.]*.html)$/,
                  GLOBALS = /^angular\.([^\.]+)$/,
                  MODULE = /^([^\.]+)$/,
                  MODULE_MOCK = /^angular\.mock\.([^\.]+)$/,
            Severity: Minor
            Found in docs/js/docs.js - About 1 day 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

            File docs-setup.js has 526 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            NG_DOCS={
              "sections": {
                "tutorials": "Tutorials",
                "api": "API Documentation",
                "demos": "Demos"
            Severity: Major
            Found in docs/js/docs-setup.js - About 1 day to fix

              Function token has 213 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Lexer.prototype.token = function(src, top) {
                var src = src.replace(/^ +$/gm, '')
                  , next
                  , loose
                  , cap
              Severity: Major
              Found in docs/js/marked.js - About 1 day to fix

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

                module.exports = function(ss, bundlers, bundlerById, options) {
                
                  return {
                    /**
                     * @ngdoc method
                Severity: Major
                Found in lib/client/bundler/proto.js - About 7 hrs to fix

                  Function combinePrefixPatterns has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function combinePrefixPatterns(regexs) {
                      var capturedGroupIndex = 0;
                    
                      var needToFoldCase = false;
                      var ignoreCase = false;
                  Severity: Major
                  Found in docs/js/google-code-prettify.js - About 7 hrs to fix

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

                    module.exports = function(grunt) {
                        'use strict';
                    
                        var sh = require('shelljs');
                    
                    
                    Severity: Major
                    Found in Gruntfile.js - About 6 hrs to fix

                      File docs.js has 441 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      var docsApp = {
                        controller: {},
                        directive: {},
                        serviceFactory: {}
                      };
                      Severity: Minor
                      Found in docs/js/docs.js - About 6 hrs to fix

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

                              for (i = 0; i < item.align.length; i++) {
                                if (/^ *-+: *$/.test(item.align[i])) {
                                  item.align[i] = 'right';
                                } else if (/^ *:-+: *$/.test(item.align[i])) {
                                  item.align[i] = 'center';
                        Severity: Major
                        Found in docs/js/marked.js and 1 other location - About 6 hrs to fix
                        docs/js/marked.js on lines 382..392

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

                        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

                              for (i = 0; i < item.align.length; i++) {
                                if (/^ *-+: *$/.test(item.align[i])) {
                                  item.align[i] = 'right';
                                } else if (/^ *:-+: *$/.test(item.align[i])) {
                                  item.align[i] = 'center';
                        Severity: Major
                        Found in docs/js/marked.js and 1 other location - About 6 hrs to fix
                        docs/js/marked.js on lines 211..221

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

                        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