CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  _addNotification: function (notificationId, notificationAttrs) {
    notificationAttrs = _.extend({
      id: notificationId
    }, notificationAttrs);
    Notifier.addNotification(notificationAttrs);
Severity: Major
Found in lib/assets/javascripts/builder/sql-notifications.js and 3 other locations - About 30 mins to fix
lib/assets/javascripts/builder/cartocss-notifications.js on lines 56..61
lib/assets/javascripts/builder/editor/layers/analysis-views/analysis-notifications.js on lines 112..117
lib/assets/javascripts/builder/widgets-notifications.js on lines 122..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

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

  _addNotification: function (notificationId, notificationAttrs) {
    notificationAttrs = _.extend({
      id: notificationId
    }, notificationAttrs);

Severity: Major
Found in lib/assets/javascripts/builder/widgets-notifications.js and 3 other locations - About 30 mins to fix
lib/assets/javascripts/builder/cartocss-notifications.js on lines 56..61
lib/assets/javascripts/builder/editor/layers/analysis-views/analysis-notifications.js on lines 112..117
lib/assets/javascripts/builder/sql-notifications.js on lines 52..57

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

  _addNotification: function (notificationId, notificationAttrs) {
    notificationAttrs = _.extend({
      id: notificationId
    }, notificationAttrs);
    Notifier.addNotification(notificationAttrs);
lib/assets/javascripts/builder/cartocss-notifications.js on lines 56..61
lib/assets/javascripts/builder/sql-notifications.js on lines 52..57
lib/assets/javascripts/builder/widgets-notifications.js on lines 122..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 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({
      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({
      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({
      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 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({
      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 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/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

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

      if (quotaPer > 75 && quotaPer < 90) {
        progressState = 'alert';
      } else if (quotaPer >= 90) {
        progressState = 'caution';
      }
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/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 = '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 = 'caution';
    } else if (usedDataPct > 89) {
      progressBarClass = 'danger';
    }
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/dashboard-header/settings-dropdown-view.js on lines 66..70

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 90..92
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 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

    _remove: function(e) {
      e.preventDefault();
      e.stopPropagation();

      this.model.destroy();
lib/assets/javascripts/cartodb/table/menu_modules/filters/selection.js on lines 487..493

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

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

  equals: function (otherUser) {
    if (otherUser.get) {
      return this.get('id') === otherUser.get('id');
    }
  },
Severity: Minor
Found in lib/assets/javascripts/dashboard/data/user-model.js and 1 other location - About 30 mins to fix
lib/assets/javascripts/cartodb/models/user.js on lines 212..216

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

    this.chart.selectAll('.CDB-Chart-bar')
      .classed('is-highlighted', false)
      .attr('fill', this._getFillColor.bind(this));
Severity: Minor
Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 30 mins to fix
lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1557..1560

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