Showing 1,558 of 1,558 total issues
Function updateEdgeType
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
updateEdgeType() {
let smooth = this.options.smooth;
let dataChanged = false;
let changeInType = true;
if (this.edgeType !== undefined) {
- 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 _redrawLegend
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Graph3d.prototype._redrawLegend = function() {
//Return without drawing anything, if no legend is specified
if (this.showLegend !== true) {
return;
File BarnesHutSolver.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Barnes Hut Solver
*/
class BarnesHutSolver {
/**
Function _updateYAxis
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
var resized = false;
var yAxisLeftUsed = false;
var yAxisRightUsed = false;
var minLeft = 1e9, minRight = 1e9, maxLeft = -1e9, maxRight = -1e9, minVal, maxVal;
Function setRange
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Range.prototype.setRange = function(start, end, options, callback, frameCallback) {
if (!options) {
options = {};
}
if (options.byUser !== true) {
Label
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Label {
/**
* @param {Object} body
* @param {Object} options
Function followScale
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
DataScale.prototype.followScale = function (other) {
var oldStepIdx = this.minorStepIdx;
var oldStart = this._start;
var oldEnd = this._end;
Function _traceVisible
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Group.prototype._traceVisible = function (initialPos, items, visibleItems, visibleItemsLookup, breakCondition) {
if (initialPos != -1) {
var i, item;
for (i = initialPos; i >= 0; i--) {
item = items[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 parseColor
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
exports.parseColor = function (color) {
var c;
if (exports.isString(color) === true) {
if (exports.isValidRGB(color) === true) {
var rgb = color.substr(4).substr(0, color.length - 5).split(',').map(function (value) { return parseInt(value) });
- 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 initializeData
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
DataGroup.prototype.initializeData = function(graph3d, rawData, style) {
if (rawData === undefined) return;
if (Array.isArray(rawData)) {
rawData = new DataSet(rawData);
- 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 removeEmptyBlocks
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
removeEmptyBlocks() {
let tmpLines = [];
for (let k = 0; k < this.lines.length; k++) {
let line = this.lines[k];
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
setOptions(options) {
if (options !== undefined) {
// reset the popup history because the indices may have been changed.
this.popupHistory = {};
this._removePopup();
- 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 parseAttributeList
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function parseAttributeList() {
var attr = null;
// edge styles of dot and vis
var edgeStyles = {
- 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 getType
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
static getType(object) {
var type = typeof object;
if (type === 'object') {
if (object === 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 _onGroupDrag
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
ItemSet.prototype._onGroupDrag = function (event) {
if (this.options.groupEditable.order && this.groupTouchParams.group) {
event.stopPropagation();
var groupsData = this.groupsData;
Function Graph2d
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Graph2d (container, items, groups, options) {
// if the third element is options, the forth is groups (optionally);
if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {
var forthArgument = options;
options = groups;
PhysicsEngine
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class PhysicsEngine {
/**
* @param {Object} body
*/
constructor(body) {
Edge
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Edge {
/**
* @param {Object} options values specific to this edge, must contain at least 'from' and 'to'
* @param {Object} body shared state from Network instance
* @param {Object} globalOptions options from the EdgesHandler instance
Configurator
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Configurator {
/**
* @param {Object} parentModule | the location where parentModule.setOptions() can be called
* @param {Object} defaultContainer | the default container of the module
* @param {Object} configureOptions | the fully configured and predefined options set found in allOptions.js
Function Network
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Network(container, data, options) {
if (!(this instanceof Network)) {
throw new SyntaxError('Constructor must be called with the new operator');
}