CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

Identical blocks of code found in 4 locations. Consider refactoring.
Open

  _toggleOverlay: function () {
    var isDisabled = this._overlayModel.get('visible');
    this.$el.toggleClass('is-disabled', isDisabled);
  },
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 84..87
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 64..67
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 130..133

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

  _toggleOverlay: function () {
    var isDisabled = this._overlayModel.get('visible');
    this.$el.toggleClass('is-disabled', isDisabled);
  },
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-content-view.js on lines 106..109
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 84..87
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 64..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

  _toggleOverlay: function () {
    var isDisabled = this._overlayModel.get('visible');
    this.$el.toggleClass('is-disabled', isDisabled);
  },
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-content-view.js on lines 106..109
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 84..87
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 130..133

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      isDataFiltered: false
    });

lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      anyGeometryData: true
    });

Severity: Major
Found in lib/assets/javascripts/builder/editor/widgets/widgets-view.js and 6 other locations - About 30 mins to fix
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      canBeGeoreferenced: false
    });
    this._setViewState();
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      hasGeometry: true
    });
    this._setViewState();
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      isDataFiltered: false
    });

lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      hasGeom: true
    });
    this._setViewState();
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  _initViewState: function () {
    this._viewState = new Backbone.Model({
      isDataFiltered: false
    });

lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    if (usedDataPct > 80 && usedDataPct < 90) {
      progressBarClass = 'caution';
    } else if (usedDataPct > 89) {
      progressBarClass = 'danger';
    }
Severity: Major
Found in lib/assets/javascripts/cartodb/common/pages_subheader.js and 4 other locations - About 30 mins to fix
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 87..91
lib/assets/javascripts/cartodb/common/views/dashboard_header/settings_dropdown_view.js on lines 62..66
lib/assets/javascripts/dashboard/components/dashboard-header/settings-dropdown-view.js on lines 66..70
lib/assets/javascripts/dashboard/components/pages-subheader/pages-subheader.js on lines 22..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    if (usedDataPct > 80 && usedDataPct < 90) {
      progressBarClass = 'is--inAlert';
    } else if (usedDataPct > 89) {
      progressBarClass = 'is--inDanger';
    }
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 87..91
lib/assets/javascripts/cartodb/common/pages_subheader.js on lines 21..25
lib/assets/javascripts/cartodb/common/views/dashboard_header/settings_dropdown_view.js on lines 62..66
lib/assets/javascripts/dashboard/components/pages-subheader/pages-subheader.js on lines 22..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

  _transformErrors: function (errors) {
    return _.map(errors, function (err) {
      return err.message;
    }, this).join('. ');
  },
Severity: Minor
Found in lib/assets/javascripts/builder/cartocss-notifications.js and 1 other location - About 30 mins to fix
lib/assets/javascripts/builder/sql-notifications.js on lines 37..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    if (error) {
      window.trackJs && window.trackJs.console.log({
        type: 'Dashboard:',
        data: error
      });
Severity: Minor
Found in lib/assets/javascripts/builder/editor.js and 1 other location - About 30 mins to fix
lib/assets/javascripts/builder/public_editor.js on lines 72..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

  _createTooltip: function (opts) {
    return new TipsyTooltipView({
      el: opts.$el,
      title: function () {
        return opts.msg;
lib/assets/javascripts/builder/editor/layers/analysis-views/analyses-tooltip-error.js on lines 37..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      if (!_.contains(this._hidePanes, FillConstants.Panes.BY_VALUE)) {
        this._tabPaneTabs.push(valuePane);
      }
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 90..92
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 80..82
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 84..86

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      less_than: {
        type: 'Text',
        title: this._getMaxLabel(),
        validators: ['required'],
        editorAttrs: {
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js on lines 133..140
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js on lines 141..148
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js on lines 149..156

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      if (!_.contains(this._hidePanes, FillConstants.Panes.FIXED)) {
        this._tabPaneTabs.push(fixedPane);
      }
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 93..95
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 80..82
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 84..86

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

  _createTooltip: function (opts) {
    return new TipsyTooltipView({
      el: opts.$el,
      title: function () {
        return opts.msg;
lib/assets/javascripts/builder/components/modals/publish/share/share-permission-view.js on lines 121..128

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      greater_than_or_equal: {
        type: 'Text',
        title: this._getMinOrEqualLabel(),
        validators: ['required'],
        editorAttrs: {
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js on lines 141..148
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js on lines 149..156
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js on lines 157..164

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language