Showing 835 of 1,558 total issues

Function convert has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

exports.convert = function (object, type) {
  var match;

  if (object === undefined) {
    return undefined;
Severity: Minor
Found in lib/util.js - About 7 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 a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

ItemSet.prototype._onGroupDrag = function (event) {
    if (this.options.groupEditable.order && this.groupTouchParams.group) {
        event.stopPropagation();
        
    var groupsData = this.groupsData;
Severity: Minor
Found in lib/timeline/component/ItemSet.js - About 7 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 SelectionHandler.js has 487 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Node = require('./components/Node').default;
var Edge = require('./components/Edge').default;

let util = require('../../util');

Severity: Minor
Found in lib/network/modules/SelectionHandler.js - About 7 hrs to fix

    File Configurator.js has 479 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var util = require('../util');
    
    var ColorPicker = require('./ColorPicker').default;
    
    /**
    Severity: Minor
    Found in lib/shared/Configurator.js - About 7 hrs to fix

      Function splitHtmlBlocks has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

        splitHtmlBlocks(text) {
          let blocks = [];
      
          // TODO: consolidate following + methods/closures with splitMarkdownBlocks()
          // NOTE: sequences of tabs and spaces are reduced to single space; scan usage of `this.spacing` within method
      Severity: Minor
      Found in lib/network/modules/components/shared/LabelSplitter.js - About 7 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 a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

      Group.prototype.setData = function(data) {
        // update contents
        var content;
        var templateFunction;
      
      
      Severity: Minor
      Found in lib/timeline/component/Group.js - About 6 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 _onEvent has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

      DataView.prototype._onEvent = function (event, params, senderId) {
        var i, len, id, item;
        var ids = params && params.items;
        var addedIds = [],
            updatedIds = [],
      Severity: Minor
      Found in lib/DataView.js - About 6 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 get has a Cognitive Complexity of 43 (exceeds 5 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: Minor
      Found in lib/DataSet.js - About 6 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 repositionX has a Cognitive Complexity of 42 (exceeds 5 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: Minor
      Found in lib/timeline/component/item/RangeItem.js - About 6 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 InteractionHandler.js has 434 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      let util = require('../../util');
      var NavigationHandler = require('./components/NavigationHandler').default;
      var Popup = require('./../../shared/Popup').default;
      
      
      
      Severity: Minor
      Found in lib/network/modules/InteractionHandler.js - About 6 hrs to fix

        File DataAxis.js has 430 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var util = require('../../util');
        var DOMutil = require('../../DOMutil');
        var Component = require('./Component');
        var DataScale = require('./DataScale');
        /**
        Severity: Minor
        Found in lib/timeline/component/DataAxis.js - About 6 hrs to fix

          Function next has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          TimeStep.prototype.next = function() {
            var prev = this.current.valueOf();
          
            // Two cases, needed to prevent issues with switching daylight savings
            // (end of March and end of October)
          Severity: Minor
          Found in lib/timeline/TimeStep.js - About 6 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 _getDataPoints has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          Graph3d.prototype._getDataPoints = 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/Graph3d.js - About 6 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

          ManipulationSystem has 45 functions (exceeds 20 allowed). Consider refactoring.
          Open

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

            Function draw has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            Bargraph.draw = function (groupIds, processedGroupData, framework) {
              var combinedData = [];
              var intersections = {};
              var coreDistance;
              var key, drawData;
            Severity: Minor
            Found in lib/timeline/component/graph2d_types/bar.js - About 6 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 a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

            Graph3d.prototype._redrawAxis = function() {
              var ctx = this._getContext(),
                from, to, step, prettyStep,
                text, xText, yText, zText,
                offset, xOffset, yOffset;
            Severity: Minor
            Found in lib/graph3d/Graph3d.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

            File Label.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Function Timeline has 145 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function Timeline (container, items, groups, options) {
              
                if (!(this instanceof Timeline)) {
                  throw new SyntaxError('Constructor must be called with the new operator');
                }
              Severity: Major
              Found in lib/timeline/Timeline.js - About 5 hrs to fix

                Function setOptions has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                LineGraph.prototype.setOptions = function (options) {
                  if (options) {
                    var fields = ['sampling', 'defaultGroup', 'stack', 'height', 'graphHeight', 'yAxisOrientation', 'style', 'barChart', 'dataAxis', 'sort', 'groups'];
                    if (options.graphHeight === undefined && options.height !== undefined) {
                      this.updateSVGheight = true;
                Severity: Minor
                Found in lib/timeline/component/LineGraph.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 ItemSet has 142 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function ItemSet(body, options) {
                  this.body = body;
                  this.defaultOptions = {
                    type: null,  // 'box', 'point', 'range', 'background'
                    orientation: {
                Severity: Major
                Found in lib/timeline/component/ItemSet.js - About 5 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language