Showing 1,637 of 1,637 total issues
Avoid deeply nested control flow statements. Open
Open
for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
Avoid deeply nested control flow statements. Open
Open
for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
Avoid deeply nested control flow statements. Open
Open
if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
Avoid deeply nested control flow statements. Open
Open
if (d3_layout_packIntersects(j, c)) {
isect = 1;
break;
}
Avoid deeply nested control flow statements. Open
Open
if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
Avoid deeply nested control flow statements. Open
Open
while (++i < n) if (!value.contains(name[i])) return false;
Avoid deeply nested control flow statements. Open
Open
if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
Avoid deeply nested control flow statements. Open
Open
for (j = i + 1; j < n; ++j) q[j].i -= 2;
Avoid deeply nested control flow statements. Open
Open
for (j = i + 1; j < n; ++j) q[j].i--;
Avoid deeply nested control flow statements. Open
Open
for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
if (d3_layout_packIntersects(k, c)) {
break;
}
}
Avoid deeply nested control flow statements. Open
Open
for (j = i + 1; j < n; ++j) q[j].i--;
Avoid deeply nested control flow statements. Open
Open
if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition);
Avoid deeply nested control flow statements. Open
Open
while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
Function formatKMBT
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
Rickshaw.Fixtures.Number.formatKMBT = function(y) {
var abs_y = Math.abs(y);
if (abs_y >= 1000000000000) { return y / 1000000000000 + "T" }
else if (abs_y >= 1000000000) { return y / 1000000000 + "B" }
else if (abs_y >= 1000000) { return y / 1000000 + "M" }
- 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 init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
init: function( elem, options, prop, end, easing, unit ) {
Avoid deeply nested control flow statements. Open
Open
if (ymax != null) {
ymax = Math.max(yval, ymax);
ymin = Math.min(yval, ymin);
} else {
ymax = ymin = yval;
Avoid deeply nested control flow statements. Open
Open
if (q[7] === '+') {
offsetmins = 0 - offsetmins;
}
Function formatter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
formatter: function(series, x, y, formattedX, formattedY, d) {
Avoid deeply nested control flow statements. Open
Open
if (r[8] !== 'Z') {
offsetmins = parseInt(r[10], 10) * 60 + parseInt(r[11], 10);
if (r[9] === '+') {
offsetmins = 0 - offsetmins;
}
Function setMatcher
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {