Showing 497 of 497 total issues
Function xmlImportNode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function xmlImportNode(doc, node) {
if (node.nodeType == DOM_TEXT_NODE) {
return domCreateTextNode(doc, node.nodeValue);
} else if (node.nodeType == DOM_CDATA_SECTION_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 ExprContext
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ExprContext(node, opt_position, opt_nodelist, opt_parent, opt_caseInsensitive, opt_ignoreAttributesWithoutValue) {
Avoid deeply nested control flow statements. Open
if (this.nodetest.evaluate(ctx).booleanValue()) {
nodelist.push(input);
}
Function getValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getValue: function()
{
var obj = {modules: [], wires: [], properties: null};
var layer;
- 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( t == "ApplyXSLToWorkItem") {
var workItemXml= module.value.workitemXML;
if( workItemXml == "[wired]") {
var wires = this.wiringConfig.working.wires;
var paramValue;
Function addWireConfig
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
addWireConfig: function(group, getInternalContainerId, getExternalTerminalName, externalWires, internalWires, groupIndex)
Avoid deeply nested control flow statements. Open
if (t.options.name == name)
{
terminal = t;
break;
}
Avoid deeply nested control flow statements. Open
if (cmp(s, nn)) {
ret = true;
break;
}
Avoid deeply nested control flow statements. Open
if (end != -1) {
var data = x[i].substring(start, end);
var node = domCreateComment(xmldoc, data);
domAppendChild(parent, node);
} else {
Avoid deeply nested control flow statements. Open
if(i==0 || j==0) {
liaisons.push([n,n+1]);
liaisons.push([n,n+c]);
}
else {
Avoid deeply nested control flow statements. Open
if(wire.tgt.moduleId == moduleId) {
id = this.execValues[wire.src.moduleId][wire.src.terminal];
break;
}
Function xsltChoose
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function xsltChoose(input, template, output) {
for (var i = 0; i < template.childNodes.length; ++i) {
var childNode = template.childNodes[i];
if (childNode.nodeType != DOM_ELEMENT_NODE) {
continue;
- 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 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
if (tagName) skipNodeTest = true;
Avoid deeply nested control flow statements. Open
} else if (v1.type == 'string') {
var s = v1.stringValue();
var n = v2.nodeSetValue();
ret = false;
Avoid deeply nested control flow statements. Open
for(var i = 0 ; i < wires.length ; i++) {
var wire = wires[i];
if(wire.tgt.moduleId == moduleId) {
id = this.execValues[wire.src.moduleId][wire.src.terminal];
break;
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 (this.axis == xpathAxis.DESCENDANT) {
var tagName = xpathExtractTagNameFromNodeTest(this.nodetest);
xpathCollectDescendants(nodelist, input, tagName);
if (tagName) skipNodeTest = true;
Avoid deeply nested control flow statements. Open
} else if (tag.charAt(0) == '/') {
stack.pop();
parent = stack[stack.length-1];
} else if (tag.charAt(0) == '?') {
Avoid deeply nested control flow statements. Open
} else if (stack[s].tag == pattern[p]) {
match.push(stack[s]);
ds += 1;
match.matchlength += 1;