18F/18f.gsa.gov

View on GitHub

Showing 69 of 104 total issues

File uswds.js has 1952 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";

/*
 * classList.js: Cross-browser full element.classList implementation.
Severity: Major
Found in _sass/_libs/uswds/js/uswds.js - About 5 days to fix

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

    },{"../config":28,"../utils/behavior":35,"../utils/select":38}],20:[function(require,module,exports){
    "use strict";
    
    var _CLICK, _keydown, _behavior;
    
    
    Severity: Minor
    Found in _sass/_libs/uswds/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

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

    },{}],6:[function(require,module,exports){
    (function (global){
    "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 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

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

    },{"../config":28,"../utils/behavior":35,"../utils/select":38}],20:[function(require,module,exports){
    "use strict";
    
    var _CLICK, _keydown, _behavior;
    
    
    Severity: Major
    Found in _sass/_libs/uswds/js/uswds.js - About 2 days to fix

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

      (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
      "use strict";
      
      /*
       * classList.js: Cross-browser full element.classList implementation.
      Severity: Minor
      Found in _sass/_libs/uswds/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

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

        var Stickyfill = (function(doc, win) {
            if (!doc) {
                doc = document;
            }
      
      
      Severity: Major
      Found in assets/js/sticky.js - About 1 day to fix

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

        (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
        "use strict";
        
        /*
         * classList.js: Cross-browser full element.classList implementation.
        Severity: Major
        Found in _sass/_libs/uswds/js/uswds.js - About 6 hrs to fix

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

          },{}],7:[function(require,module,exports){
          /*
          object-assign
          (c) Sindre Sorhus
          @license MIT
          Severity: Minor
          Found in _sass/_libs/uswds/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 6 has 145 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{}],6:[function(require,module,exports){
          (function (global){
          "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 5 hrs to fix

            `` has 42 functions (exceeds 20 allowed). Consider refactoring.
            Open

            (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
            "use strict";
            
            /*
             * classList.js: Cross-browser full element.classList implementation.
            Severity: Minor
            Found in _sass/_libs/uswds/js/uswds.js - About 5 hrs to fix

              File sticky.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              (function(){
                /* eslint-disable */
              
                /*
                * Stickyfill -- `position: sticky` polyfill
              Severity: Minor
              Found in assets/js/sticky.js - About 5 hrs to fix

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

                },{}],42:[function(require,module,exports){
                "use strict";
                
                function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
                
                
                Severity: Minor
                Found in _sass/_libs/uswds/js/uswds.js - About 5 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 5 has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{}],5:[function(require,module,exports){
                "use strict";
                
                /* global define, KeyboardEvent, module */
                (function () {
                Severity: Major
                Found in _sass/_libs/uswds/js/uswds.js - About 4 hrs to fix

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

                  },{"./accordion":17,"./banner":18,"./character-count":19,"./combo-box":20,"./footer":21,"./navigation":23,"./password":24,"./search":25,"./skipnav":26,"./validator":27}],23:[function(require,module,exports){
                  "use strict";
                  
                  var _CLICK;
                  
                  
                  Severity: Major
                  Found in _sass/_libs/uswds/js/uswds.js - About 4 hrs to fix

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

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

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

                      },{"../config":28,"../events":29,"../utils/behavior":35}],19:[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 3 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 ajaxChimp has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.ajaxChimp = function (options) {
                              $(this).each(function(i, elem) {
                                  var form = $(elem);
                                  var email = form.find('input[type=email]');
                                  var label = form.find('label[for=' + email.attr('id') + ']');
                      Severity: Major
                      Found in assets/js/lib/jquery.ajaxchimp.js - About 3 hrs to fix

                        Method related_posts has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def related_posts(me, posts)
                              return [] unless posts.docs.size > 1
                              highest_freq = @tag_freq.values.max
                              related_scores = Hash.new(0)
                        
                        
                        Severity: Minor
                        Found in _plugins/related_posts.rb - About 3 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 getElementParams has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              function getElementParams(node) {
                                  var computedStyle = getComputedStyle(node),
                                      parentNode = node.parentNode,
                                      parentComputedStyle = getComputedStyle(parentNode),
                                      cachedPosition = node.style.position;
                        Severity: Major
                        Found in assets/js/sticky.js - About 3 hrs to fix

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

                          },{"../config":28,"../events":29,"../utils/behavior":35}],19:[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
                            Severity
                            Category
                            Status
                            Source
                            Language