Showing 366 of 552 total issues
Function attached
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
attached() {
//console.log('chartjs attached');
//listening to custom event fmidata and fmireset
const fromel = document.getElementById(this.fromid);
if (fromel) {
- 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
File chartjs.js
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Chart from 'chart.js';
import ChartDataLabels from 'chartjs-plugin-datalabels';
import {bindable} from 'aurelia-framework';
import _ from 'lodash';
Fmi
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
export class Fmi {
@bindable fminame='N/A';
@bindable tolerance=0.000001;//0.000030517578
@bindable starttime=0;
@bindable stoptime=0; //if >0 then fmi will stop at stoptime
Function _renderLineChart
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphCanvasRenderer.prototype._renderLineChart = function() {
// TODO(danvk): use this.attr_ for many of these.
var ctx = this.elementContext;
var fillAlpha = this.attr_('fillAlpha');
var errorBars = this.attr_("errorBars") || this.attr_("customBars");
Function getDateAxis
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
var formatter = opts("axisLabelFormatter");
var ticks = [];
var t;
- 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 computeYAxes_
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.computeYAxes_ = function() {
// Preserve valueWindow settings if they exist, and if the user hasn't
// specified a new valueRange.
var i, valueWindows, seriesName, axis, index, opts, v;
if (this.axes_ !== undefined && this.user_attrs_.hasOwnProperty("valueRange") === false) {
- 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 _drawSeries
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
DygraphCanvasRenderer.prototype._drawSeries = function(
ctx, iter, strokeWidth, pointSize, drawPoints, drawGapPoints,
stepPlot, strategy) {
var prevCanvasX = null;
- 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 bind
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind() {
//console.log('chartjs bind');
if ((typeof this.refindex == 'string') && (this.refindex.indexOf(',')>0)) { this.refindices = this.refindex.split(',')}
else {
this.refindex = myParseInt(this.refindex, 10);
Function constructor
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
constructor() {
super();
this.handleValueChange = e => {
//let j = this.currentdataset;
//all values from refindex to one dataset - as one curve
- 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
File animate-adobe.js
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {bindable} from 'aurelia-framework';
//import '@danzen/createjs';
//import 'createjs/builds/1.0.0/createjs';
import 'latest-createjs';
//import 'createjs/builds/1.0.0/createjs';
Function step
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
step(e) {
//this = window.thisfmi;
//primitive semaphore, only one instance can perform this call
if (!this.doingstep) {
//console.log('fmu step()');
- 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 _renderAxis
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphCanvasRenderer.prototype._renderAxis = function() {
if (!this.attr_('drawXAxis') && !this.attr_('drawYAxis')) return;
// Round pixels to half-integer boundaries for crisper drawing.
function halfUp(x) { return Math.round(x) + 0.5; }
Function attached
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
attached() {
//console.log('chartjs attached');
//listening to custom event fmidata and fmireset
const fromel = document.getElementById(this.fromid);
if (fromel) {
Function numericTicks
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.numericTicks = function (a, b, pixels, opts, dygraph, vals) {
//console.log("nt a " + a + " b " + b + " vals " + vals);
var pixels_per_tick = opts('pixelsPerLabel');
var ticks = [];
var i, j, tickV, nTicks;
Function registerInputs
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
registerInputs(){
if (this.inputs) { //register DOM elements to listen to their 'change' event directly
let inputparts = this.inputs.split(';'); //splits groups delimited by ;
this.inputreferences = [];
for (let inputpart of inputparts) {
- 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 _renderAnnotations
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
DygraphCanvasRenderer.prototype._renderAnnotations = function() {
var annotationStyle = {
"position": "absolute",
"fontSize": this.attr_('axisLabelFontSize') + "px",
"zIndex": 10,
- 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 rollingAverage
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.prototype.rollingAverage = function(originalData, rollPeriod) {
if (originalData.length < 2)
return originalData;
rollPeriod = Math.min(rollPeriod, originalData.length);
var rollingData = [];
Function extremeValues_
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.extremeValues_ = function(series) {
var minY = null, maxY = null, j, y;
var bars = this.attr_("errorBars") || this.attr_("customBars");
if (bars) {
- 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 30 (exceeds 5 allowed). Consider refactoring. Open
attached() {
//listening to custom event fmidata
console.log('dygraph attached');
if (this.refindex && (this.refindex.indexOf(',')>0)) this.refindices = this.refindex.split(',');
let fmielement = document.getElementById(this.fromid);
- 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 parseDataTable_
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.prototype.parseDataTable_ = function(data) {
var shortTextForAnnotationNum = function(num) {
// converts [0-9]+ [A-Z][a-z]*
// example: 0=A, 1=B, 25=Z, 26=Aa, 27=Ab
// and continues like.. Ba Bb .. Za .. Zz..Aaa...Zzz Aaaa Zzzz