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 lazy_order_by_size(objects)
        viz_and_size = objects.map { |obj| [obj, (obj.table ? obj.table.row_count_and_size.fetch(:size, 0) : 0)] }
        viz_and_size.sort! { |vs_a, vs_b| vs_b[1] <=> vs_a[1] }
        viz_and_size.map { |vs| vs[0] }
Severity: Minor
Found in app/models/visualization/collection.rb and 1 other location - About 40 mins to fix
app/models/visualization/collection.rb on lines 349..352

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

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

      class PublishedMap < Event
        include Carto::Tracking::Services::Hubspot
        include Carto::Tracking::Services::Segment
        include Carto::Tracking::Services::PubSub

Severity: Minor
Found in lib/carto/tracking/events.rb and 1 other location - About 40 mins to fix
lib/carto/tracking/events.rb on lines 126..141

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

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 lazy_order_by_row_count(objects)
        viz_and_rows = objects.map { |obj| [obj, (obj.table ? obj.table.row_count_and_size.fetch(:row_count, 0) : 0)] }
        viz_and_rows.sort! { |vr_a, vr_b| vr_b[1] <=> vr_a[1] }
        viz_and_rows.map { |vr| vr[0] }
Severity: Minor
Found in app/models/visualization/collection.rb and 1 other location - About 40 mins to fix
app/models/visualization/collection.rb on lines 355..358

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

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 Import
      extend ::LoggerHelper

      @queue = :user_migrations

Severity: Minor
Found in lib/resque/user_migration_jobs.rb and 1 other location - About 40 mins to fix
lib/resque/user_migration_jobs.rb on lines 5..16

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

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

        def load_pagination_params(default_order:, valid_order_params:)
          page, per_page, order, direction = page_per_page_order_params(
            valid_order_params,
            default_order: default_order,
            default_order_direction: 'asc'
app/controllers/carto/api/public/federated_tables_controller.rb on lines 158..165

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

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

        def load_pagination_params(default_order:, valid_order_params:)
          page, per_page, order, direction = page_per_page_order_params(
            valid_order_params,
            default_order: default_order,
            default_order_direction: 'asc'
Severity: Minor
Found in app/controllers/carto/api/public/federated_tables_controller.rb and 1 other location - About 35 mins to fix
app/controllers/carto/api/public/bigquery_tilesets_controller.rb on lines 98..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 36.

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

          FOLDER_AND_FILE_FIELDS = [:type, :id, :sequence_id, :etag, :name, :created_at, :modified_at, :description,
                                    :size, :path_collection, :created_by, :modified_by, :trashed_at, :purged_at,
                                    :content_created_at, :content_modified_at, :owned_by, :shared_link,
                                    :folder_upload_email,
                                    :parent, :item_status, :item_collection, :sync_state, :has_collaborations,
Severity: Minor
Found in services/datasources/lib/datasources/url/box.rb and 1 other location - About 35 mins to fix
app/models/concerns/cartodb_central_synchronizable.rb on lines 89..99

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

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

        %i(seats viewer_seats quota_in_bytes display_name description website
           discus_shortname twitter_username geocoding_quota map_views_quota
           geocoding_block_price map_view_block_price
           twitter_datasource_enabled twitter_datasource_block_size
           twitter_datasource_block_price twitter_datasource_quota
Severity: Minor
Found in app/models/concerns/cartodb_central_synchronizable.rb and 1 other location - About 35 mins to fix
services/datasources/lib/datasources/url/box.rb on lines 206..214

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

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._initViews();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._initViews();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();

    this._initViews();
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._initViews();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._initViews();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._initViews();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._initViews();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._renderListSection();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._renderOptions();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();
    this._renderGroupsView();
    return this;
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/deep-insights/widgets/category/paginator/paginator-view.js on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  _getOpacity: function () {
    return this.model.get('opacity') != null ? this.model.get('opacity') : 1;
  },
lib/assets/javascripts/builder/components/form-components/editors/fill-color/inputs/input-color-by-value.js on lines 185..187
lib/assets/javascripts/builder/components/form-components/editors/fill-color/inputs/input-color-fixed.js on lines 124..126
lib/assets/javascripts/builder/components/input-color/input-color.js on lines 203..205

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

  render: function () {
    this.clearSubViews();
    this.$el.empty();

    this._initViews();
lib/assets/javascripts/builder/components/form-components/editors/select/select-list-view.js on lines 38..43
lib/assets/javascripts/builder/components/form-components/editors/size/size-by-value-view.js on lines 45..50
lib/assets/javascripts/builder/components/infobox/infobox-item-view.js on lines 44..49
lib/assets/javascripts/builder/components/infobox/infobox-view.js on lines 18..23
lib/assets/javascripts/builder/components/input-color/assets-picker/user-assets-tab.js on lines 31..36
lib/assets/javascripts/builder/components/input-color/input-color-dialog-content.js on lines 50..55
lib/assets/javascripts/builder/components/input-color/input-color-value-content-view.js on lines 53..58
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/input-ramp-content-view.js on lines 15..20
lib/assets/javascripts/builder/components/input-color/input-quantitative-ramps/main-view.js on lines 21..26
lib/assets/javascripts/builder/components/input-fill/input-fill-view.js on lines 49..55
lib/assets/javascripts/builder/components/input-number/input-number-dialog-content.js on lines 21..26
lib/assets/javascripts/builder/components/input-number/input-number-value-content-view.js on lines 32..37
lib/assets/javascripts/builder/components/modals/export-data/modal-export-data-format-view.js on lines 19..24
lib/assets/javascripts/builder/components/modals/publish/share/share-list-view.js on lines 29..34
lib/assets/javascripts/builder/components/modals/publish/upgrade-view.js on lines 11..16
lib/assets/javascripts/builder/dataset/dataset-options/dataset-sql-view.js on lines 30..35
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-workflow-view.js on lines 23..30
lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-quota-view.js on lines 15..20
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-sql-view.js on lines 32..37
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/stat-view.js on lines 28..33
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-content-view.js on lines 24..31
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-html-view.js on lines 20..25
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-editor-view.js on lines 23..28
lib/assets/javascripts/builder/editor/settings/preview/preview-view.js on lines 20..25
lib/assets/javascripts/dashboard/views/organization/groups-admin/groups-list/groups-list-view.js on lines 16..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language