Showing 835 of 1,558 total issues

Function draw has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Bargraph.draw = function (groupIds, processedGroupData, framework) {
  var combinedData = [];
  var intersections = {};
  var coreDistance;
  var key, drawData;
Severity: Major
Found in lib/timeline/component/graph2d_types/bar.js - About 3 hrs to fix

    Function _getRelevantData has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    LineGraph.prototype._getRelevantData = function (groupIds, groupsData, minDate, maxDate) {
      var group, i, j, item;
      if (groupIds.length > 0) {
        for (i = 0; i < groupIds.length; i++) {
          group = this.groups[groupIds[i]];
    Severity: Minor
    Found in lib/timeline/component/LineGraph.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 getVisibleItems has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    ItemSet.prototype.getVisibleItems = function() {
      var range = this.body.range.getRange();
      var right, left;
    
      if (this.options.rtl) { 
    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

    LayoutEngine has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

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

      Function _repaintOnItemUpdateTimeTooltip has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      Item.prototype._repaintOnItemUpdateTimeTooltip = function (anchor) {
        if (!this.options.tooltipOnItemUpdateTime) return;
      
        var editable = (this.options.editable.updateTime || 
                        this.data.editable === true) &&
      Severity: Minor
      Found in lib/timeline/component/item/Item.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 hoverObject has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

        hoverObject(event, pointer) {
          let object = this.getNodeAt(pointer);
          if (object === undefined) {
            object = this.getEdgeAt(pointer);
          }
      Severity: Minor
      Found in lib/network/modules/SelectionHandler.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 25 (exceeds 5 allowed). Consider refactoring.
      Open

        setOptions(options, allOptions) {
          if (options !== undefined) {
            let hierarchical = this.options.hierarchical;
            let prevHierarchicalState = hierarchical.enabled;
            util.selectiveDeepExtend(["randomSeed", "improvedLayout"],this.options, options);
      Severity: Minor
      Found in lib/network/modules/LayoutEngine.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 parseGephi has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      function parseGephi(gephiJSON, optionsObj) {
        var edges = [];
        var nodes = [];
        var options = {
          edges: {
      Severity: Minor
      Found in lib/network/gephiParser.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

      File DataSet.test.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var assert = require('assert');
      var vis = require('../dist/vis');
      var moment = vis.moment;
      var DataSet = vis.DataSet;
      var Queue = vis.Queue;
      Severity: Minor
      Found in test/DataSet.test.js - About 3 hrs to fix

        Function _updateAllGroupData has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        LineGraph.prototype._updateAllGroupData = function (ids, groupIds) {
          if (this.itemsData != null) {
            var groupsContent = {};
            var items = this.itemsData.get();
            var fieldId = this.itemsData._fieldId;
        Severity: Major
        Found in lib/timeline/component/LineGraph.js - About 3 hrs to fix

          Function substack has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.substack = function (items, margin, subgroup) {
            for (var i = 0; i < items.length; i++) {
              items[i].top = null;
            }
          
          
          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 stack has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.stack = function(items, margin, force) {
            if (force) {
              // reset top position of all items
              for (var i = 0; i < items.length; i++) {
                items[i].top = null;
          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 redraw has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          Legend.prototype.redraw = function() {
            var activeGroups = 0;
            var groupArray = Object.keys(this.groups);
            groupArray.sort(function (a,b) {
              return (a < b ? -1 : 1);
          Severity: Minor
          Found in lib/timeline/component/Legend.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 focus has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          Timeline.prototype.focus = function(id, options) {
            if (!this.itemsData || id == undefined) return;
          
            var ids = Array.isArray(id) ? id : [id];
          
          
          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 _onDragStart has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          ItemSet.prototype._onDragStart = function (event) {
            if (this.touchParams.itemIsDragging) { return; }
            var item = this.touchParams.item || null;
            var me = this;
            var props;
          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 _drawText has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

            _drawText(ctx, x, y, baseline = 'middle', viewFontSize) {
              [x, y] = this._setAlignment(ctx, x, y, baseline);
          
              ctx.textAlign = 'left';
              x = x - this.size.width / 2; // Shift label 1/2-distance to the left
          Severity: Minor
          Found in lib/network/modules/components/shared/Label.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 setData has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Group.prototype.setData = function(data) {
            // update contents
            var content;
            var templateFunction;
          
          
          Severity: Major
          Found in lib/timeline/component/Group.js - About 3 hrs to fix

            Function repositionX has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            RangeItem.prototype.repositionX = function(limitSize) {
              var parentWidth = this.parent.width;
              var start = this.conversion.toScreen(this.data.start);
              var end = this.conversion.toScreen(this.data.end);
              var align = this.data.align === undefined ? this.options.align : this.data.align;
            Severity: Major
            Found in lib/timeline/component/item/RangeItem.js - About 3 hrs to fix

              Function LineGraph has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function LineGraph(body, options) {
                this.id = util.randomUUID();
                this.body = body;
              
                this.defaultOptions = {
              Severity: Major
              Found in lib/timeline/component/LineGraph.js - About 3 hrs to fix

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

                Line._catmullRom = function (data, group) {
                    var alpha = group.options.interpolation.alpha;
                    if (alpha == 0 || alpha === undefined) {
                        return this._catmullRomUniform(data);
                    }
                Severity: Minor
                Found in lib/timeline/component/graph2d_types/line.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

                Severity
                Category
                Status
                Source
                Language