CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  def download_formats table, format
    format.sql  { send_data table.to_sql, send_data_conf(table, 'zip', 'zip') }
    format.kml  { send_data table.to_kml, send_data_conf(table, 'zip', 'kmz') }
    format.csv  { send_data table.to_csv, send_data_conf(table, 'zip', 'zip') }
    format.shp  { send_data table.to_shp, send_data_conf(table, 'octet-stream', 'zip') }
Severity: Minor
Found in app/controllers/admin/tables_controller.rb and 1 other location - About 50 mins to fix
app/controllers/admin/visualizations_controller.rb on lines 572..576

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

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

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

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

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

Refactorings

Further Reading

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

  def download_formats(table, format)
    format.sql  { send_data table.to_sql, data_for(table, 'zip', 'zip') }
    format.kml  { send_data table.to_kml, data_for(table, 'zip', 'kmz') }
    format.csv  { send_data table.to_csv, data_for(table, 'zip', 'zip') }
    format.shp  { send_data table.to_shp, data_for(table, 'octet-stream', 'zip') }
Severity: Minor
Found in app/controllers/admin/visualizations_controller.rb and 1 other location - About 50 mins to fix
app/controllers/admin/tables_controller.rb on lines 52..56

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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

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

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

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

Refactorings

Further Reading

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

  module Api
    module Public
      class AppPresenter

        def initialize(context, user, app)
Severity: Minor
Found in app/controllers/carto/api/public/app_presenter.rb and 1 other location - About 50 mins to fix
app/controllers/carto/api/public/kuviz_presenter.rb on lines 2..22

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

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

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

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

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

Refactorings

Further Reading

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

  module Db
    class Function
      attr_reader :database_name, :database_schema, :name, :argument_data_types

      def initialize(database_name:, database_schema:, name:, argument_data_types:)
Severity: Minor
Found in lib/carto/db/function.rb and 1 other location - About 50 mins to fix
lib/carto/db/trigger.rb on lines 2..18

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

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

  _onTextChanged: function() {
    var value = this.$('.js-textInput').val();
    if (!value) {
      this._hideTextError();
    }
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-data/import-data-form-view.js on lines 120..125
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/file_upload_view.js on lines 72..77

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: TabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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 ($('.tagit-choice').length > 0) {
          $('.js-placeholder').hide();
        } else {
          $('.js-placeholder').show();
        }
Severity: Major
Found in lib/assets/javascripts/dashboard/organization.js and 2 other locations - About 50 mins to fix
lib/assets/javascripts/dashboard/organization.js on lines 191..193
lib/assets/javascripts/dashboard/organization.js on lines 196..198

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

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

  _onTextChanged: function () {
    var value = this.$('.js-textInput').val();
    if (!value) {
      this._hideTextError();
    }
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/data_import/data_form_view.js on lines 111..116
lib/assets/javascripts/cartodb/common/dialogs/map/image_picker/file_upload_view.js on lines 72..77

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: tabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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 ($('.tagit-choice').length > 0) {
          $('.js-placeholder').hide();
        } else { $('.js-placeholder').show(); }
Severity: Major
Found in lib/assets/javascripts/dashboard/organization.js and 2 other locations - About 50 mins to fix
lib/assets/javascripts/dashboard/organization.js on lines 171..175
lib/assets/javascripts/dashboard/organization.js on lines 196..198

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: EditorTabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
Severity: Major
Found in lib/assets/javascripts/builder/editor/editor-pane.js and 8 other locations - About 50 mins to fix
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: TabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139

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

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

    var options = {
      tabPaneOptions: {
        template: tabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: tabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: tabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: tabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/modals/publish/publish-view.js on lines 160..172
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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

    var tabPaneOptions = {
      tabPaneOptions: {
        template: TabPaneTemplate,
        tabPaneItemOptions: {
          tagName: 'li',
lib/assets/javascripts/builder/components/form-components/editors/fill-color/fill-color.js on lines 90..102
lib/assets/javascripts/builder/components/form-components/editors/size/size.js on lines 94..106
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 100..112
lib/assets/javascripts/builder/components/input-color/input-color-fixed-content-view.js on lines 91..103
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 61..73
lib/assets/javascripts/builder/editor/editor-pane.js on lines 176..188
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 127..139
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 120..132

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

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 ($('.tagit-choice').length > 0) {
          $('.js-placeholder').hide();
        } else { $('.js-placeholder').show(); }
Severity: Major
Found in lib/assets/javascripts/dashboard/organization.js and 2 other locations - About 50 mins to fix
lib/assets/javascripts/dashboard/organization.js on lines 171..175
lib/assets/javascripts/dashboard/organization.js on lines 191..193

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

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

  _onTextChanged: function() {
    var value = this.$('.js-textInput').val();
    if (!value) {
      this._hideTextError();
    }
lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-data/import-data-form-view.js on lines 120..125
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/data_import/data_form_view.js on lines 111..116

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

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

  remove: function () {
    this._destroySlider();
    Backbone.Form.editors.Base.prototype.remove.apply(this);
  },
lib/assets/javascripts/builder/components/form-components/editors/code-editor.js on lines 81..84
lib/assets/javascripts/builder/components/form-components/editors/enabler/enabler-view.js on lines 79..82
lib/assets/javascripts/builder/components/form-components/editors/taglist/taglist.js on lines 124..127
lib/assets/javascripts/builder/components/form-components/editors/text.js on lines 101..105

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

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