Showing 115 of 227 total issues
Avoid deeply nested control flow statements. Open
Open
if (xpc.contextNode === xpc.virtualRoot) {
break;
}
Avoid deeply nested control flow statements. Open
Open
while (st.length > 0) {
for (var m = st.pop(); m != null; ) {
if (step.nodeTest.matches(m, xpc)) {
newNodes.push(m);
}
Avoid deeply nested control flow statements. Open
Open
if (xpc.contextNode === xpc.virtualRoot) {
break;
}
Avoid deeply nested control flow statements. Open
Open
for (var m = xpc.contextNode.nextSibling; m != null; m = m.nextSibling) {
if (step.nodeTest.matches(m, xpc)) {
newNodes.push(m);
}
}
Avoid deeply nested control flow statements. Open
Open
for (var m = xpc.contextNode.previousSibling; m != null; m = m.previousSibling) {
if (step.nodeTest.matches(m, xpc)) {
newNodes.push(m);
}
}
Avoid deeply nested control flow statements. Open
Open
if (name == "and") {
types.push(XPathParser.AND);
values.push(name);
continue;
}
Avoid deeply nested control flow statements. Open
Open
if (name == "mod") {
types.push(XPathParser.MOD);
values.push(name);
continue;
}
Avoid deeply nested control flow statements. Open
Open
if (this.predicateMatches(pred, xpc)) {
newNodes.push(xpc.contextNode);
} else {
}
Function scrapeElement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Scraper.prototype.scrapeElement = function(doc, element, scrapeUrl, key, follow_url) {
Function evaluate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
doc.evaluate = function(e, cn, r, t, res) {
Function Scraper
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
var Scraper = function(definition, headless) {
var scraper = this;
EventEmitter2.call(this, {
wildcard: 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 name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
Functions.name = function() {
var c = arguments[0];
var n;
if (arguments.length == 1) {
n = c.contextNode;
- 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
Open
return Step.DESCENDANT;
Avoid too many return
statements within this function. Open
Open
return Step.SELF;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return Step.FOLLOWING;
Avoid too many return
statements within this function. Open
Open
return Step.PARENT;
Avoid too many return
statements within this function. Open
Open
return Step.PRECEDING;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return false;