Vizzuality/gfw-climate

View on GitHub

Showing 920 of 1,213 total issues

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

    _openBox: function() {
      this.$widgetBox.removeClass('closed');
      this.$widgetClosed.hide();
      this.$widgetOpened.show();
    },
Severity: Minor
Found in app/assets/javascripts/map/views/Widget.js and 1 other location - About 55 mins to fix
app/assets/javascripts/map/views/Widget.js on lines 131..135

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

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

      var params = {
        section: this.model.get('section'),
        interesting: this.model.get('interesting'),
        t: this.model.get('t')
      };
Severity: Major
Found in app/assets/javascripts/views/SidebarNavView.js and 2 other locations - About 55 mins to fix
app/assets/javascripts/compare/views/index/CompareModalView.js on lines 61..65
app/assets/javascripts/views/ShareView.js on lines 262..266

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

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

    _closeBox: function() {
      this.$widgetBox.addClass('closed');
      this.$widgetClosed.show();
      this.$widgetOpened.hide();
    }
Severity: Minor
Found in app/assets/javascripts/map/views/Widget.js and 1 other location - About 55 mins to fix
app/assets/javascripts/map/views/Widget.js on lines 125..129

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

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

        this.graphLine = solidLineGroup
          .append('path')
          .attr('d', this.linePath(this.monitoringData.values))
          .attr('class', 'line-monitoring');
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 427..430

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

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

        this.graphLine = solidLineGroup
          .append('path')
          .attr('d', this.linePath(this.referenceData.values))
          .attr('class', 'line-reference');
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 432..435

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

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

        this.svg = svg
          .append('g')
          .attr(
            'transform',
            'translate(' + margin.left + ',' + margin.top + ')'
app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 209..214
app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 163..168
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 247..252

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

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

        this.svg = svg
          .append('g')
          .attr(
            'transform',
            'translate(' + margin.left + ',' + margin.top + ')'
app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 209..214
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 247..252
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 313..318

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

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

        this.svg = svg
          .append('g')
          .attr(
            'transform',
            'translate(' + margin.left + ',' + margin.top + ')'
app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 163..168
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 247..252
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 313..318

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

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var ColombiaForestChangeLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var TerraicanvasCoverageLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

        this.svg = svg
          .append('g')
          .attr(
            'transform',
            'translate(' + margin.left + ',' + margin.top + ')'
app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 209..214
app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 163..168
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 313..318

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

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

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

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

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

Refactorings

Further Reading

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

      destroy: function() {
        if (this.activeWidgets) {
          this.activeWidgets.forEach(function(widget) {
            widget.destroy();
          });
app/assets/javascripts/countries/views/show/reports/AreasView.js on lines 143..149
app/assets/javascripts/countries/views/show/reports/NationalView.js on lines 91..97

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

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var UsaLandCoverChangeLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var GtmForestChange1Layer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var IdnPrimaryLayer = ImageLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js and 12 other locations - About 50 mins to fix
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var GtmForestChange2Layer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var UsaLandCoverLayer = ImageLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js and 12 other locations - About 50 mins to fix
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var UsaForestOwnershipLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var Terra_iLayer = ImageLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/Terra_iLayer.js and 12 other locations - About 50 mins to fix
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestDensityLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

define(['abstract/layer/ImageLayerClass'], function(ImageLayerClass) {
  'use strict';

  var GtmForestDensityLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/ColombiaForestChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GlobalLandCoverLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GrumpLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/GtmForestChange1Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestChange2Layer.js on lines 13..25
app/assets/javascripts/map/views/layers/GtmForestCoverLayer.js on lines 13..25
app/assets/javascripts/map/views/layers/IdnPrimaryLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/Terra_iLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TerraicanvasCoverageLayer.js on lines 5..17
app/assets/javascripts/map/views/layers/UsaForestOwnershipLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverChangeLayer.js on lines 6..18
app/assets/javascripts/map/views/layers/UsaLandCoverLayer.js on lines 6..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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