18F/18f.gsa.gov

View on GitHub

Showing 104 of 104 total issues

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

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

                var _getComboBoxContext10 = getComboBoxContext(el),
                    comboBoxEl = _getComboBoxContext10.comboBoxEl,
                    selectEl = _getComboBoxContext10.selectEl,
                    inputEl = _getComboBoxContext10.inputEl,
                    statusEl = _getComboBoxContext10.statusEl,
              Severity: Major
              Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 1 hr to fix
              _sass/_libs/uswds/js/uswds.js on lines 1767..1772

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

              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

                var _getComboBoxContext5 = getComboBoxContext(el),
                    selectEl = _getComboBoxContext5.selectEl,
                    inputEl = _getComboBoxContext5.inputEl,
                    listEl = _getComboBoxContext5.listEl,
                    statusEl = _getComboBoxContext5.statusEl,
              Severity: Major
              Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 1 hr to fix
              _sass/_libs/uswds/js/uswds.js on lines 1932..1937

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

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

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

                      remove: function removeBehavior(element) {
                        listeners.forEach(function (listener) {
                          element.removeEventListener(listener.type, listener.delegate, listener.options);
                        });
                      }
                  Severity: Major
                  Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 1 hr to fix
                  _sass/_libs/uswds/js/uswds.js on lines 1029..1033

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

                  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

                      add: function addBehavior(element) {
                        listeners.forEach(function (listener) {
                          element.addEventListener(listener.type, listener.delegate, listener.options);
                        });
                      },
                  Severity: Major
                  Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 1 hr to fix
                  _sass/_libs/uswds/js/uswds.js on lines 1034..1038

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

                  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

                  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

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

                    return {
                      comboBoxEl: comboBoxEl,
                      selectEl: selectEl,
                      inputEl: inputEl,
                      listEl: listEl,
                  Severity: Minor
                  Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 50 mins to fix
                  _sass/_libs/uswds/js/uswds.js on lines 2270..2281

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

                  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

                  module.exports = {
                    accordion: accordion,
                    banner: banner,
                    characterCount: characterCount,
                    comboBox: comboBox,
                  Severity: Minor
                  Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 50 mins to fix
                  _sass/_libs/uswds/js/uswds.js on lines 1583..1594

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

                  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

                  var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
                  Severity: Minor
                  Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 50 mins to fix
                  _sass/_libs/uswds/js/uswds.js on lines 513..513

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

                  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

                  var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global;
                  Severity: Minor
                  Found in _sass/_libs/uswds/js/uswds.js and 1 other location - About 50 mins to fix
                  _sass/_libs/uswds/js/uswds.js on lines 516..516

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language