dsathyakumar/a11y-auditor

View on GitHub

Showing 79 of 129 total issues

File enums.js has 1667 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

//> @imports
var enumCreator = require('../utils/enumCreator');

Severity: Major
Found in lib/enums/enums.js - About 4 days to fix

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

    module.exports = function() {
        //> is an active instance of this already running.
        var isActive = false;
        //> listener tracking datas - list of elements and list of listeners
        var _elements_  = [];
    Severity: Minor
    Found in lib/utils/hasEvent.js - About 1 day 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

    File axsUtils.js has 557 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // jshint ignore: start
    /***************************************************************************************
     * dependency injection for rules creation
     * @param
     * @return an object with exposed functions
    Severity: Major
    Found in lib/axs/axsUtils.js - About 1 day to fix

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

      module.exports = function(grunt) {
          // loading the npm task
          grunt.loadNpmTasks('grunt-contrib-jshint');
          grunt.loadNpmTasks('grunt-jscs');
          grunt.loadNpmTasks('grunt-jsonlint');
      Severity: Major
      Found in GruntFile.js - About 1 day to fix

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

            findTextAlternatives: function(a, b, c, d) {
                var e = c || !1;
                c = this.asElement(a);
                if (!c || !d && this.isElementOrAncestorHidden(c)) {
                    return null;
        Severity: Minor
        Found in lib/axs/axsUtils.js - About 7 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 exports has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function() {
        
            //> function that checks if an element is visible on page
            //> Hook it to the Element.prototype so that its available for any object of type [Element]
            window.Element.prototype.isVisible = function() {
        Severity: Minor
        Found in lib/utils/elemVisibilityChecker.js - About 7 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 getAriaPropertyValue has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            getAriaPropertyValue: function(a, b, c) {
                var d = a.replace(/^aria-/, ''),
                    e = enums.ariaPropertiesEnum[d],
                    d = {
                        name: a,
        Severity: Minor
        Found in lib/axs/axsUtils.js - About 4 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 findTextAlternatives has 86 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            findTextAlternatives: function(a, b, c, d) {
                var e = c || !1;
                c = this.asElement(a);
                if (!c || !d && this.isElementOrAncestorHidden(c)) {
                    return null;
        Severity: Major
        Found in lib/axs/axsUtils.js - About 3 hrs to fix

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

              getTextFromHostLanguageAttributes: function(a, b, c, d) {
                  if (this.matchSelector(a, 'img') && a.hasAttribute('alt')) {
                      var e = {
                          type: 'string',
                          valid: !0
          Severity: Minor
          Found in lib/axs/axsUtils.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 getAriaProperties has a Cognitive Complexity of 22 (exceeds 5 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 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 exports has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function() {
              //> is an active instance of this already running.
              var isActive = false;
              //> listener tracking datas - list of elements and list of listeners
              var _elements_  = [];
          Severity: Major
          Found in lib/utils/hasEvent.js - About 3 hrs to fix

            exports has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            module.exports = {
            
                getTextFromHostLanguageAttributes: function(a, b, c, d) {
                    if (this.matchSelector(a, 'img') && a.hasAttribute('alt')) {
                        var e = {
            Severity: Minor
            Found in lib/axs/axsUtils.js - About 3 hrs to fix

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

                  getAriaPropertyValue: function(a, b, c) {
                      var d = a.replace(/^aria-/, ''),
                          e = enums.ariaPropertiesEnum[d],
                          d = {
                              name: a,
              Severity: Major
              Found in lib/axs/axsUtils.js - About 2 hrs to fix

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

                module.exports = function() {
                
                    //> function that checks if an element is visible on page
                    //> Hook it to the Element.prototype so that its available for any object of type [Element]
                    window.Element.prototype.isVisible = function() {
                Severity: Major
                Found in lib/utils/elemVisibilityChecker.js - About 2 hrs to fix

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

                      window.Element.prototype.isVisible = function() {
                  
                          //> this is the current element for which the
                          var _this = this; var rect;
                  
                  
                  Severity: Major
                  Found in lib/utils/elemVisibilityChecker.js - About 2 hrs to fix

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

                        var interceptEventListeners = function() {
                    
                            //> original methods exposed by the browser. All HTMLElement is an instanceof Node
                            var _super_ = {
                              addEventListener: window.HTMLElement.prototype.addEventListener,
                    Severity: Major
                    Found in lib/utils/hasEvent.js - About 2 hrs to fix

                      Function _ruleExector has a Cognitive Complexity of 16 (exceeds 5 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 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

                      Consider simplifying this complex logical expression.
                      Open

                          if (_author.length === 1 && !_checkIfIsEmpty(_author.attr('content')) && _description.length === 1 &&
                              !_checkIfIsEmpty(_description.attr('content')) && _keywords.length === 1 &&
                              !_checkIfIsEmpty(_keywords.attr('content')) && _copyright.length === 1 &&
                              !_checkIfIsEmpty(_copyright.attr('content')) && _hasCharset.length === 1 &&
                              !_checkIfIsEmpty(_hasCharset.attr('charset'))) {
                      Severity: Critical
                      Found in lib/rulesImpl/AX_26.js - About 2 hrs to fix

                        Function _ruleExector has 48 lines of code (exceeds 25 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

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

                              getTextFromHostLanguageAttributes: function(a, b, c, d) {
                                  if (this.matchSelector(a, 'img') && a.hasAttribute('alt')) {
                                      var e = {
                                          type: 'string',
                                          valid: !0
                          Severity: Minor
                          Found in lib/axs/axsUtils.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language