CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  _initBinds: function() {
    this.collection.bind('change:state', this._onChangeState, this);
    this.add_related_model(this.collection);
  },
lib/assets/javascripts/builder/components/background-importer/background-import-limit-view.js on lines 28..31
lib/assets/javascripts/builder/components/modals/add-layer/content/datasets/datasets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/modals/dataset-metadata/dataset-metadata-view.js on lines 99..102
lib/assets/javascripts/builder/components/modals/editor-visualization-warning/editor-visualization-warning-view.js on lines 39..42
lib/assets/javascripts/builder/components/modals/map-metadata/map-metadata-view.js on lines 93..96
lib/assets/javascripts/builder/components/modals/publish/share-with-view.js on lines 75..78
lib/assets/javascripts/builder/editor/layers/analysis-views/default-layer-analysis-view.js on lines 46..49
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 35..38
lib/assets/javascripts/builder/editor/layers/share-button-view.js on lines 33..36
lib/assets/javascripts/builder/editor/settings/preview/preview-options-view.js on lines 36..39
lib/assets/javascripts/builder/editor/style/style-form/style-form-view.js on lines 44..47
lib/assets/javascripts/cartodb/common/dialogs/georeference/choose_geometry_view.js on lines 72..75
lib/assets/javascripts/cartodb/table/menu_modules/wizards/category_wizard.js on lines 160..163

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 46.

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 15 locations. Consider refactoring.
Open

  _initBinds: function () {
    this._notification.on('notification:close', this._closeHandler, this);
    this.add_related_model(this._notification);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/datasets/datasets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/modals/dataset-metadata/dataset-metadata-view.js on lines 99..102
lib/assets/javascripts/builder/components/modals/editor-visualization-warning/editor-visualization-warning-view.js on lines 39..42
lib/assets/javascripts/builder/components/modals/map-metadata/map-metadata-view.js on lines 93..96
lib/assets/javascripts/builder/components/modals/publish/share-with-view.js on lines 75..78
lib/assets/javascripts/builder/editor/layers/analysis-views/default-layer-analysis-view.js on lines 46..49
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 35..38
lib/assets/javascripts/builder/editor/layers/share-button-view.js on lines 33..36
lib/assets/javascripts/builder/editor/settings/preview/preview-options-view.js on lines 36..39
lib/assets/javascripts/builder/editor/style/style-form/style-form-view.js on lines 44..47
lib/assets/javascripts/cartodb/common/background_polling/views/analysis/background_analysis_item_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/georeference/choose_geometry_view.js on lines 72..75
lib/assets/javascripts/cartodb/table/menu_modules/wizards/category_wizard.js on lines 160..163

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 46.

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 15 locations. Consider refactoring.
Open

  _initBinds: function () {
    this._acl.on('fetch', this.render, this);
    this.add_related_model(this._acl);
  },
lib/assets/javascripts/builder/components/background-importer/background-import-limit-view.js on lines 28..31
lib/assets/javascripts/builder/components/modals/add-layer/content/datasets/datasets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/modals/dataset-metadata/dataset-metadata-view.js on lines 99..102
lib/assets/javascripts/builder/components/modals/editor-visualization-warning/editor-visualization-warning-view.js on lines 39..42
lib/assets/javascripts/builder/components/modals/map-metadata/map-metadata-view.js on lines 93..96
lib/assets/javascripts/builder/editor/layers/analysis-views/default-layer-analysis-view.js on lines 46..49
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 35..38
lib/assets/javascripts/builder/editor/layers/share-button-view.js on lines 33..36
lib/assets/javascripts/builder/editor/settings/preview/preview-options-view.js on lines 36..39
lib/assets/javascripts/builder/editor/style/style-form/style-form-view.js on lines 44..47
lib/assets/javascripts/cartodb/common/background_polling/views/analysis/background_analysis_item_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/georeference/choose_geometry_view.js on lines 72..75
lib/assets/javascripts/cartodb/table/menu_modules/wizards/category_wizard.js on lines 160..163

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 46.

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 3 locations. Consider refactoring.
Open

    if (this.options.editorAttrs && this.options.editorAttrs.disabled) {
      this.$el.addClass('is-disabled');
    }
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime.js on lines 56..58
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 75..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 46.

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 15 locations. Consider refactoring.
Open

  _initBinds: function () {
    this._tablesCollection.bind('sync', this.render, this);
    this.add_related_model(this._tablesCollection);
  },
lib/assets/javascripts/builder/components/background-importer/background-import-limit-view.js on lines 28..31
lib/assets/javascripts/builder/components/modals/dataset-metadata/dataset-metadata-view.js on lines 99..102
lib/assets/javascripts/builder/components/modals/editor-visualization-warning/editor-visualization-warning-view.js on lines 39..42
lib/assets/javascripts/builder/components/modals/map-metadata/map-metadata-view.js on lines 93..96
lib/assets/javascripts/builder/components/modals/publish/share-with-view.js on lines 75..78
lib/assets/javascripts/builder/editor/layers/analysis-views/default-layer-analysis-view.js on lines 46..49
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 35..38
lib/assets/javascripts/builder/editor/layers/share-button-view.js on lines 33..36
lib/assets/javascripts/builder/editor/settings/preview/preview-options-view.js on lines 36..39
lib/assets/javascripts/builder/editor/style/style-form/style-form-view.js on lines 44..47
lib/assets/javascripts/cartodb/common/background_polling/views/analysis/background_analysis_item_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/georeference/choose_geometry_view.js on lines 72..75
lib/assets/javascripts/cartodb/table/menu_modules/wizards/category_wizard.js on lines 160..163

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 46.

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 3 locations. Consider refactoring.
Open

  _addTab: function(name, view) {
    this._contentPane.addTab(name, view.render());
    this.addView(view);
  },
lib/assets/javascripts/cartodb/common/dialogs/map/add_layer_view.js on lines 98..101
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker_view.js on lines 314..317

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 46.

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 3 locations. Consider refactoring.
Open

    if (this.options.editorAttrs && this.options.editorAttrs.disabled) {
      this.$el.addClass('is-disabled');
    }
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime.js on lines 56..58
lib/assets/javascripts/builder/components/form-components/editors/fill/fill.js on lines 71..73

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 46.

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 3 locations. Consider refactoring.
Open

    props.colorStyle = colorBinsStyle({
      breaks: { stats, method: 'quantiles', bins: 5 },
      colors: categoryIdPalette(categoryId)
    });
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 29..32
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 48..51

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 46.

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 3 locations. Consider refactoring.
Open

    props.colorStyle = colorBinsStyle({
      breaks: { stats, method: 'quantiles', bins: 5 },
      colors: categoryIdPalette(categoryId)
    });
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 48..51
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 67..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 46.

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 3 locations. Consider refactoring.
Open

    props.colorStyle = colorBinsStyle({
      breaks: { stats, method: 'quantiles', bins: 5 },
      colors: categoryIdPalette(categoryId)
    });
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 29..32
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 67..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 46.

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 15 locations. Consider refactoring.
Open

  _initBinds: function () {
    this._styleModel.bind('change:type', this.render, this);
    this.add_related_model(this._styleModel);
  },
lib/assets/javascripts/builder/components/background-importer/background-import-limit-view.js on lines 28..31
lib/assets/javascripts/builder/components/modals/add-layer/content/datasets/datasets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/modals/dataset-metadata/dataset-metadata-view.js on lines 99..102
lib/assets/javascripts/builder/components/modals/editor-visualization-warning/editor-visualization-warning-view.js on lines 39..42
lib/assets/javascripts/builder/components/modals/map-metadata/map-metadata-view.js on lines 93..96
lib/assets/javascripts/builder/components/modals/publish/share-with-view.js on lines 75..78
lib/assets/javascripts/builder/editor/layers/analysis-views/default-layer-analysis-view.js on lines 46..49
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 35..38
lib/assets/javascripts/builder/editor/layers/share-button-view.js on lines 33..36
lib/assets/javascripts/builder/editor/settings/preview/preview-options-view.js on lines 36..39
lib/assets/javascripts/cartodb/common/background_polling/views/analysis/background_analysis_item_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/georeference/choose_geometry_view.js on lines 72..75
lib/assets/javascripts/cartodb/table/menu_modules/wizards/category_wizard.js on lines 160..163

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 46.

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 3 locations. Consider refactoring.
Open

    if (this.options.editorAttrs && this.options.editorAttrs.disabled) {
      this.$el.addClass('is-disabled');
    }
lib/assets/javascripts/builder/components/form-components/editors/fill/fill.js on lines 71..73
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 75..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 46.

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 3 locations. Consider refactoring.
Open

  _addTab: function (name, view) {
    this._contentPane.addTab(name, view.render());
    this.addView(view);
  },
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker_view.js on lines 314..317
lib/assets/javascripts/cartodb/common/dialogs/sync_dataset/sync_dataset_view.js on lines 150..153

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 46.

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 3 locations. Consider refactoring.
Open

  _addTab: function (name, view) {
    this._contentPane.addTab(name, view.render());
    this.addView(view);
  },
lib/assets/javascripts/cartodb/common/dialogs/map/add_layer_view.js on lines 98..101
lib/assets/javascripts/cartodb/common/dialogs/sync_dataset/sync_dataset_view.js on lines 150..153

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 46.

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 6 locations. Consider refactoring.
Open

    if (this._isLayerHidden()) {
      this._infoboxModel.set({ state: 'layer-hidden' });
      this._overlayModel.set({ visible: true });
    } else if (this._deleteAnalysisModel.get('analysisId')) {
      this._infoboxModel.set({ state: 'deleting-analysis' });
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 172..178
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 445..452
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 341..352
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 329..340
lib/assets/javascripts/builder/editor/style/style-view.js on lines 453..464

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 46.

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 6 locations. Consider refactoring.
Open

    } else if (this._isLayerHidden()) {
      this._infoboxModel.set({ state: 'layer-hidden' });
      this._overlayModel.set({ visible: true });
    } else {
      this._codemirrorModel.set({ readonly: false });
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 169..178
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 172..178
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 341..352
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 329..340
lib/assets/javascripts/builder/editor/style/style-view.js on lines 453..464

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 46.

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 6 locations. Consider refactoring.
Open

    } else if (this._deleteAnalysisModel.get('analysisId')) {
      this._infoboxModel.set({ state: 'deleting-analysis' });
      this._overlayModel.set({ visible: true });
    } else {
      this._infoboxModel.set({ state: '' });
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 169..178
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 445..452
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 341..352
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 329..340
lib/assets/javascripts/builder/editor/style/style-view.js on lines 453..464

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 46.

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

    events: {
      'dblclick span.name': '_editAlias',
      'click .name_info a': '_goToLayer',
      'click .info':        '_switchTo',
      'click a.visibility': '_switchVisibility',
Severity: Major
Found in lib/assets/javascripts/cartodb/table/layer_panel_view.js and 4 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/table/export_image_view.js on lines 10..19
lib/assets/javascripts/cartodb/table/menu_modules/filters/selection.js on lines 87..96
lib/assets/javascripts/cartodb/table/overlays/image.js on lines 5..18
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 7..20

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 46.

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

    events: {
      'keypress input':           '_onKeyPress',
      'click a.apply':            '_onApply',
      'click a.remove':           '_remove',
      'click a.up':               '_move',
lib/assets/javascripts/cartodb/table/export_image_view.js on lines 10..19
lib/assets/javascripts/cartodb/table/layer_panel_view.js on lines 31..40
lib/assets/javascripts/cartodb/table/overlays/image.js on lines 5..18
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 7..20

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 46.

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

  events: {
    'click .js-ok': '_ok',
    'click .js-format': '_openFormatDropdow',
    'dblclick .js-format': 'killEvent',
    'click .js-advanced': '_openAdvancedExport',
Severity: Major
Found in lib/assets/javascripts/cartodb/table/export_image_view.js and 4 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/table/layer_panel_view.js on lines 31..40
lib/assets/javascripts/cartodb/table/menu_modules/filters/selection.js on lines 87..96
lib/assets/javascripts/cartodb/table/overlays/image.js on lines 5..18
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 7..20

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 46.

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