dsathyakumar/a11y-auditor

View on GitHub

Showing 79 of 129 total issues

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

_configValidatorAndProcessor = function _configValidatorAndProcessor() {

    //> if _rulesConfig is not null / empty & not undefined
    if (!_.isEmpty(_rulesConfig) && !_.isUndefined(_rulesConfig)) {

Severity: Minor
Found in lib/audit/auditInitializer.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 canElementReceiveFocus has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    canElementReceiveFocus: function(elem) {
        //> get the current elements ownerDocument
        var doc = elem.ownerDocument.defaultView;

        //> if the current elements either an <a> or <area> element, it has to have 'href' to receive focus
Severity: Minor
Found in lib/utils/accessibilityUtils.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 _ruleExector has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _ruleExector(elem) {
    var _severityEnum = enums.severityEnum,
        _validRoleArr = [],
        _role, _flag, _isValid = false;

Severity: Minor
Found in lib/rulesImpl/AX_11.js - About 1 hr to fix

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

    function _ruleExector(elem) {
        var _severityEnum = enums.severityEnum,
            _data = [], //holds the aria-* extracted from element
            _ct, _flag, //variables for loop count
            _isValid = false, //flag to detect if the extracted aria-* is valid or not
    Severity: Minor
    Found in lib/rulesImpl/AX_03.js - About 1 hr to fix

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

      function _ruleExector(elem) {
      
          var _severityEnum = enums.severityEnum;
      
          //> even input type image needs an alt attribute to be present
      Severity: Minor
      Found in lib/rulesImpl/AX_01.js - About 1 hr to fix

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

            getAriaProperties: function(a) {
                var b = {},
                    c = this.getGlobalAriaProperties(a),
                    d;
                for (d in enums.ariaPropertiesEnum) {
        Severity: Minor
        Found in lib/axs/axsUtils.js - About 1 hr to fix

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

              hasValidElements: function(_rulesConfig) {
          
                  //> setting a default flag to hold the result of the operation
                  var _hasValidElements = false;
          
          
          Severity: Minor
          Found in lib/audit/auditRunnerHelper.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 _ruleExector has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          function _ruleExector(elem) {
          
              var _severityEnum = enums.severityEnum;
          
              //> even input type image needs an alt attribute to be present
          Severity: Minor
          Found in lib/rulesImpl/AX_01.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 _ruleExector has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _ruleExector() {
              var _severityEnum = enums.severityEnum,
                  _innerHTML, _innerTags, _prevAll;
          
              //a proper mark up defines one heading / purpose for the page & multiple sub-headings / sections / paragraphs
          Severity: Minor
          Found in lib/rulesImpl/AX_24.js - About 1 hr to fix

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

            function _ruleExector(elem) {
            
                var _severityEnum = enums.severityEnum,
                    _url, _hasImg = false;
            
            
            Severity: Minor
            Found in lib/rulesImpl/AX_31.js - About 1 hr to fix

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

              function _ruleExector(elem) {
                  var _severityEnum = enums.severityEnum,
                      _tagName, _txt;
              
                  if (elem.hasAttribute('role') && elem.getAttribute('role') === 'main') {
              Severity: Minor
              Found in lib/rulesImpl/AX_25.js - About 1 hr to fix

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

                        window.Node.prototype.getEventListener = function(type) {
                          //> What if getEventListener is called on this element before even adding / removing any events
                          //> The element will have to be registered
                          //> Register new element (or) get the listener of existing elements
                          //> this is the current element as this method is hooked to Node.prototype
                Severity: Minor
                Found in lib/utils/hasEvent.js - About 1 hr to fix

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

                  function _ruleExector() {
                      var _severityEnum = enums.severityEnum,
                          _innerHTML, _innerTags, _prevAll;
                  
                      //a proper mark up defines one heading / purpose for the page & multiple sub-headings / sections / paragraphs
                  Severity: Minor
                  Found in lib/rulesImpl/AX_24.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 _isSkipRule has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  _isSkipRule = function _isSkipRule(rule, elem) {
                      var _ruleList, _ct, _isSkip = false;
                      //> iterate over the list of objects in the _selectorObjs which was populated from the rules config
                      //> the rulesConfig originally contained 'selector' -> ['array of rules to be skipped']
                      //> selectorObjs contain all valid DOM elements matching this selector in rulesConfig
                  Severity: Minor
                  Found in lib/audit/auditRunner.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 _ruleExector has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _ruleExector(elem) {
                  
                      //> load the severityEnum to report for issues
                      var _severityEnum = enums.severityEnum;
                  
                  
                  Severity: Minor
                  Found in lib/rulesImpl/AX_36.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 _ruleExector has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _ruleExector(elem) {
                      var _severityEnum = enums.severityEnum,
                          _data = [], //holds the aria-* extracted from element
                          _ct, _flag, //variables for loop count
                          _isValid = false, //flag to detect if the extracted aria-* is valid or not
                  Severity: Minor
                  Found in lib/rulesImpl/AX_03.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 checkForAria has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      checkForAria: function(el) {
                          if (!el) {
                              return null;
                          }
                          var tagName = el.tagName;
                  Severity: Minor
                  Found in lib/axs/axsUtils.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 getParentNodeType has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getParentNodeType: function(elem) {
                        //> if the given Node is NULL, return
                        if (!elem) {
                            return null;
                        }
                  Severity: Minor
                  Found in lib/utils/accessibilityUtils.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 _ruleExector has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _ruleExector() {
                      var _severityEnum = enums.severityEnum,
                          _node, _htmlDocType;
                  
                      //some browsers return this as as DocumentType Object
                  Severity: Minor
                  Found in lib/rulesImpl/AX_34.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 matchSelector has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      matchSelector: function(a, b) {
                          return a.matches ? a.matches(b) : a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSelector
                              ? a.mozMatchesSelector(b) : a.msMatchesSelector ? a.msMatchesSelector(b) : !true;
                      },
                  Severity: Minor
                  Found in lib/axs/axsUtils.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

                  Severity
                  Category
                  Status
                  Source
                  Language