Showing 79 of 129 total issues
Function _preProcessRulesConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_preProcessRulesConfig = function _preProcessRulesConfig() {
var _obj, _ct, _rand;
//> the config is a 'selector' -> ['array of rules to be skipped']
for (var currentSelector in _rulesConfig) {
if (_rulesConfig.hasOwnProperty(currentSelector)) {
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _ruleExector() {
var _severityEnum = enums.severityEnum,
_mainElem = $('main'),
_mainRole = $("[role='main']"),
_mainID = _mainElem.attr('id') || _mainRole.attr('id'),
Consider simplifying this complex logical expression. Open
if (typeof elem.onclick === 'function' || typeof elem.click === 'function' || typeof elem.ondblclick === 'function' || typeof elem.dblclick === 'function' || this.getjQueryDataEvents(elem) || elem.getEventListener('click') || elem.getEventListener('dblclick')) {
_hasClicks = true;
}
Function _ruleExector
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector(elem) {
var _severityEnum = enums.severityEnum;
if ((elem.tagName === 'INPUT' || elem.tagName === 'BUTTON' && $(elem).attr('type') === 'submit') || (elem.tagName === 'BUTTON' && $(elem).attr('type') === undefined)) {
//first check if it has an TARGET attribute
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector(elem) {
var _severityEnum = enums.severityEnum,
_tagName, _txt;
if (elem.hasAttribute('role') && elem.getAttribute('role') === 'main') {
- 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 validator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
validator: function (selector) {
var _validationObj = {isValid: false, selector: selector, errMsg: ''};
//if selector is null / empty or if its undefined
- 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
Avoid deeply nested control flow statements. Open
if (list[type].hasOwnProperty(listElem)) {
//> push all the listeners into the result []
result.push({
type: type,
listener: list[type][listElem],
Avoid deeply nested control flow statements. Open
for (var id in list[_type]) {
//> hasOwnProperty check is to satisfy jshint
if (list[_type].hasOwnProperty(id)) {
//> push all the listener into the result []
result.push({
Consider simplifying this complex logical expression. Open
if (e && this.elementIsAriaWidget(c)) {
e = c.getAttribute('role');
'textbox' == e && c.textContent && 0 < c.textContent.length && (b.controlValue = {
text: c.textContent
});
Consider simplifying this complex logical expression. Open
if (
document.hidden ||
_this.offsetWidth === 0 ||
_this.offsetHeight === 0 ||
_this.style.visibility === 'hidden' ||
Consider simplifying this complex logical expression. Open
if (this.matchSelector(a,
'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])') &&
!d) {
if (a.hasAttribute('id')) {
d = document.querySelectorAll('label[for="' + a.id + '"]');
Function _ruleExector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector() {
var _severityEnum = enums.severityEnum,
_mainElem = $('main'),
_mainRole = $("[role='main']"),
_mainID = _mainElem.attr('id') || _mainRole.attr('id'),
- 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 _addAllPropertiesToSet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _addAllPropertiesToSet(a, b, c) {
var d = a[b];
if (d) {
for (var e = 0; e < d.length; e++) {
c[d[e]] = !0;
- 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 getRoles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getRoles: function(a, b) {
if (!a || a.nodeType !== Node.ELEMENT_NODE || !a.hasAttribute('role') && !b) {
return null;
}
var c = a.getAttribute('role');
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector(elem) {
var _severityEnum = enums.severityEnum;
if (elem.tagName === 'A' && ($(elem).attr('target') === 'blank' || $(elem).attr('target') === '_blank')) {
//first check if it has an TARGET attribute
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector(elem) {
var _severityEnum = enums.severityEnum,
_id = $(elem).attr('id'),
_labelObj;
- 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 composedParentNode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
composedParentNode: function(a) {
if (!a) {
return null;
}
if (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector() {
var _severityEnum = enums.severityEnum,
_title = $('title');
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
function _ruleExector(elem) {
var _severityEnum = enums.severityEnum,
_th;
if (elem.hasAttribute('headers') && !_.isEmpty(elem.getAttribute('headers'))) {
- 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
Avoid too many return
statements within this function. Open
return {
TYPE: _severityEnum.WARN,
RESULT: true,
MSG: 'Warning! This element has an ownerDocument that doesnt match with the window object. This may be part of an iframe or an XML response partial or a detached DOM fragment. The results may not be accurate!'
};