CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  _initBinds: function () {
    this.listenTo(this._organizationAssetCollection, 'reset', this.render);
    this.listenTo(this._organizationAssetCollection, 'change', this._onChangeAssets);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function () {
    this._model.bind('change:state', this._checkVisibility, this);
    this._model.bind('change:errorMessage', this.render, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function () {
    this.listenTo(this._carouselCollection, 'change:selected', this._onSelectAsset);
    this.listenTo(this._carouselCollection, 'reset', this.render);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function () {
    this.listenTo(this.model, 'change:show', this._onShowChange);
    this.listenTo(this.model, 'destroy', this._onDestroy);
  },
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function () {
    this.listenTo(this._orgUsers, 'change:selected', this._onChangeSelected);
    this.listenTo(this.model, 'change:state', this.render);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function() {
    this.model.bind('change', this.render, this);
    this.model.bind('remove', this.clean, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function () {
    this._model.on('importAdded', this._addImport, this);
    this._model.on('importByUploadData', this._addDataset, this);
  },
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function () {
    this.model.bind('change:state', this._checkVisibility, this);
    this.model.bind('change:errorMessages', this.render, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function() {
    this.model.bind('error valid', this._setFieldStyle, this);
    this.model.bind('change:readOnly', this.render, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100

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

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

  _initBinds: function () {
    this.model.bind('change', this.render, this);
    this.model.bind('destroy', this.remove, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function () {
    this.model.bind('change:state', this._checkVisibility, this);
    this.model.bind('change:errorMessages', this.render, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function () {
    this.listenTo(this._formView, 'change', this._updateChanges);
    this.listenTo(this._formModel, 'change:width change:height', this._updateSchema);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function () {
    this.listenTo(this.model, 'change:selected', this._onSelectedChanged);
    this.listenTo(this.model, 'change:deleted', this._onDeletedChanged);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function () {
    this.model.bind('remove:fields', this._renderDescription, this);
    this.model.bind('add:fields', this._renderDescription, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view.js on lines 117..120
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

            if (!cm.state.completionActive && str.length > 2 && list.length > 0) {
              self._showAutocomplete(cm)
            }
lib/assets/javascripts/cartodb/table/menu_modules/carto_editor.js on lines 224..226
lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_html_pane.js on lines 111..113
lib/assets/javascripts/cartodb/table/menu_modules/sql.js on lines 252..254

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

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

  _initBinds: function () {
    this.listenTo(this.model, 'change:index', this._onChangeIndex);
    this.listenTo(this.model, 'change:opacity', this._onOpacityChanged);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function () {
    this.listenTo(this._routeModel, 'change:currentRoute', this._handleRoute);
    this.listenTo(this._editorModel, 'change:edition', this._changeStyle);
  },
Severity: Major
Found in lib/assets/javascripts/builder/editor/editor-map-view.js and 22 other locations - About 50 mins to fix
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  initialize: function () {
    this.listenTo(this.model, 'change:show', this._onShowChange);
    this.listenTo(this.model, 'destroy', this._onDestroy);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 44..47
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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

  _initBinds: function() {
    this.model.bind('change:state', this._checkState, this);
    this.model.bind('change', this._triggerChange, this);
  },
lib/assets/javascripts/builder/components/background-importer/background-importer.js on lines 61..64
lib/assets/javascripts/builder/components/custom-list/custom-view.js on lines 101..104
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 86..89
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 57..60
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-query-form-view.js on lines 50..53
lib/assets/javascripts/builder/components/pagination-search/pagination-search-model.js on lines 28..31
lib/assets/javascripts/builder/components/table/body/table-body-row-view.js on lines 44..47
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-fields-view.js on lines 28..31
lib/assets/javascripts/cartodb/common/background_polling/views/geocodings/background_geocoding_item_view.js on lines 55..58
lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 102..105
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_loader_view.js on lines 34..37
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_form_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/georeference/tab_item_view.js on lines 36..39
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/footer_view.js on lines 40..43
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/spatial_merge/merge_method_view.js on lines 51..54
lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 97..100
lib/assets/javascripts/cartodb/common/edit_fields/edit_field_view.js on lines 49..52

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

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

  _initBinds: function () {
    this.listenTo(this._layerDefinitionModel, 'change:cartocss', this._updateEditorContent);
    this.listenTo(this._overlayModel, 'change:visible', this._toggleOverlay);
  },
lib/assets/javascripts/builder/components/dialog/dialog-view.js on lines 29..32
lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime-dialog-view.js on lines 24..27
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 25..28
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 52..55
lib/assets/javascripts/builder/components/input-color/assets-picker/organization-assets-list-view.js on lines 32..35
lib/assets/javascripts/builder/components/input-color/input-color-file-view.js on lines 38..41
lib/assets/javascripts/builder/components/input-color/input-color-picker/input-color-picker-view.js on lines 38..41
lib/assets/javascripts/builder/components/modals/add-widgets/category/category-option-view.js on lines 76..79
lib/assets/javascripts/builder/components/onboardings/onboarding-view.js on lines 11..14
lib/assets/javascripts/builder/components/table/editors/editor-view.js on lines 6..9
lib/assets/javascripts/builder/components/toggler/toggler-view.js on lines 53..56
lib/assets/javascripts/builder/dataset/dataset-content/dataset-content-options-view.js on lines 59..62
lib/assets/javascripts/builder/editor/editor-map-view.js on lines 193..196
lib/assets/javascripts/builder/editor/export-image-pane/export-image-form-view.js on lines 39..42
lib/assets/javascripts/builder/editor/layers/analysis-views/source-layer-analysis-view.js on lines 119..122
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 33..36
lib/assets/javascripts/dashboard/views/dashboard/background-polling/background-polling-view.js on lines 48..51
lib/assets/javascripts/dashboard/views/dashboard/dialogs/change-privacy/start-view.js on lines 64..67
lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 108..111
lib/assets/javascripts/dashboard/views/organization/groups-admin/add-group-users/add-group-users-view.js on lines 125..128
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-view.js on lines 30..33
lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icons-view.js on lines 53..56

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

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