CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

        } catch (e) {
          date.day   = day;
          date.month = month;
          date.year  = year;
          date.time  = time;
Severity: Minor
Found in lib/assets/javascripts/cartodb/old_common/forms/date_field.js and 2 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/forms/date_field.js on lines 147..152
lib/assets/javascripts/cartodb/old_common/forms/date_field.js on lines 165..170

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

          } else {
            date.day   = day;
            date.month = month;
            date.year  = year;
            date.time  = time;
Severity: Minor
Found in lib/assets/javascripts/cartodb/old_common/forms/date_field.js and 2 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/forms/date_field.js on lines 147..152
lib/assets/javascripts/cartodb/old_common/forms/date_field.js on lines 172..177

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

      if (str == '') {
        date.day   = day;
        date.month = month;
        date.year  = year;
        date.time  = time;
Severity: Minor
Found in lib/assets/javascripts/cartodb/old_common/forms/date_field.js and 2 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/forms/date_field.js on lines 165..170
lib/assets/javascripts/cartodb/old_common/forms/date_field.js on lines 172..177

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  _setStateForSecondStep: function() {
    this.set({
      step: 1,
      canGoBack: true,
      canContinue: false,
lib/assets/javascripts/cartodb/common/dialogs/georeference/admin_regions_model.js on lines 74..82
lib/assets/javascripts/cartodb/common/dialogs/georeference/postal_codes_model.js on lines 73..81

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  'filter-category': {
    title: _t('analyses.filter.title'),
    short_title: _t('analyses.filter.short-title'),
    FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model'),
    onboardingTemplate: require('builder/components/onboardings/analysis/analyses/filter.tpl'),
Severity: Major
Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/builder/data/analyses.js on lines 24..30
lib/assets/javascripts/builder/data/analyses.js on lines 31..37
lib/assets/javascripts/builder/data/analyses.js on lines 77..83
lib/assets/javascripts/builder/data/analyses.js on lines 147..153
lib/assets/javascripts/builder/data/analyses.js on lines 337..343

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  clean: function () {
    this.destroyScroll();
    cdb.core.View.prototype.clean.call(this);
  }
Severity: Major
Found in lib/assets/javascripts/cartodb/common/scroll/scroll-view.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 336..339
lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js on lines 53..56
lib/assets/javascripts/cartodb/table/header/header_sync_info.js on lines 216..219
lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 198..201
lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_tab.js on lines 275..278

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  'bounding-circle': {
    title: _t('analyses.bounding-circle.title'),
    short_title: _t('analyses.bounding-circle.short-title'),
    FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
    onboardingTemplate: require('builder/components/onboardings/analysis/analyses/group-points.tpl'),
Severity: Major
Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/builder/data/analyses.js on lines 24..30
lib/assets/javascripts/builder/data/analyses.js on lines 77..83
lib/assets/javascripts/builder/data/analyses.js on lines 98..104
lib/assets/javascripts/builder/data/analyses.js on lines 147..153
lib/assets/javascripts/builder/data/analyses.js on lines 337..343

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    clean: function() {
      this._disableBinds();
      cdb.core.View.prototype.clean.call(this);
    }
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 336..339
lib/assets/javascripts/cartodb/common/scroll/scroll-view.js on lines 84..87
lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js on lines 53..56
lib/assets/javascripts/cartodb/table/header/header_sync_info.js on lines 216..219
lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_tab.js on lines 275..278

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  'bounding-box': {
    title: _t('analyses.bounding-box.title'),
    short_title: _t('analyses.bounding-box.short-title'),
    FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
    onboardingTemplate: require('builder/components/onboardings/analysis/analyses/group-points.tpl'),
Severity: Major
Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/builder/data/analyses.js on lines 31..37
lib/assets/javascripts/builder/data/analyses.js on lines 77..83
lib/assets/javascripts/builder/data/analyses.js on lines 98..104
lib/assets/javascripts/builder/data/analyses.js on lines 147..153
lib/assets/javascripts/builder/data/analyses.js on lines 337..343

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    clean: function() {
      this._destroyTipsy();
      cdb.core.View.prototype.clean.call(this);
    }
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 336..339
lib/assets/javascripts/cartodb/common/scroll/scroll-view.js on lines 84..87
lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js on lines 53..56
lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 198..201
lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_tab.js on lines 275..278

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  'georeference-long-lat': {
    title: _t('analyses.georeference.title'),
    short_title: _t('analyses.georeference.short-title'),
    FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
    onboardingTemplate: require('builder/components/onboardings/analysis/analyses/georeference.tpl'),
Severity: Major
Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/builder/data/analyses.js on lines 24..30
lib/assets/javascripts/builder/data/analyses.js on lines 31..37
lib/assets/javascripts/builder/data/analyses.js on lines 77..83
lib/assets/javascripts/builder/data/analyses.js on lines 98..104
lib/assets/javascripts/builder/data/analyses.js on lines 337..343

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  'weighted-centroid': {
    title: _t('analyses.centroid.title'),
    short_title: _t('analyses.centroid.short-title'),
    FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/centroid-form-model'),
    onboardingTemplate: require('builder/components/onboardings/analysis/analyses/centroid.tpl'),
Severity: Major
Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/builder/data/analyses.js on lines 24..30
lib/assets/javascripts/builder/data/analyses.js on lines 31..37
lib/assets/javascripts/builder/data/analyses.js on lines 77..83
lib/assets/javascripts/builder/data/analyses.js on lines 98..104
lib/assets/javascripts/builder/data/analyses.js on lines 147..153

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    clean: function() {
      this._destroyTripsy();
      cdb.core.View.prototype.clean.call(this);
    }
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 336..339
lib/assets/javascripts/cartodb/common/scroll/scroll-view.js on lines 84..87
lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js on lines 53..56
lib/assets/javascripts/cartodb/table/header/header_sync_info.js on lines 216..219
lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 198..201

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  'concave-hull': {
    title: _t('analyses.concave-hull.title'),
    short_title: _t('analyses.concave-hull.short-title'),
    FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
    onboardingTemplate: require('builder/components/onboardings/analysis/analyses/group-points.tpl'),
Severity: Major
Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/builder/data/analyses.js on lines 24..30
lib/assets/javascripts/builder/data/analyses.js on lines 31..37
lib/assets/javascripts/builder/data/analyses.js on lines 98..104
lib/assets/javascripts/builder/data/analyses.js on lines 147..153
lib/assets/javascripts/builder/data/analyses.js on lines 337..343

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    clean: function() {
      this._destroyTipsy();
      cdb.core.View.prototype.clean.call(this);
    }
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js and 5 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 336..339
lib/assets/javascripts/cartodb/common/scroll/scroll-view.js on lines 84..87
lib/assets/javascripts/cartodb/table/header/header_sync_info.js on lines 216..219
lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 198..201
lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_tab.js on lines 275..278

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    if (privacy == "public") {

      $share
      .removeClass("private")
      .removeClass("link_protected")
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/header.js and 4 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/header.js on lines 208..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 217..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 226..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 235..244

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  clean: function () {
    this._destroyBinds();
    cdb.core.View.prototype.clean.call(this);
  }
lib/assets/javascripts/cartodb/common/scroll/scroll-view.js on lines 84..87
lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js on lines 53..56
lib/assets/javascripts/cartodb/table/header/header_sync_info.js on lines 216..219
lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 198..201
lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_tab.js on lines 275..278

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    } else if (privacy == "organization"){

      $share
      .removeClass("private")
      .removeClass("link_protected")
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/header.js and 4 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/header.js on lines 199..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 208..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 217..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 226..244

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    } else if (privacy == "private"){

      $share
      .removeClass("public")
      .removeClass("link_protected")
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/header.js and 4 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/header.js on lines 199..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 208..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 226..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 235..244

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    } else if (privacy == "password"){

      $share
      .removeClass("private")
      .removeClass("link_protected")
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/header.js and 4 other locations - About 35 mins to fix
lib/assets/javascripts/cartodb/old_common/header.js on lines 199..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 208..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 217..244
lib/assets/javascripts/cartodb/old_common/header.js on lines 235..244

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language