benjamine/resource-shadow

View on GitHub

Showing 88 of 160 total issues

Function 2 has a Cognitive Complexity of 856 (exceeds 5 allowed). Consider refactoring.
Open

},{"./util/globals":7,"./util/mocks/http-handler":8,"./util/mocks/local-storage":9}],2:[function(require,module,exports){
(function (Buffer){
(function (global, module) {

  var exports = module.exports;
Severity: Minor
Found in public/build/test-bundle.js - About 2 wks 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 3 has a Cognitive Complexity of 386 (exceeds 5 allowed). Consider refactoring.
Open

},{"buffer":3}],3:[function(require,module,exports){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
Severity: Minor
Found in public/build/test-bundle.js - About 1 wk 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 test-bundle.js has 2263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
* mocha's bdd syntax is inspired in RSpec
*   please read: http://betterspecs.org/
*/
Severity: Major
Found in public/build/test-bundle.js - About 6 days to fix

    Function 3 has 840 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"buffer":3}],3:[function(require,module,exports){
    /*!
     * The buffer module from node.js, for the browser.
     *
     * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
    Severity: Major
    Found in public/build/test-bundle.js - About 4 days to fix

      Function 2 has 808 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"./util/globals":7,"./util/mocks/http-handler":8,"./util/mocks/local-storage":9}],2:[function(require,module,exports){
      (function (Buffer){
      (function (global, module) {
      
        var exports = module.exports;
      Severity: Major
      Found in public/build/test-bundle.js - About 4 days to fix

        Function 1 has 368 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
        /*
        * mocha's bdd syntax is inspired in RSpec
        *   please read: http://betterspecs.org/
        */
        Severity: Major
        Found in public/build/test-bundle.js - About 1 day to fix

          Function 6 has 347 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"_process":2}],6:[function(require,module,exports){
          var microee = require('microee');
          var defaultHttpHandler;
          var defaultLocalStorageObserver;
          
          
          Severity: Major
          Found in public/build/resource-shadow.js - About 1 day to fix

            File resource-shadow.js has 538 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self),o.resourceShadow=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
            (function (process){
            
            // global exports
            
            
            Severity: Major
            Found in public/build/resource-shadow.js - About 1 day to fix

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

              },{}],5:[function(require,module,exports){
              exports.read = function(buffer, offset, isLE, mLen, nBytes) {
                var e, m,
                    eLen = nBytes * 8 - mLen - 1,
                    eMax = (1 << eLen) - 1,
              Severity: Minor
              Found in public/build/test-bundle.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

              Function json has 164 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var json = (function () {
                  "use strict";
              
                  if ('object' == typeof JSON && JSON.parse && JSON.stringify) {
                    return {
              Severity: Major
              Found in public/build/test-bundle.js - About 6 hrs to fix

                Function i has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function i (obj, showHidden, depth) {
                    var seen = [];
                
                    function stylize (str) {
                      return str;
                Severity: Major
                Found in public/build/test-bundle.js - About 6 hrs to fix

                  Function format has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function format (value, recurseTimes) {
                        // Provide a hook for user-specified inspect functions.
                        // Check that value is an object with an inspect function on it
                        if (value && typeof value.inspect === 'function' &&
                            // Filter out the util module, it's inspect function is special
                  Severity: Major
                  Found in public/build/test-bundle.js - About 5 hrs to fix

                    File resource-shadow.js has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    var microee = require('microee');
                    var defaultHttpHandler;
                    var defaultLocalStorageObserver;
                    
                    function ResourceShadow(options) {
                    Severity: Minor
                    Found in src/resource-shadow.js - About 4 hrs to fix

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

                      },{"base64-js":4,"ieee754":5,"is-array":6}],4:[function(require,module,exports){
                      var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
                      
                      ;(function (exports) {
                          'use strict';
                      Severity: Major
                      Found in public/build/test-bundle.js - About 3 hrs to fix

                        Function 5 has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        },{}],5:[function(require,module,exports){
                        exports.read = function(buffer, offset, isLE, mLen, nBytes) {
                          var e, m,
                              eLen = nBytes * 8 - mLen - 1,
                              eMax = (1 << eLen) - 1,
                        Severity: Major
                        Found in public/build/test-bundle.js - About 2 hrs to fix

                          Function processJsonFromServer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                          ResourceShadow.prototype.processJsonFromServer = function(serverJson, preJson) {
                            this.shadow = serverJson;
                            var currentLocalJson = this.localStorage.getItem(this.localKey);
                          
                            if (serverJson !== preJson) {
                          Severity: Minor
                          Found in src/resource-shadow.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 mirrorObject has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                          ResourceShadow.prototype.mirrorObject = function(source, target) {
                            var self = this;
                            if (typeof source !== 'object' || source === null || typeof target !== 'object' || target === null) {
                              return false;
                            }
                          Severity: Minor
                          Found in src/resource-shadow.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 str has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function str(key, holder) {
                          
                            // Produce a string from holder[key].
                          
                                  var i,          // The loop counter.
                          Severity: Major
                          Found in public/build/test-bundle.js - About 2 hrs to fix

                            Function output has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  var output = map($keys, function (key) {
                                    var name, str;
                                    if (value.__lookupGetter__) {
                                      if (value.__lookupGetter__(key)) {
                                        if (value.__lookupSetter__(key)) {
                            Severity: Major
                            Found in public/build/test-bundle.js - About 2 hrs to fix

                              Function e has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                              Open

                              (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                              Severity: Minor
                              Found in public/build/test-bundle.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

                              Severity
                              Category
                              Status
                              Source
                              Language