CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

    if (this._isErrored()) {
      this._renderError();
    } else if (this._viewState.get('isDataFiltered')) {
      this._renderFilteredData();
    } else {
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 47..53

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  _lowerXYZ: function () {
    return this.model.get('urlTemplate')
      .replace('{s}', this._getSubdomain())
      .replace('{z}', DEFAULT_ZOOM)
      .replace('{x}', DEFAULT_X_POSITION)
lib/assets/javascripts/builder/editor/layers/basemap-content-views/basemap-mosaic-item-view.js on lines 68..74

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

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

Router.supportTrailingSlashes = function(obj) {
  return _.reduce(obj, function(res, val, key) {
    res[key] = val;
    res[key + '/'] = val;
    return res;
Severity: Major
Found in lib/assets/javascripts/cartodb/common/router.js and 1 other location - About 1 hr to fix
lib/assets/javascripts/dashboard/common/router-base.js on lines 52..58

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

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

  setTableName: function (name) {
    if (!name) return;

    if (this._tableName) {
      this._tableName = name;
lib/assets/javascripts/builder/data/query-rows-collection.js on lines 298..308

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

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

      numerator_column: {
        type: 'Select',
        title: _t('editor.layers.analysis-form.numerator'),
        placeholder: _t('editor.layers.analysis-form.select-column'),
        options: this._columnOptions.filterByType('number'),
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/moran-form-model.js on lines 55..62

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

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

  setTableName: function (name) {
    if (!name) return;

    if (this._tableName) {
      this._tableName = name;
lib/assets/javascripts/builder/data/query-columns-collection.js on lines 48..58

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

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

RouterBase.supportTrailingSlashes = function (obj) {
  return _.reduce(obj, function (res, val, key) {
    res[key] = val;
    res[key + '/'] = val;
    return res;
Severity: Major
Found in lib/assets/javascripts/dashboard/common/router-base.js and 1 other location - About 1 hr to fix
lib/assets/javascripts/cartodb/common/router.js on lines 52..58

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

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

        editor: {
          type: 'Select',
          title: _t('editor.layers.analysis-form.normalize'),
          placeholder: _t('editor.layers.analysis-form.select-column'),
          options: this._columnOptions.filterByType('number'),
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/moran-form-model.js on lines 42..49

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

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

  _initBinds: function () {
    this.collection.bind('change', this._manageCategories, this);
    this.collection.bind('change', this._onCategoryChange, this);
    this.add_related_model(this.collection);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.column.bind('change:selected', this._onChangeSelected, this);
    this.column.bind('change:disabled', this._onChangeDisabled, this);
    this.add_related_model(this.column);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.createModel.bind('change', this.render, this);
    this.model.bind('change', this.render, this);
    this.add_related_model(this.createModel);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function () {
    this.model.bind('change:selected', this.render, this);

    this.widgetModel.bind('change:prefix change:suffix', this.render, this);
    this.add_related_model(this.widgetModel);
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55

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

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

  _initBinds: function () {
    this.collection.bind('sync', this.render, this);
    this.model.bind('change:state', this._checkVisibility, this);
    this.add_related_model(this.collection);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.model.bind('change:pane', this.render, this);
    this.model.bind('change:pane', this._enableFilter, this);
    this.add_related_model(this.model);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.fieldModel.bind('change:readOnly', this.render, this);
    this.fieldModel.bind('change:type', this._onTypeChanged, this);
    this.add_related_model(this.fieldModel);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.collection.bind('change', this._manageCategories, this);
    this.collection.bind('change', this._onCategoryChange, this);
    this.add_related_model(this.collection);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function () {
    this._createModel.bind('change', this.render, this);
    this._guessingModel.bind('change', this.render, this);
    this.add_related_model(this._createModel);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function () {
    this.model.bind('change', this.render, this);
    this.widgetModel.bind('change:search change:prefix change:suffix change:autoStyle', this.render, this);
    this.add_related_model(this.widgetModel);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.collection.bind('reset', this.render, this);
    this.model.bind('change:state', this._checkVisibility, this);
    this.add_related_model(this.collection);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/limits_reach/limits_reached_content_view.js on lines 61..65
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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

  _initBinds: function() {
    this.model.bind('change', this.render, this);
    this.collection.bind('reset', this.render, this);
    this.add_related_model(this.collection);
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 41..45
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-twitter/twitter-categories/twitter-categories-view.js on lines 34..38
lib/assets/javascripts/builder/components/modals/add-layer/footer/guessing-toggler-view.js on lines 45..49
lib/assets/javascripts/cartodb/common/dialogs/create/footer/guessing_toggler_view.js on lines 36..40
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 47..51
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/twitter_import/twitter_categories/twitter_categories_view.js on lines 34..38
lib/assets/javascripts/cartodb/common/dialogs/feature_data/form_field/form_field_view.js on lines 57..61
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/navigation_view.js on lines 50..54
lib/assets/javascripts/cartodb/common/dialogs/merge_datasets/column_selector_view.js on lines 55..59
lib/assets/javascripts/deep-insights/widgets/category/list/item/item-view.js on lines 51..55
lib/assets/javascripts/deep-insights/widgets/category/list/item/search-item-view.js on lines 43..48

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

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