18F/forest-service-prototype

View on GitHub

Showing 28 of 46 total issues

Function 9 has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],9:[function(require,module,exports){
var toggleFieldMask = require('./toggle-field-mask');
var select = require('../utils/select');

/**
Severity: Minor
Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

    Function 16 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"../components/header/mobile":6,"../components/header/search":7,"../utils/when-dom-ready":25}],16:[function(require,module,exports){
    var verifyjQuery = require('../utils/verify-jquery');
    
    // jQuery Plugin
    
    
    Severity: Minor
    Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

      Function 5 has a Cognitive Complexity of 11 (exceeds 5 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

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

      },{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],6:[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 _divideIntoArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Politespace.prototype._divideIntoArray = function( value ) {
                var split = ( '' + this.groupLength ).split( ',' ),
                    isUniformSplit = split.length === 1,
                    dividedValue = [],
                    loopIndex = 0,
        Severity: Minor
        Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

          Function 7 has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 submit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def submit(request, id=None,
                     template_name='specialuseform/submit.html'):
              if id:
                  permit = get_object_or_404(NonCommercialUsePermit, id=id)
                  submit_button_text = 'Save Changes'
          Severity: Minor
          Found in forestserviceprototype/specialuseform/views.py - About 45 mins 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 23 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          },{}],23:[function(require,module,exports){
          /**
           * @name select
           * @desc selects elements from the DOM by class selector or ID selector.
           * @param {string} selector - The selector to traverse the DOM with.
          Severity: Minor
          Found in third-party/uswds-0.13.1/js/uswds.js - About 25 mins 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