Vizzuality/gfw-climate

View on GitHub

Showing 920 of 1,213 total issues

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

        $.when.apply(null, promises).then(
          function() {
            this.render(widgetsArray);
          }.bind(this)
        );
app/assets/javascripts/countries/views/show/reports/AreasView.js on lines 66..70

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

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

      _open_share: function(event) {
        var shareView = new ShareView().share(event);
        $('body').append(shareView.el);
      },
app/assets/javascripts/insights/views/InsightsGladAlertsView.js on lines 422..425
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsView.js on lines 487..490
app/assets/javascripts/map/views/TabsView.js on lines 144..147

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

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

    _changeVisualizations: function(ev) {
      var current = ev.currentTarget;
      var filter = current.dataset.filter;

      this._changeMainVis(filter);
Severity: Minor
Found in app/assets/javascripts/insights/views/InsightsGladAlertsView.js and 1 other location - About 40 mins to fix
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsView.js on lines 370..375

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

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

            if ((index === 0 && firstParam) || query === '') {
              firstParam = false;
              query += '?';
            } else {
              query += '&';
app/assets/javascripts/data-download/views/DataDownloadIndexView.js on lines 475..480

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

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

      cache: function() {
        this.continentsEl = this.$('#geo-continents-list');
        this.countriesEl = this.$('#geo-countries-list');
      },
app/assets/javascripts/insights/views/carbon-cycle/CarbonCycleView.js on lines 76..79

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

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

        var continents = _.map(continentsData, function(c) {
          c.href = '/countries/' + c.iso + '/report';
          return c;
        });
app/assets/javascripts/insights/views/emissions-calculator/EmissionCalculatorIndexView.js on lines 83..86

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

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

  var styles = {
    dark: '#242426',
    grayscale: '#BCE1FF',
    terrain: '#BCE1FF',
    satellite: '#2B3872',
Severity: Minor
Found in app/assets/javascripts/map/views/maptypes/basemapStyles.js and 1 other location - About 40 mins to fix
app/assets/javascripts/services/CountryService.js on lines 23..39

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

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

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

  var FormaCoverLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/FormaCoverLayer.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

  var CustomDarkBaseLabelsLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

      $(window).on(
        'resize.namespace' + this.namespace,
        _.debounce(this.resize.bind(this), 100)
      );
app/assets/javascripts/widgets/indicators/line/LineChart.js on lines 48..51
app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 43..46

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

  var ProdesCoverLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/ProdesCoverLayer.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

Severity: Major
Found in app/assets/javascripts/map/views/layers/PantropicalLayer.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

  var MangroveLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/MangroveLayer.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

  var ModisCoverLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/ModisCoverLayer.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

  var IntactForestLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/IntactForestLayer.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotalSGCarbonGainLayer.js on lines 7..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/CustomDarkOnlyLabelsLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/FormaCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ImazonCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/IntactForestLayer2000.js on lines 6..17
app/assets/javascripts/map/views/layers/MangroveLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/ModisCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/PantropicalLayer.js on lines 6..19
app/assets/javascripts/map/views/layers/ProdesCoverLayer.js on lines 6..17
app/assets/javascripts/map/views/layers/TotalCarbonLayer.js on lines 7..20
app/assets/javascripts/map/views/layers/UptakeTotal2028Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2038Layer.js on lines 6..19
app/assets/javascripts/map/views/layers/UptakeTotal2048Layer.js on lines 6..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

      $(window).on(
        'resize.namespace' + this.namespace,
        _.debounce(this.resize.bind(this), 100)
      );
Severity: Minor
Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 35 mins to fix
app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 43..46
app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 45..48

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

      this.tooltip = d3
        .select('body')
        .append('div')
        .attr('class', 'linegraph-tooltip')
        .style('visibility', 'hidden');
app/assets/javascripts/widgets/indicators/line/LineChart.js on lines 225..229
app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 239..243

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language