CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  _onChangeDisabled: function () {
    var disabled = this._editorModel.get('disabled');
    this._togglerModel.set({ disabled: disabled });
  },
Severity: Major
Found in lib/assets/javascripts/builder/editor/style/style-view.js and 9 other locations - About 45 mins to fix
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onTogglerChanged: function () {
    var checked = this._togglerModel.get('active');
    this._editorModel.set({ edition: checked });
  },
Severity: Major
Found in lib/assets/javascripts/builder/editor/style/style-view.js and 9 other locations - About 45 mins to fix
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338

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

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

  _onChangeDisabled: function () {
    var disabled = this._editorModel.get('disabled');
    this._togglerModel.set({ disabled: disabled });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onTogglerChanged: function () {
    var checked = this._togglerModel.get('active');
    this._editorModel.set({ edition: checked });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onChangeDisabled: function () {
    var disabled = this._editorModel.get('disabled');
    this._togglerModel.set({ disabled: disabled });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onTogglerChanged: function () {
    var checked = this._togglerModel.get('active');
    this._editorModel.set({ edition: checked });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onChangeDisabled: function () {
    var disabled = this._editorModel.get('disabled');
    this._togglerModel.set({ disabled: disabled });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onTogglerChanged: function () {
    var checked = this._togglerModel.get('active');
    this._editorModel.set({ edition: checked });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  _onChangeDisabled: function () {
    var disabled = this._editorModel.get('disabled');
    this._togglerModel.set({ disabled: disabled });
  },
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..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 50.

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

  revokeAccess: function(model) {
    var aclItem = this._ownAclItem(model);
    if (aclItem) {
      this.acl.remove(aclItem);
    }
Severity: Major
Found in lib/assets/javascripts/cartodb/models/permissions.js and 2 other locations - About 45 mins to fix
lib/assets/javascripts/builder/data/permission-model.js on lines 138..143
lib/assets/javascripts/dashboard/data/permission-model.js on lines 148..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 50.

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

  revokeAccess: function (model) {
    var aclItem = this._ownAclItem(model);
    if (aclItem) {
      this.acl.remove(aclItem);
    }
Severity: Major
Found in lib/assets/javascripts/dashboard/data/permission-model.js and 2 other locations - About 45 mins to fix
lib/assets/javascripts/builder/data/permission-model.js on lines 138..143
lib/assets/javascripts/cartodb/models/permissions.js on lines 106..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 50.

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

  events: {
    focus: function () {
      this.trigger('focus', this);
    },
    blur: function () {
lib/assets/javascripts/builder/components/form-components/editors/fill/fill.js on lines 36..43
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 24..31

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

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

  events: {
    focus: function () {
      this.trigger('focus', this);
    },
    blur: function () {
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 17..24
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 24..31

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

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

  revokeAccess: function (model) {
    var aclItem = this._ownAclItem(model);
    if (aclItem) {
      this.acl.remove(aclItem);
    }
Severity: Major
Found in lib/assets/javascripts/builder/data/permission-model.js and 2 other locations - About 45 mins to fix
lib/assets/javascripts/cartodb/models/permissions.js on lines 106..111
lib/assets/javascripts/dashboard/data/permission-model.js on lines 148..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 50.

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

  events: {
    focus: function () {
      this.trigger('focus', this);
    },
    blur: function () {
lib/assets/javascripts/builder/components/form-components/editors/fill/fill.js on lines 36..43
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 17..24

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

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

  initialize: function (opts) {
    checkAndBuildOpts(opts, REQUIRED_OPTS, this);

    this._initViewState();
    this._initModels();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 30..36
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 35..41
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 56..62
lib/assets/javascripts/dashboard/views/public-dataset/table-public-view.js on lines 34..39

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

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

  initialize: function (opts) {
    checkAndBuildOpts(opts, REQUIRED_OPTS, this);

    this._initViewState();
    this._initModels();
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 23..29
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 35..41
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 56..62
lib/assets/javascripts/dashboard/views/public-dataset/table-public-view.js on lines 34..39

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

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

  initialize: function (options) {
    checkAndBuildOpts(options, REQUIRED_OPTS, this);
    this._initModels();
    this._initViews();
    this._initBinds();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 30..36
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 23..29
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 35..41
lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 56..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 50.

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

  initialize: function (opts) {
    checkAndBuildOpts(opts, REQUIRED_OPTS, this);

    this._initViewState();
    this._buildAggregationCarouselCollection();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 30..36
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 23..29
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 35..41
lib/assets/javascripts/dashboard/views/public-dataset/table-public-view.js on lines 34..39

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

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

    this._panes.addTab('loading',
      ViewFactory.createByTemplate('common/templates/loading', {
        title: 'Saving new data...',
        quote: randomQuote()
      }).render()
lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_metadata_dialog_view.js on lines 77..82

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

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