CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

      var api_key = (this.options && this.options.user_data)? this.options.user_data.api_key :
        (window.user_data? window.user_data.api_key : window.api_key);
Severity: Major
Found in lib/assets/javascripts/cartodb/models/table.js and 9 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/models/table.js on lines 8..9
lib/assets/javascripts/cartodb/models/table.js on lines 690..691
lib/assets/javascripts/cartodb/models/table.js on lines 692..693
lib/assets/javascripts/cartodb/models/table.js on lines 949..950
lib/assets/javascripts/cartodb/models/table.js on lines 951..952
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 44..45
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 46..47
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 647..648
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 649..650

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

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

  _onSelectedChange: function (itemModel, isSelected) {
    if (!isSelected) {
      return;
    }

lib/assets/javascripts/builder/components/form-components/editors/fill/input-collection.js on lines 33..43
lib/assets/javascripts/builder/components/tab-pane/tab-pane-collection.js on lines 59..69

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

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

      var username = (this.options && this.options.user_data)? this.options.user_data.username :
        (window.user_data? window.user_data.username : window.user_name);
Severity: Major
Found in lib/assets/javascripts/cartodb/models/table.js and 9 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/models/table.js on lines 8..9
lib/assets/javascripts/cartodb/models/table.js on lines 10..11
lib/assets/javascripts/cartodb/models/table.js on lines 690..691
lib/assets/javascripts/cartodb/models/table.js on lines 692..693
lib/assets/javascripts/cartodb/models/table.js on lines 951..952
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 44..45
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 46..47
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 647..648
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 649..650

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

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

  _onSelectedChange: function (itemModel, isSelected) {
    if (!isSelected) {
      return;
    }

lib/assets/javascripts/builder/components/form-components/editors/fill/input-collection.js on lines 33..43
lib/assets/javascripts/builder/components/input-collection/input-collection.js on lines 33..43

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

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

    var username = (this.options && this.options.user_data) ? this.options.user_data.username
      : (window.user_data ? window.user_data.username : window.user_name);
lib/assets/javascripts/cartodb/models/table.js on lines 8..9
lib/assets/javascripts/cartodb/models/table.js on lines 10..11
lib/assets/javascripts/cartodb/models/table.js on lines 690..691
lib/assets/javascripts/cartodb/models/table.js on lines 692..693
lib/assets/javascripts/cartodb/models/table.js on lines 949..950
lib/assets/javascripts/cartodb/models/table.js on lines 951..952
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 44..45
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 46..47
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 649..650

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

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

  urlRoot: function () {
    var version = this._configModel.urlVersion('import');
    var baseUrl = this._configModel.get('base_url');

    return baseUrl + '/api/' + version + '/imports';
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  urlRoot: function () {
    var baseUrl = this._configModel.get('base_url');
    var version = this._configModel.urlVersion('visualization');
    return baseUrl + '/api/' + version + '/viz';
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  urlRoot: function () {
    var baseUrl = this._configModel.get('base_url');
    var version = this._configModel.urlVersion('perm');
    return baseUrl + '/api/' + version + '/perm';
  },
Severity: Major
Found in lib/assets/javascripts/builder/data/permission-model.js and 8 other locations - About 1 hr to fix
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  _onSelectedChange: function (itemModel, isSelected) {
    if (!isSelected) {
      return;
    }

lib/assets/javascripts/builder/components/input-collection/input-collection.js on lines 33..43
lib/assets/javascripts/builder/components/tab-pane/tab-pane-collection.js on lines 59..69

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

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

  urlRoot: function () {
    var version = this._configModel.urlVersion('synchronizations');
    var baseUrl = this._configModel.get('base_url');
    return baseUrl + '/api/' + version + '/synchronizations/';
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

      var username = (this.options && this.options.user_data)? this.options.user_data.username :
        (window.user_data? window.user_data.username : window.user_name);
Severity: Major
Found in lib/assets/javascripts/cartodb/models/table.js and 9 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/models/table.js on lines 10..11
lib/assets/javascripts/cartodb/models/table.js on lines 690..691
lib/assets/javascripts/cartodb/models/table.js on lines 692..693
lib/assets/javascripts/cartodb/models/table.js on lines 949..950
lib/assets/javascripts/cartodb/models/table.js on lines 951..952
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 44..45
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 46..47
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 647..648
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 649..650

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

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

  url: function () {
    var version = this._configModel.urlVersion('visualization');
    var baseUrl = this._configModel.get('base_url');
    return baseUrl + '/api/' + version + '/viz';
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20

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

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

      var api_key = (this.options && this.options.user_data)? this.options.user_data.api_key :
        (window.user_data? window.user_data.api_key : window.api_key);
Severity: Major
Found in lib/assets/javascripts/cartodb/models/table.js and 9 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/models/table.js on lines 8..9
lib/assets/javascripts/cartodb/models/table.js on lines 10..11
lib/assets/javascripts/cartodb/models/table.js on lines 690..691
lib/assets/javascripts/cartodb/models/table.js on lines 949..950
lib/assets/javascripts/cartodb/models/table.js on lines 951..952
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 44..45
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 46..47
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 647..648
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 649..650

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

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

      var api_key = (this.options && this.options.user_data)? this.options.user_data.api_key :
        (window.user_data? window.user_data.api_key : window.api_key);
Severity: Major
Found in lib/assets/javascripts/cartodb/models/table.js and 9 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/models/table.js on lines 8..9
lib/assets/javascripts/cartodb/models/table.js on lines 10..11
lib/assets/javascripts/cartodb/models/table.js on lines 690..691
lib/assets/javascripts/cartodb/models/table.js on lines 692..693
lib/assets/javascripts/cartodb/models/table.js on lines 949..950
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 44..45
lib/assets/javascripts/dashboard/data/table/row-model.js on lines 46..47
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 647..648
lib/assets/javascripts/dashboard/views/public-dataset/carto-table-metadata.js on lines 649..650

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

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

  url: function () {
    const version = this._configModel.urlVersion('connectors');
    const baseUrl = this._configModel.get('base_url');
    return baseUrl + '/api/' + version + '/connectors/bigquery/projects';
  },
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  urlRoot: function () {
    var baseUrl = this._configModel.get('base_url');
    var version = this._configModel.urlVersion('table');
    return baseUrl + '/api/' + version + '/tables';
  },
Severity: Major
Found in lib/assets/javascripts/builder/data/table-model.js and 8 other locations - About 1 hr to fix
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  urlRoot: function () {
    var baseUrl = this._configModel.get('base_url');
    var version = this._configModel.urlVersion('visualization');
    return baseUrl + '/api/' + version + '/viz';
  },
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/tables-collection.js on lines 39..43
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  url: function () {
    var version = this._configModel.urlVersion('visualization');
    var baseUrl = this._configModel.get('base_url');
    return baseUrl + '/api/' + version + '/viz';
  },
Severity: Major
Found in lib/assets/javascripts/builder/data/tables-collection.js and 8 other locations - About 1 hr to fix
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/billing-project-model.js on lines 13..17
lib/assets/javascripts/builder/data/background-importer/import-model.js on lines 24..29
lib/assets/javascripts/builder/data/permission-model.js on lines 23..27
lib/assets/javascripts/builder/data/synchronization-model.js on lines 31..35
lib/assets/javascripts/builder/data/table-model.js on lines 28..32
lib/assets/javascripts/builder/data/vis-definition-model.js on lines 43..47
lib/assets/javascripts/builder/data/visualization-table-model.js on lines 16..20
lib/assets/javascripts/builder/data/visualizations-collection.js on lines 45..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 63.

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

  clean: function() {
    // Until https://github.com/CartoDB/cartodb.js/issues/238 is resolved:
    $(this.options.target).unbind("click", this._handleClick);
    this.constructor.__super__.clean.apply(this);
  }
lib/assets/javascripts/cartodb/common/views/dashboard_header/settings_dropdown_view.js on lines 105..109
lib/assets/javascripts/cartodb/public_common/user_industries/dropdown_view.js on lines 33..37
lib/assets/javascripts/cartodb/public_common/user_settings/dropdown_view.js on lines 44..48
lib/assets/javascripts/cartodb/table/export_image_format_dropdown.js on lines 40..44

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

      var method = this.model && this.model.get("method") && this.model.get("method").replace(/ /g,"_").toLowerCase();
lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 817..817

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

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