Showing 835 of 1,558 total issues

Function deepExtend has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

exports.deepExtend = function (a, b, protoExtend=false, allowDeletion=false) {
  for (var prop in b) {
    if (b.hasOwnProperty(prop) || protoExtend === true) {
      if (b[prop] && b[prop].constructor === Object) {
        if (a[prop] === undefined) {
Severity: Minor
Found in lib/util.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 setOptions has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  setOptions(options) {
    if (options !== undefined) {
      // use the parser from the Edge class to fill in all shorthand notations
      Edge.parseOptions(this.options, options, true, this.defaultOptions, true);

Severity: Minor
Found in lib/network/modules/EdgesHandler.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 solve has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  solve() {
    let edgeLength, edge;
    let edgeIndices = this.physicsBody.physicsEdgeIndices;
    let edges = this.body.edges;
    let node1, node2, node3;
Severity: Minor
Found in lib/network/modules/components/physics/SpringSolver.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 _applyRange has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Range.prototype._applyRange = function(start, end) {
  var newStart = (start != null) ? util.convert(start, 'Date').valueOf() : this.start,
      newEnd   = (end != null)   ? util.convert(end, 'Date').valueOf()   : this.end,
      max = (this.options.max != null) ? util.convert(this.options.max, 'Date').valueOf() : null,
      min = (this.options.min != null) ? util.convert(this.options.min, 'Date').valueOf() : null,
Severity: Major
Found in lib/timeline/Range.js - About 3 hrs to fix

    Function setOptions has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ItemSet.prototype.setOptions = function(options) {
      if (options) {
        // copy all options that we know
        var fields = [
          'type', 'rtl', 'align', 'order', 'stack', 'stackSubgroups', 'selectable', 'multiselect',
    Severity: Major
    Found in lib/timeline/component/ItemSet.js - About 3 hrs to fix

      Function get has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      DataSet.prototype.get = function (args) {  // eslint-disable-line no-unused-vars
        var me = this;
      
        // parse the arguments
        var id, ids, options;
      Severity: Major
      Found in lib/DataSet.js - About 3 hrs to fix

        Node has 27 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Node {
          /**
           *
           * @param {object} options An object containing options for the node. All
           *                            options are optional, except for the id.
        Severity: Minor
        Found in lib/network/modules/components/Node.js - About 3 hrs to fix

          Function getClassName has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          TimeStep.prototype.getClassName = function() {
            var _moment = this.moment;
            var m = this.moment(this.current);
            var current = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function
            var step = this.step;
          Severity: Major
          Found in lib/timeline/TimeStep.js - About 3 hrs to fix

            Function clusterByEdgeCount has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              clusterByEdgeCount(edgeCount, options, refreshData = true) {
                options = this._checkOptions(options);
                let clusters = [];
                let usedNodes = {};
                let edge, edges, relevantEdgeCount;
            Severity: Major
            Found in lib/network/modules/Clustering.js - About 3 hrs to fix

              Function _redrawLabels has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              DataAxis.prototype._redrawLabels = function () {
                var resized = false;
                DOMutil.prepareElements(this.DOMelements.lines);
                DOMutil.prepareElements(this.DOMelements.labels);
                var orientation = this.options['orientation'];
              Severity: Major
              Found in lib/timeline/component/DataAxis.js - About 3 hrs to fix

                Function redraw has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                ItemSet.prototype.redraw = function() {
                  var margin = this.options.margin,
                      range = this.body.range,
                      asSize = util.option.asSize,
                      options = this.options,
                Severity: Major
                Found in lib/timeline/component/ItemSet.js - About 3 hrs to fix

                  Function getItemRange has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Timeline.prototype.getItemRange = function () {
                    // get a rough approximation for the range based on the items start and end dates
                    var range = this.getDataRange();
                    var min = range.min !== null ? range.min.valueOf() : null;
                    var max = range.max !== null ? range.max.valueOf() : null;
                  Severity: Minor
                  Found in lib/timeline/Timeline.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 _redraw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Core.prototype._redraw = function() {
                    this.redrawCount++;
                    var resized = false;
                    var options = this.options;
                    var props = this.props;
                  Severity: Minor
                  Found in lib/timeline/Core.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 redraw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  DataAxis.prototype.redraw = function () {
                    var resized = false;
                    var activeGroups = 0;
                  
                    // Make sure the line container adheres to the vertical scrolling.
                  Severity: Minor
                  Found in lib/timeline/component/DataAxis.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 getClassName has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  TimeStep.prototype.getClassName = function() {
                    var _moment = this.moment;
                    var m = this.moment(this.current);
                    var current = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function
                    var step = this.step;
                  Severity: Minor
                  Found in lib/timeline/TimeStep.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 stackSubgroups has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.stackSubgroups = function(items, margin, subgroups) {
                    for (var subgroup in subgroups) {
                      if (subgroups.hasOwnProperty(subgroup)) {
                  
                  
                  
                  Severity: Minor
                  Found in lib/timeline/Stack.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 _updateUngrouped has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  ItemSet.prototype._updateUngrouped = function() {
                    var ungrouped = this.groups[UNGROUPED];
                    var item, itemId;
                  
                    if (this.groupsData) {
                  Severity: Minor
                  Found in lib/timeline/component/ItemSet.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 initDataAsMatrix has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  DataGroup.prototype.initDataAsMatrix = function(data) {
                    // TODO: store the created matrix dataPoints in the filters instead of
                    //       reloading each time.
                    var x, y, i, obj;
                  
                  
                  Severity: Minor
                  Found in lib/graph3d/DataGroup.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 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
                    Severity
                    Category
                    Status
                    Source
                    Language