Vizzuality/gfw-climate

View on GitHub

Showing 1,213 of 1,213 total issues

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

      _subscriptions: [
        {
          'Place/register': function(presenter) {
            this._presenters = _.union(this._presenters, [presenter]);
          }
Severity: Major
Found in app/assets/javascripts/services/PlaceService.js and 4 other locations - About 1 hr to fix
app/assets/javascripts/compare/services/PlaceService.js on lines 75..86
app/assets/javascripts/countries/services/PlaceService.js on lines 76..87
app/assets/javascripts/embed/services/PlaceService.js on lines 32..43
app/assets/javascripts/map/services/PlaceService.js on lines 95..106

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_type.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

      _subscriptions: [
        {
          'Place/register': function(presenter) {
            this._presenters = _.union(this._presenters, [presenter]);
          }
Severity: Major
Found in app/assets/javascripts/embed/services/PlaceService.js and 4 other locations - About 1 hr to fix
app/assets/javascripts/compare/services/PlaceService.js on lines 75..86
app/assets/javascripts/countries/services/PlaceService.js on lines 76..87
app/assets/javascripts/map/services/PlaceService.js on lines 95..106
app/assets/javascripts/services/PlaceService.js on lines 78..89

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_species.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_type.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_species.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/mining_by_type.cartocss'
  ],
Severity: Major
Found in app/assets/javascripts/map/views/layers/BraMiningLayer.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/map/views/layers/DamHotspotsLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/MangroveBiomassLayer.js on lines 6..27
app/assets/javascripts/map/views/layers/MysPALayer.js on lines 6..25
app/assets/javascripts/map/views/layers/PeatLandsDrainageLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/PerMiningLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/RusHcvLayer.js on lines 6..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 69.

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_type.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_species.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/mining_by_type.cartocss'
  ],
Severity: Major
Found in app/assets/javascripts/map/views/layers/PerMiningLayer.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/map/views/layers/BraMiningLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/DamHotspotsLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/MangroveBiomassLayer.js on lines 6..27
app/assets/javascripts/map/views/layers/MysPALayer.js on lines 6..25
app/assets/javascripts/map/views/layers/PeatLandsDrainageLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/RusHcvLayer.js on lines 6..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 69.

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

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

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

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

Refactorings

Further Reading

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

      var trailLine = trail
        .append('line')
        .attr('class', 'trail')
        .style('display', 'none')
        .attr('x1', 0)
app/assets/javascripts/embed/views/pantropical/PantropicalTotalEmissionsView.js on lines 275..282

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_species.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

      abortRequest: function(request) {
        if (this.currentRequest && this.currentRequest[request]) {
          this.currentRequest[request].abort();
          this.currentRequest[request] = null;
        }
Severity: Major
Found in app/assets/javascripts/services/CountryService.js and 1 other location - About 1 hr to fix
app/assets/javascripts/services/ContinentService.js on lines 98..103

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

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

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

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

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

Refactorings

Further Reading

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

      var trailLine = trail
        .append('line')
        .attr('class', 'trail')
        .style('display', 'none')
        .attr('x1', 0)
app/assets/javascripts/countries/views/pantropical/PantropicalTotalEmissionsView.js on lines 276..283

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

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

      abortRequest: function(request) {
        if (this.currentRequest && this.currentRequest[request]) {
          this.currentRequest[request].abort();
          this.currentRequest[request] = null;
        }
Severity: Major
Found in app/assets/javascripts/services/ContinentService.js and 1 other location - About 1 hr to fix
app/assets/javascripts/services/CountryService.js on lines 340..345

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_type.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_species.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

              if (
                d &&
                d.year &&
                Number(d.year !== 0) &&
                this.between(
app/assets/javascripts/widgets/indicators/multiline/MultiLineChartIndicator.js on lines 200..215

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/plantations_by_species.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/BraPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/ColPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/IdnPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/KhmPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/LbrPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/MysPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PerPlantationsLayerByType.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerBySpecies.js on lines 6..28
app/assets/javascripts/map/views/layers/PlantationsLayerByType.js on lines 6..28

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

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

define(
  [
    'abstract/layer/CartoDBLayerClass',
    'text!map/cartocss/PeatLandsDrainage.cartocss'
  ],
app/assets/javascripts/map/views/layers/BraMiningLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/DamHotspotsLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/MangroveBiomassLayer.js on lines 6..27
app/assets/javascripts/map/views/layers/MysPALayer.js on lines 6..25
app/assets/javascripts/map/views/layers/PerMiningLayer.js on lines 6..28
app/assets/javascripts/map/views/layers/RusHcvLayer.js on lines 6..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 69.

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