CartoDB/cartodb20

View on GitHub

Showing 3,496 of 5,951 total issues

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

  _renderLoadingPrerequisites: function() {
    return cdb.templates.getTemplate('common/templates/loading')({
      title: 'Checking what consequences deleting the selected ' + this._pluralizedContentType() + ' would have...',
      quote: randomQuote()
    });
lib/assets/javascripts/cartodb/common/dialogs/delete_items_view.js on lines 129..134

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

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 get_isolines_data(user, from, to, orgwise = true)
    org = user.organization if orgwise
    isolines_provider = org.try(:isolines_provider) || user.isolines_provider
    orgname = org.try(:name)
    usage_metrics = CartoDB::IsolinesUsageMetrics.new(user.username, orgname)
Severity: Major
Found in app/helpers/data_services_metrics_helper.rb and 1 other location - About 1 hr to fix
app/helpers/data_services_metrics_helper.rb on lines 61..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 2 locations. Consider refactoring.
Open

  def maps_api_url(username, privacy = "private")
    maps_api = Cartodb.get_config(:tiler, privacy)
    if CartoDB.subdomainless_urls?
      maps_api["protocol"] + "://" + maps_api["domain"] + ":" + maps_api["port"].to_s + "/user/#{username}"
    else
Severity: Major
Found in app/helpers/maps_api_helper.rb and 1 other location - About 1 hr to fix
app/helpers/sql_api_helper.rb on lines 6..11

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

  def sql_api_url(username, privacy = 'private')
    sql_api = Cartodb.get_config(:sql_api, privacy)
    if CartoDB.subdomainless_urls?
      sql_api["protocol"] + "://" + sql_api["domain"] + ":" + sql_api["port"].to_s + "/user/#{username}"
    else
Severity: Major
Found in app/helpers/sql_api_helper.rb and 1 other location - About 1 hr to fix
app/helpers/maps_api_helper.rb on lines 6..11

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

  def get_routing_data(user, from, to, orgwise = true)
    org = user.organization if orgwise
    routing_provider = org.try(:routing_provider) || user.routing_provider
    orgname = org.try(:name)
    usage_metrics = CartoDB::RoutingUsageMetrics.new(user.username, orgname)
Severity: Major
Found in app/helpers/data_services_metrics_helper.rb and 1 other location - About 1 hr to fix
app/helpers/data_services_metrics_helper.rb on lines 50..58

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

  _showHiddenLayer: function () {
    var savingOptions = {
      shouldPreserveAutoStyle: true
    };
    this._layerDefinitionModel.toggleVisible();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 455..461
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 355..361
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 225..231
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 278..284
lib/assets/javascripts/builder/editor/style/style-view.js on lines 467..473

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

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

  _showHiddenLayer: function () {
    var savingOptions = {
      shouldPreserveAutoStyle: true
    };
    this._layerDefinitionModel.toggleVisible();
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 355..361
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 225..231
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 278..284
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 218..224
lib/assets/javascripts/builder/editor/style/style-view.js on lines 467..473

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

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

  _showHiddenLayer: function () {
    var savingOptions = {
      shouldPreserveAutoStyle: true
    };
    this._layerDefinitionModel.toggleVisible();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 455..461
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 355..361
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 278..284
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 218..224
lib/assets/javascripts/builder/editor/style/style-view.js on lines 467..473

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

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

  _showHiddenLayer: function () {
    var savingOptions = {
      shouldPreserveAutoStyle: true
    };
    this._layerDefinitionModel.toggleVisible();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 455..461
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 355..361
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 225..231
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 218..224
lib/assets/javascripts/builder/editor/style/style-view.js on lines 467..473

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

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

  _showHiddenLayer: function () {
    var savingOptions = {
      shouldPreserveAutoStyle: true
    };
    this._layerDefinitionModel.toggleVisible();
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 455..461
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 225..231
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 278..284
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 218..224
lib/assets/javascripts/builder/editor/style/style-view.js on lines 467..473

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

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

  _showHiddenLayer: function () {
    var savingOptions = {
      shouldPreserveAutoStyle: true
    };
    this._layerDefinitionModel.toggleVisible();
Severity: Major
Found in lib/assets/javascripts/builder/editor/style/style-view.js and 5 other locations - About 1 hr to fix
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 455..461
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 355..361
lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 225..231
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 278..284
lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 218..224

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

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

  _close: function(e) {

    this._killEvent(e);

    var self = this;
Severity: Major
Found in lib/assets/javascripts/cartodb/table/overlays/zoom.js and 7 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290

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

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

  _close: function(e) {

    this._killEvent(e);

    var self = this;
Severity: Major
Found in lib/assets/javascripts/cartodb/table/overlays/share.js and 7 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

  _close: function(e) {

    this.killEvent(e);

    var self = this;
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

  _close: function(e) {

    this._killEvent(e);

    var self = this;
Severity: Major
Found in lib/assets/javascripts/cartodb/table/overlays/loader.js and 7 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

  _close: function(e) {

    this._killEvent(e);

    var self = this;
Severity: Major
Found in lib/assets/javascripts/cartodb/table/overlays/search.js and 7 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

  _close: function(e) {

    this._killEvent(e);

    var self = this;
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

  _close: function(e) {

    this._killEvent(e);

    var self = this;
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

  _close: function(e) {

    this.killEvent(e);

    var self = this;
Severity: Major
Found in lib/assets/javascripts/cartodb/table/overlays/text.js and 7 other locations - About 1 hr to fix
lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 331..341
lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..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 57.

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

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

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

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

Refactorings

Further Reading

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

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

lib/assets/javascripts/builder/components/form-components/editors/size/size-fixed-view.js on lines 5..11
lib/assets/javascripts/builder/components/input-number/input-number-fixed-content-view.js on lines 5..11
lib/assets/javascripts/builder/editor/style/style-form/style-properties-form/style-shape-properties-form-view.js on lines 27..33
lib/assets/javascripts/builder/editor/widgets/widgets-form/widgets-form-fields-view.js on lines 42..48
lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 61..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 57.

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