Showing 390 of 605 total issues
Avoid deeply nested control flow statements. Open
if (node.tagName !== "!") // Filter out comment nodes.
results.push(node);
Avoid deeply nested control flow statements. Open
if (Element.getStyle(element, 'position') == 'absolute') break;
Function contains
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spry.Widget.Utils.contains = function (who, what)
{
if (typeof who.contains == 'object') {
return what && who && (who == what || who.contains(what));
} else {
- 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 (!this.isValueValid(futureValue, this.selection.start + 1, group))
{
this.redTextFlash(); return false;
}
else
Avoid deeply nested control flow statements. Open
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
Avoid deeply nested control flow statements. Open
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
Avoid deeply nested control flow statements. Open
if (pressed == autocomplete)
{
if (this.nextDateDelimiterExists(this.oldValue, this.selection.start, group))
{
futureValue = this.oldValue;
Avoid deeply nested control flow statements. Open
if ( !anyFound ) {
return [];
}
Avoid deeply nested control flow statements. Open
if ( a == b ) {
hasDuplicate = true;
}
Avoid deeply nested control flow statements. Open
if(group == this.lastDateGroup)
{
this.redTextFlash(); return false;
}
else
Avoid deeply nested control flow statements. Open
for (var sel_end = 0; range_all.compareEndPoints('StartToEnd', range) < 0; sel_end++){
range_all.moveStart('character', 1);
}
Function init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.init = function(element, options)
{
this.element = this.getElement(element);
this.errors = 0;
this.flags = {locked: false, restoreSelection: 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"
Further reading
Function getAutoComplete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.getAutoComplete = function(from, direction) {
if (direction == -1) {
var n = '', m = '';
while(from && (n = this.getAutoComplete(--from) )) {
m = n;
- 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
} else if (this.axis == xpathAxis.NAMESPACE) {
alert('not implemented: axis namespace');
} else if (this.axis == xpathAxis.PARENT) {
if (input.parentNode) {
Avoid deeply nested control flow statements. Open
if (cmp(s, nn)) {
ret = true;
break;
}
Avoid deeply nested control flow statements. Open
for (var nn = n.nextSibling; nn; nn = nn.nextSibling) {
nodelist.push(nn);
xpathCollectDescendants(nodelist, nn);
}
Function loop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
loop: function(timePos) {
if (timePos >= this.startOn) {
if (timePos >= this.finishOn) {
this.render(1.0);
this.cancel();
- 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
for (var i = 0; i < n.length; ++i) {
var nn = xmlValue(n[i]) - 0;
if (cmp(nn, s)) {
ret = true;
break;
Avoid deeply nested control flow statements. Open
if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
ac.appendChild(c[i].cloneNode(true));
}
Avoid deeply nested control flow statements. Open
else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
showExpressInstall(regObjArr[i]);
}
else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
displayAltContent(obj);