Showing 835 of 1,558 total issues

Function parseOptions has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static parseOptions(parentOptions, newOptions, allowDeletion = false, globalOptions = {}, copyFromGlobals = false) {
    var fields = [
      'arrowStrikethrough',
      'id',
      'from',
Severity: Major
Found in lib/network/modules/components/Edge.js - About 4 hrs to fix

    File EdgeBase.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    let util = require("../../../../../util");
    let EndPoints = require("./EndPoints").default;
    
    
    /**
    Severity: Minor
    Found in lib/network/modules/components/edges/util/EdgeBase.js - About 4 hrs to fix

      File TimeAxis.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var util = require('../../util');
      var Component = require('./Component');
      var TimeStep = require('../TimeStep');
      var DateUtil = require('../DateUtil');
      var moment = require('../../module/moment');
      Severity: Minor
      Found in lib/timeline/component/TimeAxis.js - About 4 hrs to fix

        File Item.js has 338 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var Hammer = require('../../../module/hammer');
        var util = require('../../../util');
        var moment = require('../../../module/moment');
        
        
        
        Severity: Minor
        Found in lib/timeline/component/item/Item.js - About 4 hrs to fix

          Function _onAddItem has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          ItemSet.prototype._onAddItem = function (event) {
            if (!this.options.selectable) return;
            if (!this.options.editable.add) return;
          
            var me = this;
          Severity: Minor
          Found in lib/timeline/component/ItemSet.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 setOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          Network.prototype.setOptions = function (options) {
            if (options !== undefined) {
              let errorFound = Validator.validate(options, allOptions);
              if (errorFound === true) {
                console.log('%cErrors have been found in the supplied options object.', printStyle);
          Severity: Minor
          Found in lib/network/Network.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 snap has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          TimeStep.snap = function(date, scale, step) {
            var clone = moment(date);
          
            if (scale == 'year') {
              var year = clone.year() + Math.round(clone.month() / 12);
          Severity: Major
          Found in lib/timeline/TimeStep.js - About 4 hrs to fix

            Function _getViaCoordinates has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _getViaCoordinates() {
                // Assumption: x/y coordinates in from/to always defined
                let xVia = undefined;
                let yVia = undefined;
                let factor = this.options.smooth.roundness;
            Severity: Major
            Found in lib/network/modules/components/edges/BezierEdgeStatic.js - About 4 hrs to fix

              Function _repaintLabels has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              TimeAxis.prototype._repaintLabels = function () {
                var orientation = this.options.orientation.axis;
              
                // calculate range and step (step such that we have space for 7 characters per label)
                var start = util.convert(this.body.range.start, 'Number');
              Severity: Major
              Found in lib/timeline/component/TimeAxis.js - About 4 hrs to fix

                File DateUtil.js has 332 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                
                /**
                 * used in Core to convert the options into a volatile variable
                 * 
                 * @param {function} moment
                Severity: Minor
                Found in lib/timeline/DateUtil.js - About 4 hrs to fix

                  File EdgesHandler.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

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

                    Core.prototype.setOptions = function (options) {
                      if (options) {
                        // copy the known options
                        var fields = [
                          'width', 'height', 'minHeight', 'maxHeight', 'autoResize',
                    Severity: Major
                    Found in lib/timeline/Core.js - About 3 hrs to fix

                      Function constructor has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function snap has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        TimeStep.snap = function(date, scale, step) {
                          var clone = moment(date);
                        
                          if (scale == 'year') {
                            var year = clone.year() + Math.round(clone.month() / 12);
                        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 _dataPointFromXY has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Graph3d.prototype._dataPointFromXY = function (x, y) {
                          var i,
                            distMax = 100, // px
                            dataPoint = null,
                            closestDataPoint = null,
                        Severity: Minor
                        Found in lib/graph3d/Graph3d.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 _updateGraph has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        LineGraph.prototype._updateGraph = function () {
                          // reset the svg elements
                          DOMutil.prepareElements(this.svgElements);
                          if (this.props.width != 0 && this.itemsData != null) {
                            var group, i;
                        Severity: Major
                        Found in lib/timeline/component/LineGraph.js - About 3 hrs to fix

                          Function _create has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _create() {
                              this.frame = document.createElement('div');
                              this.frame.className = 'vis-color-picker';
                          
                              this.colorPickerDiv = document.createElement('div');
                          Severity: Major
                          Found in lib/shared/ColorPicker.js - About 3 hrs to fix

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

                            var assert = require('assert');
                            var util = require('../lib/util');
                            
                            
                            describe('util', function () {
                            Severity: Minor
                            Found in test/util.test.js - About 3 hrs to fix

                              ClusterEngine has 31 functions (exceeds 20 allowed). Consider refactoring.
                              Open

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

                                Function minimizeEdgeLength has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    let minimizeEdgeLength = (iterations, node) => {
                                      //window.CALLBACKS.push(() => {
                                      //  console.log("ts",node.id);
                                        let nodeId = node.id;
                                        let allEdges = node.edges;
                                Severity: Major
                                Found in lib/network/modules/LayoutEngine.js - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language