18F/forest-service-prototype

View on GitHub

Showing 46 of 46 total issues

Function 1 has a Cognitive Complexity of 104 (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){
(function (global){
/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
Severity: Minor
Found in third-party/uswds-0.13.1/js/uswds.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 uswds.js has 811 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){
(function (global){
/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
Severity: Major
Found in third-party/uswds-0.13.1/js/uswds.js - About 1 day to fix

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

    },{}],2:[function(require,module,exports){
    (function( w ){
        "use strict";
    
        var Politespace = function( element ) {
    Severity: Minor
    Found in third-party/uswds-0.13.1/js/uswds.js - About 6 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 1 has 147 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){
    (function (global){
    /**
     * lodash (Custom Build) <https://lodash.com/>
     * Build: `lodash modularize exports="npm" -o ./`
    Severity: Major
    Found in third-party/uswds-0.13.1/js/uswds.js - About 5 hrs to fix

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

      forestserviceprototype/specialuseform/migrations/0013_auto_20161209_2011.py on lines 0..18

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

      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

      forestserviceprototype/specialuseform/migrations/0007_auto_20160927_1412.py on lines 0..18

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

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

      },{}],2:[function(require,module,exports){
      (function( w ){
          "use strict";
      
          var Politespace = function( element ) {
      Severity: Major
      Found in third-party/uswds-0.13.1/js/uswds.js - About 4 hrs to fix

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

        },{"../../../node_modules/politespace/src/politespace":2,"../utils/verify-jquery":24}],17:[function(require,module,exports){
        /**
         * This file defines key ECMAScript 5 methods that are used by the Standards
         * but may be missing in older browsers.
         */
        Severity: Minor
        Found in third-party/uswds-0.13.1/js/uswds.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 debounce has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function debounce(func, wait, options) {
          var lastArgs,
              lastThis,
              maxWait,
              result,
        Severity: Major
        Found in third-party/uswds-0.13.1/js/uswds.js - About 3 hrs to fix

          `` has 25 functions (exceeds 20 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){
          (function (global){
          /**
           * lodash (Custom Build) <https://lodash.com/>
           * Build: `lodash modularize exports="npm" -o ./`
          Severity: Minor
          Found in third-party/uswds-0.13.1/js/uswds.js - About 2 hrs to fix

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

            },{"../utils/select":23,"./toggle-field-mask":8}],10:[function(require,module,exports){
            var select = require('../utils/select');
            var addClass = require('../utils/add-class');
            var removeClass = require('../utils/remove-class');
            var dispatch = require('../utils/dispatch');
            Severity: Minor
            Found in third-party/uswds-0.13.1/js/uswds.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

            Accordion.prototype.show = function (button) {
              var selector = button.getAttribute('aria-controls'),
                content = this.$('#' + selector)[ 0 ];
            
              button.setAttribute('aria-expanded', true);
            Severity: Major
            Found in third-party/uswds-0.13.1/js/uswds.js and 1 other location - About 2 hrs to fix
            third-party/uswds-0.13.1/js/uswds.js on lines 580..587

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

            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

            Accordion.prototype.hide = function (button) {
              var selector = button.getAttribute('aria-controls'),
                content = this.$('#' + selector)[ 0 ];
            
              button.setAttribute('aria-expanded', false);
            Severity: Major
            Found in third-party/uswds-0.13.1/js/uswds.js and 1 other location - About 2 hrs to fix
            third-party/uswds-0.13.1/js/uswds.js on lines 593..600

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

            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 21 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            },{}],21:[function(require,module,exports){
            /**
             * Attaches a given listener function to a given element which is
             * triggered by a specified list of event types.
             * @param {HTMLElement} element - the element to which the listener will be attached
            Severity: Minor
            Found in third-party/uswds-0.13.1/js/uswds.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 25 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            },{}],25:[function(require,module,exports){
            /*
             * @name DOMLoaded
             * @param {function} cb - The callback function to run when the DOM has loaded.
             */
            Severity: Minor
            Found in third-party/uswds-0.13.1/js/uswds.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 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 third-party/uswds-0.13.1/js/uswds.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 3 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{}],3:[function(require,module,exports){
            var select = require('../utils/select');
            
            /**
             * @name showPanelListener
            Severity: Major
            Found in third-party/uswds-0.13.1/js/uswds.js - About 2 hrs to fix

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

              },{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],5:[function(require,module,exports){
              var select = require('../utils/select');
              var addClass = require('../utils/add-class');
              var removeClass = require('../utils/remove-class');
              var dispatch = require('../utils/dispatch');
              Severity: Minor
              Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

                Function 7 has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],7:[function(require,module,exports){
                var select = require('../../utils/select');
                var addClass = require('../../utils/add-class');
                var removeClass = require('../../utils/remove-class');
                var dispatch = require('../../utils/dispatch');
                Severity: Minor
                Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

                  Function 21 has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  },{}],21:[function(require,module,exports){
                  /**
                   * Attaches a given listener function to a given element which is
                   * triggered by a specified list of event types.
                   * @param {HTMLElement} element - the element to which the listener will be attached
                  Severity: Minor
                  Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language