Showing 390 of 605 total issues
Function dirCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Avoid deeply nested control flow statements. Open
if (element.tagName.toUpperCase() == 'IMG' && element.width) {
element.width++; element.width--;
} else try {
var n = document.createTextNode(' ');
element.appendChild(n);
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 (!this.isValueValid(futureValue, this.selection.start + 1, group))
{
this.redTextFlash(); return false;
}
else
Avoid deeply nested control flow statements. Open
if (Element.getStyle(element, 'position') == 'absolute') break;
Avoid deeply nested control flow statements. Open
if (value[1]) return parseFloat(value[1]) / 100;
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 dirNodeCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Avoid deeply nested control flow statements. Open
if (!attribute) return null;
Avoid deeply nested control flow statements. Open
if ( !inplace ) {
curLoop = result;
}
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
if (!mustRevert) {
this.setValue(this.fixedValue);
this.selection.moveTo(this.fixedValue.length, this.fixedValue.length);
} else {
this.setValue(this.oldValue.substring(0, this.selection.start) + autocomplete);
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);
}
Avoid deeply nested control flow statements. Open
if (l != "movie") { // Filter out IE specific param element
e.setAttribute(l, parObj[l]);
}
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 (k == "data") {
e.setAttribute("src", attObj[k]);
}
else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
e.setAttribute("class", attObj[k]);
Function evaluate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
UnionExpr.prototype.evaluate = function(ctx) {
var nodes1 = this.expr1.evaluate(ctx).nodeSetValue();
var nodes2 = this.expr2.evaluate(ctx).nodeSetValue();
var I1 = nodes1.length;
for (var i2 = 0; i2 < nodes2.length; ++i2) {
- 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
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);
Avoid deeply nested control flow statements. Open
for (var nn = n.nextSibling; nn; nn = nn.nextSibling) {
nodelist.push(nn);
xpathCollectDescendants(nodelist, nn);
}