Showing 623 of 1,229 total issues
Avoid deeply nested control flow statements. Open
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
Function extractUp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function extractUp(tree, id) {
var _n = {};
var __n = {};
var _d = {};
- 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 (_handlers[event][j].handler !== handler)
a.push(_handlers[event][j]);
Avoid deeply nested control flow statements. Open
if (typeof v1[i] === 'function')
_addJob(i, __extend({
job: v1[i]
}, v2));
else
Function post
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function post(msg) {
function postMsg(type, body, ctx) {
var msg = MSG[type].flx.call(ctx, body);
- 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 (_parameters.history) {
job.status = 'done';
_doneJobs.push(job);
}
Avoid deeply nested control flow statements. Open
if (this._handlers[event][j].handler !== handler)
a.push(this._handlers[event][j]);
Avoid deeply nested control flow statements. Open
if (n.size > selected[j].size) {
selected.splice(j, 0, n);
inserted = true;
break;
}
Avoid deeply nested control flow statements. Open
for (k3 in this.allNeighborsIndex[k1][k2])
if (!localEdgesIndex[k3]) {
localEdgesIndex[k3] = true;
graph.edges.push(this.edgesIndex[k3]);
}
Avoid deeply nested control flow statements. Open
if (typeof job.end === 'function')
job.end();
Avoid deeply nested control flow statements. Open
for (var k = 0; k < graphParts.length; k++) {
for (var m = 0; m < graphParts[i].names.length; m++) { var name = graphParts[i].names[m];
if (name === graphParts[k].to) {
console.log(name + " === " + graphParts[k].to)
graphParts[k].index = m;
Avoid deeply nested control flow statements. Open
for (i2 = 0; i2 < i1; i2++)
if ((n2 = nodes[i2]).fa2)
Repulsion.apply_nn(n1, n2);
Function enter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
enter: function(n, c) {
// TODO this is bad design
var _c = {id: ""};
map(n.callee, _getId(_c));
- 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.settings('verbose'))
console.log(
'Warning: The renderer "' +
a[i].id +
'" crashed on ".render()"'
Function ASCIIgraph
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ASCIIgraph(name, mean, median, min, max, length) {
Consider simplifying this complex logical expression. Open
if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
x: x0,
y: abs(x2 - x0) < ε ? y2 : y1
} : abs(y3 - y1) < ε && x1 - x3 > ε ? {
Consider simplifying this complex logical expression. Open
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
Consider simplifying this complex logical expression. Open
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
Consider simplifying this complex logical expression. Open
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
Consider simplifying this complex logical expression. Open
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}