18F/18f.gsa.gov

View on GitHub

Showing 69 of 104 total issues

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

},{}],8:[function(require,module,exports){
"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Severity: Minor
Found in _sass/_libs/uswds/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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

},{}],3:[function(require,module,exports){
'use strict'; // <3 Modernizr
// https://raw.githubusercontent.com/Modernizr/Modernizr/master/feature-detects/dom/dataset.js

function useNative() {
Severity: Minor
Found in _sass/_libs/uswds/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 7 has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],7:[function(require,module,exports){
/*
object-assign
(c) Sindre Sorhus
@license MIT
Severity: Major
Found in _sass/_libs/uswds/js/uswds.js - About 2 hrs to fix

    Function 17 has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{}],17:[function(require,module,exports){
    "use strict";
    
    function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
    
    
    Severity: Major
    Found in _sass/_libs/uswds/js/uswds.js - About 2 hrs to fix

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

      },{}],4:[function(require,module,exports){
      "use strict";
      
      // element-closest | CC0-1.0 | github.com/jonathantneal/closest
      (function (ElementProto) {
      Severity: Minor
      Found in _sass/_libs/uswds/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 8 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{}],8:[function(require,module,exports){
      "use strict";
      
      function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
      
      
      Severity: Major
      Found in _sass/_libs/uswds/js/uswds.js - About 2 hrs to fix

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

        },{"../config":28,"../events":29,"../utils/behavior":35,"../utils/toggle-form-input":40}],25:[function(require,module,exports){
        "use strict";
        
        function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
        
        
        Severity: Major
        Found in _sass/_libs/uswds/js/uswds.js - About 2 hrs to fix

          Function 36 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"object-assign":7,"receptor/behavior":8}],36:[function(require,module,exports){
          "use strict";
          
          var assign = require("object-assign");
          
          
          Severity: Major
          Found in _sass/_libs/uswds/js/uswds.js - About 2 hrs to fix

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

            },{}],5:[function(require,module,exports){
            "use strict";
            
            /* global define, KeyboardEvent, module */
            (function () {
            Severity: Minor
            Found in _sass/_libs/uswds/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 16 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            },{}],16:[function(require,module,exports){
            'use strict';
            
            function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
            
            
            Severity: Minor
            Found in _sass/_libs/uswds/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 enhanceComboBox has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var enhanceComboBox = function enhanceComboBox(comboBoxEl) {
              var selectEl = comboBoxEl.querySelector("select");
            
              if (!selectEl) {
                throw new Error("".concat(COMBO_BOX, " is missing inner select"));
            Severity: Minor
            Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

              },{"../config":28,"../events":29,"../utils/behavior":35,"../utils/select":38,"receptor/keymap":14}],21:[function(require,module,exports){
              "use strict";
              
              function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
              
              
              Severity: Minor
              Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

                var displayList = function displayList(el) {
                  var _getComboBoxContext5 = getComboBoxContext(el),
                      selectEl = _getComboBoxContext5.selectEl,
                      inputEl = _getComboBoxContext5.inputEl,
                      listEl = _getComboBoxContext5.listEl,
                Severity: Minor
                Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

                  },{"object-assign":7,"receptor/behavior":8}],36:[function(require,module,exports){
                  "use strict";
                  
                  var assign = require("object-assign");
                  
                  
                  Severity: Minor
                  Found in _sass/_libs/uswds/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 25 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  },{"../config":28,"../events":29,"../utils/behavior":35,"../utils/toggle-form-input":40}],25:[function(require,module,exports){
                  "use strict";
                  
                  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
                  
                  
                  Severity: Minor
                  Found in _sass/_libs/uswds/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 3 has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  },{}],3:[function(require,module,exports){
                  'use strict'; // <3 Modernizr
                  // https://raw.githubusercontent.com/Modernizr/Modernizr/master/feature-detects/dom/dataset.js
                  
                  function useNative() {
                  Severity: Minor
                  Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

                    Function successCallback has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    function successCallback(resp) {
                                        if (resp.result === 'success') {
                                            msg = 'We have sent you a confirmation email';
                                            label.removeClass('error').addClass('valid');
                                            email.removeClass('error').addClass('valid');
                    Severity: Minor
                    Found in assets/js/lib/jquery.ajaxchimp.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                        if (!("classList" in document.createElement("_")) || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg", "g"))) {
                          (function (view) {
                            "use strict";
                      
                            if (!('Element' in view)) return;
                      Severity: Critical
                      Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

                        },{}],38:[function(require,module,exports){
                        "use strict";
                        
                        function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
                        
                        
                        Severity: Minor
                        Found in _sass/_libs/uswds/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 highlightOption has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var highlightOption = function highlightOption(el, currentEl, nextEl) {
                          var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
                              skipFocus = _ref.skipFocus,
                              preventScroll = _ref.preventScroll;
                        
                        
                        Severity: Minor
                        Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language