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)) {
- Read upRead up
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
- Read upRead up
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;
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
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
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) {
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;
- Read upRead up
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
- Read upRead up
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
Function _ruleExector
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _ruleExector(elem) {
var _severityEnum = enums.severityEnum,
_url, _hasImg = false;
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') {
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
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
- Read upRead up
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
- Read upRead up
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;
- Read upRead up
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
- Read upRead up
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;
- Read upRead up
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;
}
- Read upRead up
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
- Read upRead up
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;
},
- Read upRead up
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"