Showing 835 of 1,558 total issues

Function _updateContents has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

Item.prototype._updateContents = function (element) {
  var content;
  var changed;
  var templateFunction;
  var itemVisibleFrameContent;
Severity: Minor
Found in lib/timeline/component/item/Item.js - About 5 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 layoutNetwork has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

  layoutNetwork() {
    if (this.options.hierarchical.enabled !== true && this.options.improvedLayout === true) {
      let indices = this.body.nodeIndices;

      // first check if we should Kamada Kawai to layout. The threshold is if less than half of the visible
Severity: Minor
Found in lib/network/modules/LayoutEngine.js - About 5 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 clusterByConnection has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

  clusterByConnection(nodeId, options, refreshData = true) {
    // kill conditions
    if (nodeId === undefined)             {throw new Error("No nodeId supplied to clusterByConnection!");}
    if (this.body.nodes[nodeId] === undefined) {throw new Error("The nodeId given to clusterByConnection does not exist!");}

Severity: Minor
Found in lib/network/modules/Clustering.js - About 5 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 showManipulatorToolbar has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

  showManipulatorToolbar() {
    // restore the state of any bound functions or events, remove control nodes, restore physics
    this._clean();

    // reset global variables
Severity: Minor
Found in lib/network/modules/ManipulationSystem.js - About 5 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 _redrawAxis has 135 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Graph3d.prototype._redrawAxis = function() {
  var ctx = this._getContext(),
    from, to, step, prettyStep,
    text, xText, yText, zText,
    offset, xOffset, yOffset;
Severity: Major
Found in lib/graph3d/Graph3d.js - About 5 hrs to fix

    Function _redrawItems has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    Group.prototype._redrawItems = function(forceRestack, lastIsVisible, margin, range) {
      var restack = forceRestack || this.stackDirty || this.isVisible && !lastIsVisible;
    
      // if restacking, reposition visible items vertically
      if (restack) {
    Severity: Minor
    Found in lib/timeline/component/Group.js - About 5 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 getIds has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    DataSet.prototype.getIds = function (options) {
      var data = this._data,
          filter = options && options.filter,
          order = options && options.order,
          type = options && options.type || this._options.type,
    Severity: Minor
    Found in lib/DataSet.js - About 5 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

    SelectionHandler has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SelectionHandler {
      /**
       * @param {Object} body
       * @param {Canvas} canvas
       */
    Severity: Minor
    Found in lib/network/modules/SelectionHandler.js - About 5 hrs to fix

      Function getDataRange has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      Graph2d.prototype.getDataRange = function() {
        var min = null;
        var max = null;
      
        // calculate min from start filed
      Severity: Minor
      Found in lib/timeline/Graph2d.js - About 5 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 _checkShowPopup has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

       _checkShowPopup(pointer) {
          let x = this.canvas._XconvertDOMtoCanvas(pointer.x);
          let y = this.canvas._YconvertDOMtoCanvas(pointer.y);
          let pointerObj = {
            left:   x,
      Severity: Minor
      Found in lib/network/modules/InteractionHandler.js - About 5 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 _cluster has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

        _cluster(childNodesObj, childEdgesObj, options, refreshData = true) {
          // Remove nodes which are already clustered
          var tmpNodesToRemove = []
          for (let nodeId in childNodesObj) {
            if (childNodesObj.hasOwnProperty(nodeId)) {
      Severity: Minor
      Found in lib/network/modules/Clustering.js - About 5 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 convert has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.convert = function (object, type) {
        var match;
      
        if (object === undefined) {
          return undefined;
      Severity: Major
      Found in lib/util.js - About 5 hrs to fix

        Function solve has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

          solve() {
            var edgeLength, edge;
            var dx, dy, fx, fy, springForce, distance;
            var edges = this.body.edges;
            var factor = 0.5;
        Severity: Minor
        Found in lib/network/modules/components/physics/HierarchicalSpringSolver.js - About 4 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 constructor has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor(body, images, groups, layoutEngine) {
            this.body = body;
            this.images = images;
            this.groups = groups;
            this.layoutEngine = layoutEngine;
        Severity: Major
        Found in lib/network/modules/NodesHandler.js - About 4 hrs to fix

          File NodesHandler.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          let util = require("../../util");
          let DataSet = require('../../DataSet');
          let DataView = require('../../DataView');
          var Node = require("./components/Node").default;
          
          
          Severity: Minor
          Found in lib/network/modules/NodesHandler.js - About 4 hrs to fix

            File Node.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var util = require('../../../util');
            
            var Label = require('./shared/Label').default;
            var ComponentUtil = require('./shared/ComponentUtil').default;
            var Box = require('./nodes/shapes/Box').default;
            Severity: Minor
            Found in lib/network/modules/components/Node.js - About 4 hrs to fix

              File LabelSplitter.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              let LabelAccumulator = require('./LabelAccumulator').default;
              let ComponentUtil = require('./ComponentUtil').default;
              
              
              /**
              Severity: Minor
              Found in lib/network/modules/components/shared/LabelSplitter.js - About 4 hrs to fix

                Function process has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                  process(text) {
                    if (!ComponentUtil.isValidLabel(text)) {
                      return this.lines.finalize();
                    }
                
                
                Severity: Minor
                Found in lib/network/modules/components/shared/LabelSplitter.js - About 4 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 show has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                  show(doShow) {
                    if (doShow === undefined) {
                      doShow = true;
                    }
                
                
                Severity: Minor
                Found in lib/shared/Popup.js - About 4 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 _redraw has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Core.prototype._redraw = function() {
                  this.redrawCount++;
                  var resized = false;
                  var options = this.options;
                  var props = this.props;
                Severity: Major
                Found in lib/timeline/Core.js - About 4 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language