Showing 835 of 1,558 total issues

File ItemSet.js has 1554 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Hammer = require('../../module/hammer');
var util = require('../../util');
var DataSet = require('../../DataSet');
var DataView = require('../../DataView');
var TimeStep = require('../TimeStep');
Severity: Major
Found in lib/timeline/component/ItemSet.js - About 4 days to fix

    File Graph3d.js has 1358 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var Emitter = require('emitter-component');
    var util = require('../util');
    var Point3d = require('./Point3d');
    var Point2d = require('./Point2d');
    var Slider = require('./Slider');
    Severity: Major
    Found in lib/graph3d/Graph3d.js - About 3 days to fix

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

      /**
       * TODO - add tests for:
       * ====
       *
       * - html unclosed or unopened tags
      Severity: Major
      Found in test/Label.test.js - About 3 days to fix

        Function _condenseHierarchy has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
        Open

          _condenseHierarchy() {
            // Global var in this scope to define when the movement has stopped.
            let stillShifting = false;
            let branches = {};
            // first we have some methods to help shifting trees around.
        Severity: Minor
        Found in lib/network/modules/LayoutEngine.js - About 2 days 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 LayoutEngine.js has 1087 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        /**
         * There's a mix-up with terms in the code. Following are the formal definitions:
         *
         *   tree   - a strict hierarchical network, i.e. every node has at most one parent
        Severity: Major
        Found in lib/network/modules/LayoutEngine.js - About 2 days to fix

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

          // utility functions
          
          // first check if moment.js is already loaded in the browser window, if so,
          // use this instance. Else, load via commonjs.
          
          
          Severity: Major
          Found in lib/util.js - About 2 days to fix

            Function _updateGraph has a Cognitive Complexity of 106 (exceeds 5 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: Minor
            Found in lib/timeline/component/LineGraph.js - About 2 days 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 LineGraph.js has 802 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var util = require('../../util');
            var DOMutil = require('../../DOMutil');
            var DataSet = require('../../DataSet');
            var DataView = require('../../DataView');
            var Component = require('./Component');
            Severity: Major
            Found in lib/timeline/component/LineGraph.js - About 1 day to fix

              File Core.js has 801 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              var Emitter = require('emitter-component');
              var Hammer = require('../module/hammer');
              var hammerUtil = require('../hammerUtil');
              var util = require('../util');
              var TimeAxis = require('./component/TimeAxis');
              Severity: Major
              Found in lib/timeline/Core.js - About 1 day to fix

                Function clusterByEdgeCount has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
                Open

                  clusterByEdgeCount(edgeCount, options, refreshData = true) {
                    options = this._checkOptions(options);
                    let clusters = [];
                    let usedNodes = {};
                    let edge, edges, relevantEdgeCount;
                Severity: Minor
                Found in lib/network/modules/Clustering.js - About 1 day 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 Clustering.js has 790 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* ===========================================================================
                
                # TODO
                
                - `edgeReplacedById` not cleaned up yet on cluster edge removal
                Severity: Major
                Found in lib/network/modules/Clustering.js - About 1 day to fix

                  File ManipulationSystem.js has 783 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  
                  let util = require('../../util');
                  let Hammer = require('../../module/hammer');
                  let hammerUtil = require('../../hammerUtil');
                  
                  
                  Severity: Major
                  Found in lib/network/modules/ManipulationSystem.js - About 1 day to fix

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

                    /**
                     *
                     * Useful during debugging
                     * =======================
                     *
                    Severity: Major
                    Found in test/Network.test.js - About 1 day to fix

                      Function _getViaCoordinates has a Cognitive Complexity of 76 (exceeds 5 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: Minor
                      Found in lib/network/modules/components/edges/BezierEdgeStatic.js - About 1 day 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 Group.js has 659 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      var util = require('../../util');
                      var stack = require('../Stack');
                      
                      /**
                       * @param {number | string} groupId
                      Severity: Major
                      Found in lib/timeline/component/Group.js - About 1 day to fix

                        Function _updateAllGroupData has a Cognitive Complexity of 73 (exceeds 5 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: Minor
                        Found in lib/timeline/component/LineGraph.js - About 1 day 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 splitMarkdownBlocks has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
                        Open

                          splitMarkdownBlocks(text) {
                            let blocks = [];
                        
                            // TODO: consolidate following + methods/closures with splitHtmlBlocks()
                            // 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 1 day 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 _condenseHierarchy has 268 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _condenseHierarchy() {
                            // Global var in this scope to define when the movement has stopped.
                            let stillShifting = false;
                            let branches = {};
                            // first we have some methods to help shifting trees around.
                        Severity: Major
                        Found in lib/network/modules/LayoutEngine.js - About 1 day to fix

                          Function updateHiddenDates has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                          Open

                          exports.updateHiddenDates = function (moment, body, hiddenDates) {
                            if (hiddenDates && !Array.isArray(hiddenDates)) {
                              return exports.updateHiddenDates(moment, body, [hiddenDates])
                            }
                          
                          
                          Severity: Minor
                          Found in lib/timeline/DateUtil.js - About 1 day 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 66 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Core.prototype.setOptions = function (options) {
                            if (options) {
                              // copy the known options
                              var fields = [
                                'width', 'height', 'minHeight', 'maxHeight', 'autoResize',
                          Severity: Minor
                          Found in lib/timeline/Core.js - About 1 day 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