Showing 835 of 1,558 total issues
Function parseOptions
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
static parseOptions(parentOptions, newOptions, allowDeletion = false, globalOptions = {}, copyFromGlobals = false) {
var fields = [
'arrowStrikethrough',
'id',
'from',
File EdgeBase.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
let util = require("../../../../../util");
let EndPoints = require("./EndPoints").default;
/**
File TimeAxis.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
var util = require('../../util');
var Component = require('./Component');
var TimeStep = require('../TimeStep');
var DateUtil = require('../DateUtil');
var moment = require('../../module/moment');
File Item.js
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Hammer = require('../../../module/hammer');
var util = require('../../../util');
var moment = require('../../../module/moment');
Function _onAddItem
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
ItemSet.prototype._onAddItem = function (event) {
if (!this.options.selectable) return;
if (!this.options.editable.add) return;
var me = this;
- 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 setOptions
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Network.prototype.setOptions = function (options) {
if (options !== undefined) {
let errorFound = Validator.validate(options, allOptions);
if (errorFound === true) {
console.log('%cErrors have been found in the supplied options object.', printStyle);
- 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 snap
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
TimeStep.snap = function(date, scale, step) {
var clone = moment(date);
if (scale == 'year') {
var year = clone.year() + Math.round(clone.month() / 12);
Function _getViaCoordinates
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getViaCoordinates() {
// Assumption: x/y coordinates in from/to always defined
let xVia = undefined;
let yVia = undefined;
let factor = this.options.smooth.roundness;
Function _repaintLabels
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
TimeAxis.prototype._repaintLabels = function () {
var orientation = this.options.orientation.axis;
// calculate range and step (step such that we have space for 7 characters per label)
var start = util.convert(this.body.range.start, 'Number');
File DateUtil.js
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* used in Core to convert the options into a volatile variable
*
* @param {function} moment
File EdgesHandler.js
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
var util = require("../../util");
var DataSet = require('../../DataSet');
var DataView = require('../../DataView');
var Edge = require("./components/Edge").default;
Function setOptions
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core.prototype.setOptions = function (options) {
if (options) {
// copy the known options
var fields = [
'width', 'height', 'minHeight', 'maxHeight', 'autoResize',
Function constructor
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(body, images, groups) {
this.body = body;
this.images = images;
this.groups = groups;
Function snap
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
TimeStep.snap = function(date, scale, step) {
var clone = moment(date);
if (scale == 'year') {
var year = clone.year() + Math.round(clone.month() / 12);
- 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 _dataPointFromXY
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Graph3d.prototype._dataPointFromXY = function (x, y) {
var i,
distMax = 100, // px
dataPoint = null,
closestDataPoint = 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 _updateGraph
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
LineGraph.prototype._updateGraph = function () {
// reset the svg elements
DOMutil.prepareElements(this.svgElements);
if (this.props.width != 0 && this.itemsData != null) {
var group, i;
Function _create
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create() {
this.frame = document.createElement('div');
this.frame.className = 'vis-color-picker';
this.colorPickerDiv = document.createElement('div');
File util.test.js
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
var assert = require('assert');
var util = require('../lib/util');
describe('util', function () {
ClusterEngine
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class ClusterEngine {
/**
* @param {Object} body
*/
constructor(body) {
Function minimizeEdgeLength
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
let minimizeEdgeLength = (iterations, node) => {
//window.CALLBACKS.push(() => {
// console.log("ts",node.id);
let nodeId = node.id;
let allEdges = node.edges;