Showing 430 of 684 total issues
Function registerInputs
has 41 lines of code (exceeds 25 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) {
Function beforeDraw
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
beforeDraw: function(chart, easing) {
if (chart.config.options.section && chart.config.options.section.length > 0) {
let ctx = chart.chart.ctx;
let chartArea = chart.chartArea;
let meta = chart.getDatasetMeta(0);
Function attached
has 40 lines of code (exceeds 25 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);
Function cleanArgs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function cleanArgs(args) {
let host;
const cleaned = [];
for (let i = 0, ii = args.length; i < ii; i++) {
- 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 moveTouch
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.Interaction.moveTouch = function(event, g, context) {
var i, touches = [];
for (i = 0; i < event.touches.length; i++) {
var t = event.touches[i];
touches.push({
- 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 createDragInterface_
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.createDragInterface_ = function() {
var context = {
// Tracks whether the mouse is down right now
isZooming: false,
isPanning: false, // is this drag part of a pan?
- 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 processValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
processValue(value) {
//compare with current segment condition
//do stop simulation if the condition in 'relation' is met - returns true
let referencevalue = this.segmentconditions[this.currentsegment].value;
if (this.segmentconditions[this.currentsegment].relation(value, referencevalue)) {
- 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 drawMiniPlot_
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphRangeSelector.prototype.drawMiniPlot_ = function() {
var fillStyle = this.attr_('rangeSelectorPlotFillColor');
var strokeStyle = this.attr_('rangeSelectorPlotStrokeColor');
if (!fillStyle && !strokeStyle) {
return;
Function constructor
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
//create lambda function which is added as listener later
this.changeinputs = {}; //[]; change to associative array
this.handleValueChange = e => {
//e.target; //triggered the event
Function createInterface_
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.prototype.createInterface_ = function() {
// Create the all-enclosing graph div
var enclosing = this.maindiv_;
this.graphDiv = document.createElement("div");
Function binarySearch
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.binarySearch = function(val, arry, abs, low, high) {
if (low === null || low === undefined ||
high === null || high === undefined) {
low = 0;
high = arry.length - 1;
Function drawInteractiveLayer_
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphRangeSelector.prototype.drawInteractiveLayer_ = function() {
var ctx = this.fgcanvas_ctx_;
ctx.clearRect(0, 0, this.canvasRect_.w, this.canvasRect_.h);
var margin = 1;
var width = this.canvasRect_.w - margin;
Function parse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
static parse(uuid) {
var _a, _b, _c, _d;
let hex = undefined;
switch (uuid.length) {
case 32:
Function constructor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
this.handleValueChange = e => {
//sets data to dataset
//apply value convert among all data
let rawdata;
Function setSelection
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.prototype.setSelection = function(row, opt_seriesName) {
// Extract the points we've selected
this.selPoints_ = [];
var pos = 0;
Function computePlotArea_
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphLayout.prototype.computePlotArea_ = function() {
var area = {
// TODO(danvk): per-axis setting.
x: 0,
y: 0
Function footnoteRef
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function footnoteRef(state, silent) {
let label;
let pos;
let footnoteId;
let footnoteSubId;
Function processValue
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
processValue(value) {
//compare with current segment condition
//do stop simulation if the condition in 'relation' is met - returns true
let referencevalue = this.segmentconditions[this.currentsegment].value;
if (this.segmentconditions[this.currentsegment].relation(value, referencevalue)) {
Function drawGraph_
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.prototype.drawGraph_ = function() {
var start = new Date();
// This is used to set the second parameter to drawCallback, below.
var is_initial_draw = this.is_initial_draw_;
Function startTouch
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.Interaction.startTouch = function(event, g, context) {
event.preventDefault(); // touch browsers are all nice.
var touches = [];
for (var i = 0; i < event.touches.length; i++) {
var t = event.touches[i];