Showing 835 of 1,558 total issues

File dotparser.js has 589 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Parse a text source containing data in DOT language into a JSON object.
 * The object contains two lists: one with nodes and one with edges.
 *
 * DOT language reference: http://www.graphviz.org/doc/info/lang.html
Severity: Major
Found in lib/network/dotparser.js - About 1 day to fix

    File options.js has 587 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * This object contains all possible options. It will check if the types are correct, if required if the option is one
     * of the allowed values.
     *
     * __any__ means that the name of the property does not matter.
    Severity: Major
    Found in lib/network/options.js - About 1 day to fix

      Function _updateYAxis has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

      LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
        var resized = false;
        var yAxisLeftUsed = false;
        var yAxisRightUsed = false;
        var minLeft = 1e9, minRight = 1e9, maxLeft = -1e9, maxRight = -1e9, minVal, maxVal;
      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

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

      var util = require('./util');
      var Queue = require('./Queue');
      
      /**
       * DataSet
      Severity: Major
      Found in lib/DataSet.js - About 1 day to fix

        Function _handleObject has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
        Open

          _handleObject(obj, path = [], checkOnly = false) {
            let show = false;
            let filter = this.options.filter;
            let visibleInSet = false;
            for (let subObj in obj) {
        Severity: Minor
        Found in lib/shared/Configurator.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 parseOptions has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
        Open

          static parseOptions(parentOptions, newOptions, allowDeletion = false, globalOptions = {}, copyFromGlobals = false) {
            var fields = [
              'arrowStrikethrough',
              'id',
              'from',
        Severity: Minor
        Found in lib/network/modules/components/Edge.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 getToken has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

        function getToken() {
          tokenType = TOKENTYPE.NULL;
          token = '';
        
          // skip over whitespaces
        Severity: Minor
        Found in lib/network/dotparser.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 _create has 224 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Core.prototype._create = function (container) {
          this.dom = {};
        
          this.dom.container = container;
        
        
        Severity: Major
        Found in lib/timeline/Core.js - About 1 day to fix

          Function setOptions has a Cognitive Complexity of 57 (exceeds 5 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: Minor
          Found in lib/timeline/component/ItemSet.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 openCluster has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
          Open

            openCluster(clusterNodeId, options, refreshData = true) {
              // kill conditions
              if (clusterNodeId === undefined) {
                throw new Error("No clusterNodeId supplied to openCluster.");
              }
          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 Range.js has 530 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var util = require('../util');
          var moment = require('../module/moment');
          var Component = require('./component/Component');
          var DateUtil = require('./DateUtil');
          
          
          Severity: Major
          Found in lib/timeline/Range.js - About 1 day to fix

            Function _create has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
            Open

            Core.prototype._create = function (container) {
              this.dom = {};
            
              this.dom.container = container;
            
            
            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

            Function adaptAllOptionsForHierarchicalLayout has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
            Open

              adaptAllOptionsForHierarchicalLayout(allOptions) {
                if (this.options.hierarchical.enabled === true) {
                  let backupPhysics = this.optionsBackup.physics;
            
                  // set the physics
            Severity: Minor
            Found in lib/network/modules/LayoutEngine.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 PhysicsEngine.js has 521 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var BarnesHutSolver = require('./components/physics/BarnesHutSolver').default;
            var Repulsion = require('./components/physics/RepulsionSolver').default;
            var HierarchicalRepulsion = require('./components/physics/HierarchicalRepulsionSolver').default;
            var SpringSolver = require('./components/physics/SpringSolver').default;
            var HierarchicalSpringSolver = require('./components/physics/HierarchicalSpringSolver').default;
            Severity: Major
            Found in lib/network/modules/PhysicsEngine.js - About 1 day to fix

              File Edge.js has 521 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              var util = require('../../../util');
              var Label = require('./shared/Label').default;
              var ComponentUtil = require('./shared/ComponentUtil').default;
              var CubicBezierEdge = require('./edges/CubicBezierEdge').default;
              var BezierEdgeDynamic = require('./edges/BezierEdgeDynamic').default;
              Severity: Major
              Found in lib/network/modules/components/Edge.js - About 1 day to fix

                Function _applyRange has a Cognitive Complexity of 53 (exceeds 5 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: Minor
                Found in lib/timeline/Range.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 setRange has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                Open

                Range.prototype.setRange = function(start, end, options, callback, frameCallback) {
                  if (!options) {
                    options = {};
                  }
                  if (options.byUser !== true) {
                Severity: Minor
                Found in lib/timeline/Range.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 TimeStep.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                var moment = require('../module/moment');
                var DateUtil = require('./DateUtil');
                var util = require('../util');
                
                /**
                Severity: Major
                Found in lib/timeline/TimeStep.js - About 1 day to fix

                  File Timeline.js has 504 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var moment = require('../module/moment');
                  var util = require('../util');
                  var DataSet = require('../DataSet');
                  var DataView = require('../DataView');
                  var Range = require('./Range');
                  Severity: Major
                  Found in lib/timeline/Timeline.js - About 1 day to fix

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

                    ItemSet.prototype._onMultiSelectItem = function (event) {
                      if (!this.options.selectable) return;
                    
                      var item = this.itemFromTarget(event);
                    
                    
                    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

                    Severity
                    Category
                    Status
                    Source
                    Language