CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  deleteLike (itemId, callback) {
    const CONFIG_PATH = 'api/v1/viz';
    var opts = {
      dataType: 'json'
    };
Severity: Minor
Found in lib/assets/javascripts/carto-node/lib/clients/authenticated.js and 1 other location - About 35 mins to fix
lib/assets/javascripts/carto-node/lib/clients/authenticated.js on lines 53..59

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

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

  _initBinds: function () {
    this._sharePermissionModel.acl.on('add remove reset change', this._onSave, this);
    this.add_related_model(this._sharePermissionModel.acl);
  },
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/spatial_merge_view.js on lines 141..144

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

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

      onFocus: function() {
        if (self.model.isMetadataEditable()) {
          self.$('.js-tags').addClass('is-focus')
        }
      },
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 91..95

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

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

  showTitle: function(force) {

    if (force) this.model.set("force_hidden_title", false);
    this.model.set("show_title", true);

Severity: Minor
Found in lib/assets/javascripts/cartodb/table/overlays/mobile.js and 1 other location - About 35 mins to fix
lib/assets/javascripts/cartodb/table/overlays/mobile.js on lines 85..91

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

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

              fs.existsSync(fileGearPath) &&
              fs.lstatSync(fileGearPath).isDirectory() &&
              // Check that the file is not from outside the gear path
              // PE, using ../..
              resolve(fileGearPath).startsWith(gearPath)
Severity: Minor
Found in webpack/v4/gearAwareResolver.js and 1 other location - About 35 mins to fix
webpack/v4/gearAwareResolver.js on lines 26..30

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

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

    var bars = this.chart.append('g')
      .attr('transform', 'translate(0, 0)')
      .attr('class', 'CDB-Chart-bars')
      .selectAll('.CDB-Chart-bar')
      .data(data);
Severity: Minor
Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1662..1666

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

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

    this.chart.append('g')
      .attr('transform', 'translate(0, 0)')
      .attr('class', 'CDB-Chart-shadowBars')
      .selectAll('.CDB-Chart-shadowBar')
      .data(data)
Severity: Minor
Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1575..1579

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

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

  defaults: {
    ext: 'svg',
    folder: 'maki-icons',
    host: 'https://s3.amazonaws.com',
    bucket: 'com.cartodb.users-assets.production',
Severity: Minor
Found in lib/assets/javascripts/builder/data/static-asset-model.js and 1 other location - About 35 mins to fix
lib/assets/javascripts/new-dashboard/components/Catalog/map-styles/colorStyles.js on lines 4..14

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

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

const CATEGORY_PALETTES = {
  demographics: 'BrwnYl',
  environmental: 'BluGrn',
  derived: 'Teal',
  housing: 'Burg',
lib/assets/javascripts/builder/data/static-asset-model.js on lines 6..16

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

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

          fs.existsSync(fileGearPath) &&
          fs.lstatSync(fileGearPath).isFile() &&
          // Check that the file is not from outside the gear path
          // PE, using ../..
          resolve(fileGearPath).startsWith(gearPath)
Severity: Minor
Found in webpack/v4/gearAwareResolver.js and 1 other location - About 35 mins to fix
webpack/v4/gearAwareResolver.js on lines 50..54

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

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._stateModel.on('change:status', this.render, this);
    this.add_related_model(this._stateModel);
  },
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/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._querySchemaModel.on('change:query', this._onQueryChanged, this);
    this.add_related_model(this._querySchemaModel);
  },
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/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._settingsCollection.on('change', this._onChangeOptions, this);
    this.add_related_model(this._settingsCollection);
  },
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/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._stateModel.on('change:status', this.render, this);
    this.add_related_model(this._stateModel);
  },
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/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.availableGeometries.bind('change:available_geometries', this.render, this);
    this.add_related_model(this.availableGeometries);
  },
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/background_polling/views/analysis/background_analysis_item_view.js on lines 40..43
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._visDefinitionModel.on('change:visChanges', this.render, this);
    this.add_related_model(this._visDefinitionModel);
  },
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/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._modalModel.bind('change:show', this._goToDashboard, this);
    this.add_related_model(this._modalModel);
  },
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/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

    initialize: function() {
      this.collection.bind('add remove reset', this.render, 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/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

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._statModel.on('change:selected', this.render, this);
    this.add_related_model(this._statModel);
  },
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/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._stateModel.on('change:highlighted', this._toggleHover, this);
    this.add_related_model(this._stateModel);
  },
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/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

Severity
Category
Status
Source
Language