Showing 430 of 684 total issues
File dygraph.js
has 5651 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */
/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
* MIT-licensed (http://opensource.org/licenses/MIT)
Function _renderLineChart
has a Cognitive Complexity of 121 (exceeds 5 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");
- 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 bodylightFootnotePlugin
has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring. Open
export function bodylightFootnotePlugin(md) {
let parseLinkLabel = md.helpers.parseLinkLabel;
let isSpace = md.utils.isSpace;
md.renderer.rules.footnote_ref = renderFootnoteRef;
- 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 a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.rollingAverage = function(originalData, rollPeriod) {
if (originalData.length < 2)
return originalData;
rollPeriod = Math.min(rollPeriod, originalData.length);
var rollingData = [];
- 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 Legend
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.Plugins.Legend = (function() {
/*
Current bits of jankiness:
- 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 numericTicks
has a Cognitive Complexity of 92 (exceeds 5 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;
- 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 gatherDatasets_
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.gatherDatasets_ = function(rolledSeries, dateWindow) {
var boundaryIds = [];
var cumulative_y = []; // For stacked series.
var datasets = [];
var extremes = {}; // series name -> [low, high]
- 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 fmi.js
has 721 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {bindable,observable} from 'aurelia-framework';
import _ from 'lodash';
export const thirdpartytimeout = 5000;
Function bind
has a Cognitive Complexity of 81 (exceeds 5 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 {
- 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 a Cognitive Complexity of 73 (exceeds 5 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; }
- 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 computeYAxisRanges_
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.computeYAxisRanges_ = function (extremes) {
// Build a map from axis number -> [list of series names]
var seriesForAxis = [], series;
for (series in this.seriesToAxisMap_) {
if (!this.seriesToAxisMap_.hasOwnProperty(series)) continue;
- 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 a Cognitive Complexity of 66 (exceeds 5 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;
- 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 computeCombinedSeriesAndLimits_
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
DygraphRangeSelector.prototype.computeCombinedSeriesAndLimits_ = function() {
var data = this.dygraph_.rawData_;
var logscale = this.attr_('logscale');
// Create a combined series (average of all series values).
- 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 parseCSV_
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.parseCSV_ = function(data) {
var ret = [];
var lines = data.split("\n");
var vals, j;
- 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 a Cognitive Complexity of 61 (exceeds 5 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
- 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 initInteraction_
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphRangeSelector.prototype.initInteraction_ = function() {
var self = this;
var topElem = this.isIE_ ? document : window;
var xLast = 0;
var handle = null;
Function RGBColor
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
function RGBColor(color_string)
{
this.ok = false;
// strip any leading #
Function bodylightFootnotePlugin
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function bodylightFootnotePlugin(md) {
let parseLinkLabel = md.helpers.parseLinkLabel;
let isSpace = md.utils.isSpace;
md.renderer.rules.footnote_ref = renderFootnoteRef;
Function bind
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
bind() {
if (typeof (this.smooth) === 'string') this.smooth = this.smooth === 'true';
if (typeof (this.step) === 'string') this.step = parseFloat(this.step);
if (typeof (this.showicons) === 'string') this.showicons = this.showicons === 'true';
if (typeof (this.globalanim) === 'string') this.globalanim = this.globalanim === '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
File chartjs.js
has 470 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';