CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

      var viewModel = new cdb.editor.ChangeLockViewModel({
        items: [this.vis],
        contentType: this.vis.isVisualization() ? 'maps' : 'datasets'
      });
Severity: Minor
Found in lib/assets/javascripts/cartodb/table/table_editor_view.js and 1 other location - About 55 mins to fix
lib/assets/javascripts/cartodb/table/header/options_menu.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 53.

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 searchPagination = new SearchCategoryPaginatorView({
      widgetModel: this.model,
      dataviewModel: this._dataviewModel,
      itemsPerPage: this._ITEMS_PER_PAGE,
      paginator: true,
lib/assets/javascripts/deep-insights/widgets/category/content-view.js on lines 105..111

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

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

        isolines: {
          type: 'Number',
          title: _t('editor.layers.analysis-form.tracts'),
          help: _t('editor.layers.analysis-form.tracts-help'),
          validators: ['required', {
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model.js on lines 106..115

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

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

        if (this._userModel.isOrgAdmin()) {
          infoboxOpts.body = _t('editor.layers.max-layers-infowindow.org-admin.body', { maxLayers: this._getMaxCount() });
          infoboxOpts.action = { label: _t('editor.layers.max-layers-infowindow.org-admin.upgrade') };
        } else {
Severity: Minor
Found in lib/assets/javascripts/builder/editor/editor-pane.js and 1 other location - About 55 mins to fix
lib/assets/javascripts/builder/editor/editor-pane.js on lines 263..266

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

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

        } else {
          infoboxOpts.body = _t('editor.layers.max-layers-infowindow.org.body', { maxLayers: this._getMaxCount() });
          infoboxOpts.action = { label: _t('editor.layers.max-layers-infowindow.org.upgrade') };
        }
Severity: Minor
Found in lib/assets/javascripts/builder/editor/editor-pane.js and 1 other location - About 55 mins to fix
lib/assets/javascripts/builder/editor/editor-pane.js on lines 260..263

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

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

  render: function () {
    this.clearSubViews();
    this._removeFormView();
    this._renderForm();
    this._initBinds();
lib/assets/javascripts/dashboard/components/dashboard-header-view.js on lines 36..44

Duplicated Code

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

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

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

Tuning

This issue has a mass of 53.

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

  initialize: function () {
    this.template = cdb.templates
      .getTemplate('public/views/public_header_shared');

    this._initModels();
Severity: Minor
Found in lib/assets/javascripts/cartodb/common/public_header_view.js and 1 other location - About 55 mins to fix
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 25..29

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

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

  initialize: function (models, opts) {
    checkAndBuildOpts(opts, REQUIRED_OPTS, this);
    if (!opts.group) throw new Error('group is required');
    this.group = opts.group;
  },
Severity: Minor
Found in lib/assets/javascripts/dashboard/data/group-users-collection.js and 1 other location - About 55 mins to fix
lib/assets/javascripts/dashboard/data/organization-groups-collection.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 53.

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:template_name', this._renderItems);
    this.listenTo(this.model, 'change:template', this._updateEditor);
  },
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/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._infoboxModel, 'change:state', this._onChangeState);
    this.listenTo(this._infoboxModel, 'change:visible', 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 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

  _initSubviewBinds: function () {
    this.listenTo(this.infoboxView, 'action:main', this._onAction);
    this.listenTo(this.infoboxView, 'action:close', this._onClose);
  },
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/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

  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/onboardings/onboarding-view.js on lines 11..14
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:active', this.render);
    this.listenTo(this.model, 'change:disabled', 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/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:layer_index', this.render);
    this.listenTo(this.model, 'change:selected', 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/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._privacyOptions, 'change:selected change:disabled', this.render);
    this.listenTo(this._privacyOptions, 'change:password', this._onChangePassword);
  },
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/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('error', this._setFields, this);
    this.model.bind('valid', this._setFields, 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/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:selected', this.render, this);
    this.model.bind('change:disabled', 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/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

    this.$el
      .attr('data-val', this.model.getValue())
      .toggleClass('is-disabled', !!this.model.get('disabled'));
lib/assets/javascripts/builder/components/form-components/editors/node-dataset/node-dataset-item-view.js on lines 25..27
lib/assets/javascripts/builder/components/input-color/input-qualitative-ramps/categories-list/list-item-view/categories-list-item-view.js on lines 33..35
lib/assets/javascripts/builder/components/table/head/table-head-options-item-view.js on lines 36..38

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

    this.$el
      .attr('data-val', this.model.getValue())
      .toggleClass('is-disabled', !!this.model.get('disabled'));
lib/assets/javascripts/builder/components/custom-list/custom-list-item-view.js on lines 44..46
lib/assets/javascripts/builder/components/input-color/input-qualitative-ramps/categories-list/list-item-view/categories-list-item-view.js on lines 33..35
lib/assets/javascripts/builder/components/table/head/table-head-options-item-view.js on lines 36..38

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._stateModel, 'change:highlighted', this._toggleHover);
    this.listenTo(this._tableNodeModel, 'change:synchronization', 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/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

Severity
Category
Status
Source
Language