Showing 430 of 684 total issues
Function destroy
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.prototype.destroy = function() {
var removeRecursive = function(node) {
while (node.hasChildNodes()) {
removeRecursive(node.firstChild);
node.removeChild(node.firstChild);
Function treatMouseOpAsClick
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) {
var clickCallback = g.attr_('clickCallback');
var pointClickCallback = g.attr_('pointClickCallback');
var selectedPoint = null;
Function createZoomHandles_
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
DygraphRangeSelector.prototype.createZoomHandles_ = function() {
var img = new Image();
img.className = 'dygraph-rangesel-zoomhandle';
img.style.position = 'absolute';
img.style.zIndex = 10;
Function updatetitles
has 27 lines of code (exceeds 25 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);
Function attached
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
attached() {
//console.log('bdlmarkdownaurelia attached() src:', this.src);
// eslint-disable-next-line new-cap
//optionally, register customevent handler for 'contentupdate' when fromid is defined
// eslint-disable-next-line new-cap
Function convertf2a
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertf2a(x) {
//do conversion if operation is defined
if (this.operation) x = this.operation(x);
//initially sets minimum as 1/2 of current value, otherwise update it
if (!this.afminset) {
Function handleValueChange
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.handleValueChange = e => {
let datapoint = [];
if (!this.xy) datapoint.push(e.detail.time);
//e.detail do not reallocate - using same buffer, thus slicing to append to data array
let edata = e.detail.data.slice();
Function toc_body
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
md.renderer.rules.toc_body = function(tokens, index) {
let results = [];
let previousLevel = 0;
for (let i = 0; i < headingInfos.length; i++) {
Function _drawSeries
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx, iter, strokeWidth, pointSize, drawPoints, drawGapPoints,
stepPlot, strategy) {
Function drawZoomRect_
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Dygraph.prototype.drawZoomRect_ = function(direction, startX, endX, startY,
endY, prevDirection, prevEndX,
prevEndY) {
Function DrawPolygon_
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Dygraph.DrawPolygon_ = function(sides, rotationRadians, ctx, cx, cy, color, radius, delta) {
Function setAnnotations
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
DygraphLayout.prototype.setAnnotations = function(ann) {
// The Dygraph object's annotations aren't parsed. We parse them here and
// save a copy. If there is no parser, then the user must be using raw format.
this.annotations = [];
var parse = this.attr_('xValueParser') || function(x) { return x; };
- 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 startPan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.Interaction.startPan = function(event, g, context) {
var i, axis;
context.isPanning = true;
var xRange = g.xAxisRange();
context.dateRange = xRange[1] - xRange[0];
- 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 findClosestPoint
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.findClosestPoint = function(domX, domY) {
var minDist = Infinity;
var idx = -1;
var points = this.layout_.points;
var dist, dx, dy, point, closestPoint, closestSeries;
- 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 exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = ({ production } = {}, {extractCss, analyze, tests, hmr, port, host } = {}) => ({
resolve: {
extensions: ['.js'],
modules: [srcDir, 'node_modules'],
- 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 findPosX
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.findPosX = function(obj) {
var curleft = 0;
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
- 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 cascadeEvents_
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Dygraph.prototype.cascadeEvents_ = function(name, extra_props) {
if (!name in this.eventListeners_) return true;
// QUESTION: can we use objects & prototypes to speed this up?
var e = {
- 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 cleanArgs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function cleanArgs(args) {
const cleaned = [];
for (let i = 0, ii = args.length; i < ii; i++) {
if (args[i] === '--env' && i < ii - 1) {
const env = args[++i].toLowerCase();
- 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 _evaluateLineTicks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
DygraphLayout.prototype._evaluateLineTicks = function() {
var i, tick, label, pos;
this.xticks = [];
for (i = 0; i < this.xTicks_.length; i++) {
tick = this.xTicks_[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 evaluateWithError
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
DygraphLayout.prototype.evaluateWithError = function() {
this.evaluate();
if (!(this.attr_('errorBars') || this.attr_('customBars'))) return;
// Copy over the error terms
- 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"