Showing 835 of 1,558 total issues

Avoid too many return statements within this function.
Open

      return 'boolean';
Severity: Major
Found in lib/shared/Validator.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return 'undefined';
    Severity: Major
    Found in lib/shared/Validator.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return 'dom';
      Severity: Major
      Found in lib/shared/Validator.js - About 30 mins to fix

        Function _redrawTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        DataAxis.prototype._redrawTitle = function (orientation) {
          DOMutil.prepareElements(this.DOMelements.title);
        
          // Check if the title is defined for this axes
          if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {
        Severity: Minor
        Found in lib/timeline/component/DataAxis.js - About 25 mins 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 _updateScrollTop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Core.prototype._updateScrollTop = function () {
          // recalculate the scrollTopMin
          var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
          if (scrollTopMin != this.props.scrollTopMin) {
            // in case of bottom orientation, change the scrollTop such that the contents
        Severity: Minor
        Found in lib/timeline/Core.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
        Open

        DataView.prototype.get = function (args) {  // eslint-disable-line no-unused-vars
          var me = this;
        
          // parse the arguments
          var ids, options, data;
        Severity: Minor
        Found in lib/DataView.js - About 25 mins 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 _redrawGroupIcons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        DataAxis.prototype._redrawGroupIcons = function () {
          DOMutil.prepareElements(this.svgElements);
        
          var x;
          var iconWidth = this.options.iconWidth;
        Severity: Minor
        Found in lib/timeline/component/DataAxis.js - About 25 mins 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 handleCompilerCallback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function handleCompilerCallback (err, stats) {
          if (err) {
            gutil.log(err.toString());
          }
        
        
        Severity: Minor
        Found in gulpfile.js - About 25 mins 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 setGroups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Timeline.prototype.setGroups = function(groups) {
          // convert to type DataSet when needed
          var newDataSet;
          if (!groups) {
            newDataSet = null;
        Severity: Minor
        Found in lib/timeline/Timeline.js - About 25 mins 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 setItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        LineGraph.prototype.setItems = function (items) {
          var me = this,
            ids,
            oldItemsData = this.itemsData;
        
        
        Severity: Minor
        Found in lib/timeline/component/LineGraph.js - About 25 mins 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 _didMarkerHeightChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Group.prototype._didMarkerHeightChange = function() {
          var markerHeight = this.dom.marker.clientHeight;
          if (markerHeight != this.lastMarkerHeight) {
            this.lastMarkerHeight = markerHeight;
            var redrawQueue = {};
        Severity: Minor
        Found in lib/timeline/component/Group.js - About 25 mins 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 _repaintDragRight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        RangeItem.prototype._repaintDragRight = function () {
          if ((this.selected || this.options.itemsAlwaysDraggable.range) && this.options.editable.updateTime && !this.dom.dragRight) {
            // create and show drag area
            var dragRight = document.createElement('div');
            dragRight.className = 'vis-drag-right';
        Severity: Minor
        Found in lib/timeline/component/item/RangeItem.js - About 25 mins 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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        ItemSet.prototype.show = function() {
          // show frame containing the items
          if (!this.dom.frame.parentNode) {
            this.body.dom.center.appendChild(this.dom.frame);
          }
        Severity: Minor
        Found in lib/timeline/component/ItemSet.js - About 25 mins 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 _onDragStartAddItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        ItemSet.prototype._onDragStartAddItem = function (event) {
          var xAbs;
          var x;
          var snap = this.options.snap || null;
        
        
        Severity: Minor
        Found in lib/timeline/component/ItemSet.js - About 25 mins 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 _addToSubgroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Group.prototype._addToSubgroup = function(item, subgroupId) {
          subgroupId = subgroupId || item.data.subgroup;
          if (subgroupId != undefined && this.subgroups[subgroupId] === undefined) {
            this.subgroups[subgroupId] = {
              height:0,
        Severity: Minor
        Found in lib/timeline/component/Group.js - About 25 mins 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 _cloneItemData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        ItemSet.prototype._cloneItemData = function (itemData, type) {
          var clone = util.extend({}, itemData);
        
          if (!type) {
            // convert start and end date to the type (Date, Moment, ...) configured in the DataSet
        Severity: Minor
        Found in lib/timeline/component/ItemSet.js - About 25 mins 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 _checkIfVisibleWithReference has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Group.prototype._checkIfVisibleWithReference = function(item, visibleItems, visibleItemsLookup, range) {
          if (item.isVisible(range)) {
            if (visibleItemsLookup[item.id] === undefined) {
              visibleItemsLookup[item.id] = true;
              visibleItems.push(item);
        Severity: Minor
        Found in lib/timeline/component/Group.js - About 25 mins 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 _checkIfVisible has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Group.prototype._checkIfVisible = function(item, visibleItems, range) {
            if (item.isVisible(range)) {
              if (!item.displayed) item.show();
              // reposition item horizontally
              item.repositionX();
        Severity: Minor
        Found in lib/timeline/component/Group.js - About 25 mins 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 destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Network.prototype.destroy = function () {
          this.body.emitter.emit("destroy");
          // clear events
          this.body.emitter.off();
          this.off();
        Severity: Minor
        Found in lib/network/Network.js - About 25 mins 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 getHiddenDurationBefore has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.getHiddenDurationBefore = function(moment, hiddenDates, range, time) {
          var timeOffset = 0;
          time = moment(time).toDate().valueOf();
        
          for (var i = 0; i < hiddenDates.length; i++) {
        Severity: Minor
        Found in lib/timeline/DateUtil.js - About 25 mins 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