Showing 552 of 552 total issues
Avoid deeply nested control flow statements. Open
if (!isNaN(prevX)) {
if (stepPlot) {
ctx.moveTo(prevX, newYs[0]);
} else {
ctx.moveTo(prevX, prevYs[0]);
Function download
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
download() {
//ask for filename
let filename = prompt('File name (*.csv):', 'data.csv');
if (filename) {
//adds csv as extension
- 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 (y === null || isNaN(y)) continue;
Function showhidefull
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
showhidefull() {
this.nav = ! this.nav;
if (! this.nav) {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
- 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 (num_ok) {
rollingData[i] = [originalData[i][0], sum / num_ok];
} else {
rollingData[i] = [originalData[i][0], null];
}
Avoid deeply nested control flow statements. Open
for (j = Math.max(0, i - rollPeriod + 1); j < i + 1; j++) {
y = originalData[j][1];
if (y === null || isNaN(y)) continue;
num_ok++;
sum += originalData[j][1];
Function setInputVariables
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setInputVariables() {
for (let key in this.changeinputs) {
let myinputs = this.changeinputs[key];
//console.log('changing inputs', myinputs);
//set real - reference is in - one input one reference
- 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 attached
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
attached() {
//disable animation if enabled from previous
console.log('adobeobj attached()');
if (window.ani) this.disableAnimation();
if (this.responsive && (typeof this.responsive === 'string')) this.responsive = this.responsive==='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
Avoid deeply nested control flow statements. Open
if (cumulative_y[x] > seriesExtremes[1]) {
seriesExtremes[1] = cumulative_y[x];
}
Avoid deeply nested control flow statements. Open
if (maxY < 0) maxAxisY = 0;
Avoid deeply nested control flow statements. Open
for (j = Math.max(0, i - rollPeriod + 1); j < i + 1; j++) {
y = originalData[j][1][0];
if (y === null || isNaN(y)) continue;
num_ok++;
sum += originalData[j][1][0];
Avoid deeply nested control flow statements. Open
if (spacing > pixels_per_tick) break;
Avoid deeply nested control flow statements. Open
if (stepPlot) {
newYs = [ point.y_bottom, point.y_top ];
prevY = point.y;
} else {
newYs = [ point.y_bottom, point.y_top ];
Avoid deeply nested control flow statements. Open
if (minY > 0) minAxisY = 0;
Avoid deeply nested control flow statements. Open
for (j = 1; j < inFields.length; j++) {
var val = inFields[j];
if (/^ *$/.test(val)) {
fields[j] = [null, null, null];
} else {
Avoid deeply nested control flow statements. Open
if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.parentNode.parentNode.previousSibling);
Avoid deeply nested control flow statements. Open
if (dx > 0) {
var r = (p1.canvasx - domX) / dx;
py += r * (p0.canvasy - p1.canvasy);
}
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 (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;