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) {
Severity: Minor
Found in lib/network/modules/components/Edge.js - About 3 hrs to fix

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;
Severity: Major
Found in lib/graph3d/Graph3d.js - About 3 hrs to fix

    File BarnesHutSolver.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Barnes Hut Solver
     */
    class BarnesHutSolver {
      /**
    Severity: Minor
    Found in lib/network/modules/components/physics/BarnesHutSolver.js - About 3 hrs to fix

      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;
      Severity: Major
      Found in lib/timeline/component/LineGraph.js - About 3 hrs to fix

        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) {
        Severity: Major
        Found in lib/timeline/Range.js - About 3 hrs to fix

          Label has 26 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Label {
          
            /**
             * @param {Object} body
             * @param {Object} options
          Severity: Minor
          Found in lib/network/modules/components/shared/Label.js - About 3 hrs to fix

            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;
            
            
            Severity: Major
            Found in lib/timeline/component/DataScale.js - About 2 hrs to fix

              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];
              Severity: Minor
              Found in lib/timeline/component/Group.js - About 2 hrs to fix

              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) });
              Severity: Minor
              Found in lib/util.js - About 2 hrs to fix

              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);
              Severity: Minor
              Found in lib/graph3d/DataGroup.js - About 2 hrs to fix

              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];
              
              
              Severity: Minor
              Found in lib/network/modules/components/shared/LabelAccumulator.js - About 2 hrs to fix

              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();
              Severity: Minor
              Found in lib/shared/Configurator.js - About 2 hrs to fix

              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 = {
              Severity: Minor
              Found in lib/network/dotparser.js - About 2 hrs to fix

              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) {
              Severity: Minor
              Found in lib/shared/Validator.js - About 2 hrs to fix

              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;
              Severity: Major
              Found in lib/timeline/component/ItemSet.js - About 2 hrs to fix

                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;
                Severity: Major
                Found in lib/timeline/Graph2d.js - About 2 hrs to fix

                  PhysicsEngine has 25 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PhysicsEngine {
                    /**
                     * @param {Object} body
                     */
                    constructor(body) {
                  Severity: Minor
                  Found in lib/network/modules/PhysicsEngine.js - About 2 hrs to fix

                    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
                    Severity: Minor
                    Found in lib/network/modules/components/Edge.js - About 2 hrs to fix

                      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
                      Severity: Minor
                      Found in lib/shared/Configurator.js - About 2 hrs to fix

                        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');
                          }
                        
                        
                        Severity: Major
                        Found in lib/network/Network.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language