Showing 430 of 684 total issues
Function Legend
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.Plugins.Legend = (function() {
/*
Current bits of jankiness:
Function updatetitles
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
updatetitles(hashstruct) {
//this.currentlink
console.log('top nav hash:', hashstruct);
if (window.markdownnav) {
let currentlink = '#' + (hashstruct[0].length > 0 ? hashstruct[0] : this.index);
- 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 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
Function bind
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind() {
//console.log('chartjs bind');
if (typeof this.displayxticks === 'string') this.displayxticks = this.displayxticks === 'true';
if ((typeof this.refindex == 'string') && (this.refindex.indexOf(',')>0)) { this.refindices = this.refindex.split(',')}
else {
Fmi
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
export class Fmi {
@bindable fminame='';
@bindable fmifunctionprefixname='';
@bindable tolerance=0.000001;//0.000030517578
@bindable starttime=0;
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 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 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 _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 valueChanged
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
valueChanged(newValue, oldValue) {
//if (oldValue !== newValue)
if (this.ids) {
//semaphore only one change in time is allowed
if (!window.rangebinding) {
- 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 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 405 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 sub_plugin
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sub_plugin(md) {
var escapeRE = md.utils.escapeRE,
arrayReplaceAt = md.utils.arrayReplaceAt;
// ASCII characters in Cc, Sc, Sm, Sk categories we should terminate on;
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 = [];