Showing 684 of 684 total issues
Avoid deeply nested control flow statements. Open
if (stepPlot) {
strategy.drawLine(prevCanvasX, prevCanvasY, point.canvasx, prevCanvasY);
prevCanvasX = point.canvasx;
}
Function findPosY
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.findPosY = function(obj) {
var curtop = 0;
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
- 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 _evaluateLineCharts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
DygraphLayout.prototype._evaluateLineCharts = function() {
// An array to keep track of how many points will be drawn for each set.
// This will allow for the canvas renderer to not have to check every point
// for every data set since the points are added in order of the sets in
// datasets.
- 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 (cumulative_y[x] === undefined) {
cumulative_y[x] = 0;
}
Function numericTicks
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Dygraph.numericTicks = function (a, b, pixels, opts, dygraph, vals) {
Avoid deeply nested control flow statements. Open
if (!isNaN(prevX)) {
if (stepPlot) {
ctx.moveTo(prevX, newYs[0]);
} else {
ctx.moveTo(prevX, prevYs[0]);
Function dateTicker
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Dygraph.dateTicker = function (a, b, pixels, opts, dygraph, vals) {
Function _drawPointsOnLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
DygraphCanvasRenderer.prototype._drawPointsOnLine = function(ctx, pointsOnLine, drawPointCallback, setName, color, pointSize) {
Function _dashedLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
DygraphCanvasRenderer.prototype._dashedLine = function(ctx, x, y, x2, y2, pattern) {
Function numericLinearTicks
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Dygraph.numericLinearTicks = function (a, b, pixels, opts, dygraph, vals) {
Avoid deeply nested control flow statements. Open
if (cumulative_y[x] > seriesExtremes[1]) {
seriesExtremes[1] = cumulative_y[x];
}
Function setAnswer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setAnswer(qid2,answer){
let qid = qid2;
if (qid2.includes(';')) qid = qid2.split(';')[0]; //first is id second is id of related tabs
if (this.quizids.includes(qid2)) {
// Check if an item with id 'id2' exists
- 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 (point.name == setName) { // TODO(klausw): this is always true
if (!Dygraph.isOK(point.y)) {
prevX = NaN;
continue;
}
Avoid deeply nested control flow statements. Open
if (actual_y === null) {
series[j] = [x, null];
continue;
}
Avoid deeply nested control flow statements. Open
if (num_ok) {
rollingData[i] = [originalData[i][0], sum / num_ok];
} else {
rollingData[i] = [originalData[i][0], null];
}
Avoid deeply nested control flow statements. Open
if (requiresNewPoints) {
break;
}
Avoid deeply nested control flow statements. Open
if (cumulative_y[x] < seriesExtremes[0]) {
seriesExtremes[0] = cumulative_y[x];
}
Avoid deeply nested control flow statements. Open
if (prev[1][1] !== null && !isNaN(prev[1][1])) {
low -= prev[1][0];
mid -= prev[1][1];
high -= prev[1][2];
count -= 1;
Avoid deeply nested control flow statements. Open
if (den) {
var p = value < 0 ? 0 : value, n = den;
var pm = sigma * Math.sqrt(p*(1-p)/n + sigma*sigma/(4*n*n));
var denom = 1 + sigma * sigma / den;
low = (p + sigma * sigma / (2 * den) - pm) / denom;
Avoid deeply nested control flow statements. Open
if (num_ok) {
stddev = Math.sqrt(variance) / num_ok;
rollingData[i] = [originalData[i][0],
[sum / num_ok, sigma * stddev, sigma * stddev]];
} else {