18F/18f.gsa.gov

View on GitHub

Showing 69 of 104 total issues

Function 42 has 36 lines of code (exceeds 25 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 1 hr to fix

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

          function switchElementMode(el, mode) {
              var nodeStyle = el.node.style;
    
              switch (mode) {
                  case 0:
    Severity: Minor
    Found in assets/js/sticky.js - About 1 hr to fix

      Function 23 has a Cognitive Complexity of 12 (exceeds 5 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: 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 17 has a Cognitive Complexity of 12 (exceeds 5 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: 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 14 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"./behavior":8,"./delegate":10,"./delegateAll":11,"./ignore":12,"./keymap":14}],14:[function(require,module,exports){
      "use strict";
      
      require('keyboardevent-key-polyfill'); // these are the only relevant modifiers supported on all platforms,
      // according to MDN:
      Severity: Minor
      Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

        module.exports = useNative() ? nativeDataset : function (element) {
          var map = {};
          var attributes = element.attributes;
        
          function getter() {
        Severity: Minor
        Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

          Function 16 has 31 lines of code (exceeds 25 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 1 hr to fix

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

            function shouldUseNative() {
              try {
                if (!Object.assign) {
                  return false;
                } // Detect buggy property enumeration order in older V8 versions.
            Severity: Minor
            Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

              Method related_posts has 29 lines of code (exceeds 25 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 1 hr to fix

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

                var getListeners = function getListeners(type, handler) {
                  var match = type.match(DELEGATE_PATTERN);
                  var selector;
                
                  if (match) {
                Severity: Minor
                Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

                  },{}],40:[function(require,module,exports){
                  "use strict";
                  
                  var resolveIdRefs = require("resolve-id-refs");
                  
                  
                  Severity: Minor
                  Found in _sass/_libs/uswds/js/uswds.js - About 1 hr to fix

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

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

                      Method find_published_authors has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def find_published_authors
                            published_authors = []
                            base_path = Dir.pwd
                            @site_post_paths.each do |post_path|
                              next unless File.exist? File.join(base_path, '_posts', post_path)
                      Severity: Minor
                      Found in _plugins/author_data.rb - 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 40 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{}],40:[function(require,module,exports){
                      "use strict";
                      
                      var resolveIdRefs = require("resolve-id-refs");
                      
                      
                      Severity: Minor
                      Found in _sass/_libs/uswds/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 14 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{"./behavior":8,"./delegate":10,"./delegateAll":11,"./ignore":12,"./keymap":14}],14:[function(require,module,exports){
                      "use strict";
                      
                      require('keyboardevent-key-polyfill'); // these are the only relevant modifiers supported on all platforms,
                      // according to MDN:
                      Severity: Minor
                      Found in _sass/_libs/uswds/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 26 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{"../events":29,"../utils/behavior":35,"../utils/select":38,"receptor/ignore":12}],26:[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 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

                      Method in_groups has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def in_groups(number, fill_with = nil)
                          # size.div number gives minor group size;
                          # size % number gives how many objects need extra accommodation;
                          # each group hold either division or division + 1 items.
                          division = size.div number
                      Severity: Minor
                      Found in _plugins/utility.rb - 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

                      Method team_link has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def team_link(input)
                            authors = Jekyll.sites[0].collections['authors'].docs
                            index = authors.find_index do |x|
                              if x.data['name'].nil?
                                puts "No such author: #{input} in #{x}"
                      Severity: Minor
                      Found in _plugins/author.rb - 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 2 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{}],2:[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 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

                      Method team_photo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def team_photo(name)
                            if Jekyll.sites[0].config['env'] != 'development'
                              baseurl = Jekyll.sites[0].config['baseurl']
                              default = "<img class='img-circle team-img bio-clip' "\
                                "src='#{baseurl}/assets/img/logos/18F-Logo-M.png' alt='18F logo'>"
                      Severity: Minor
                      Found in _plugins/team.rb - 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

                      Severity
                      Category
                      Status
                      Source
                      Language