Vizzuality/gfw-climate

View on GitHub

Showing 920 of 1,213 total issues

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

      cache: function() {
        this.graphicEl = this.$('.scroll__graphic');
        this.mouseScroll = this.$('#mouse-scroll-wrapper');
      },
app/assets/javascripts/insights/views/emissions-calculator/EmissionCalculatorIndexView.js on lines 46..49

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 APIURLS = {
      getClimateConfig: '/query?sql=SELECT iso FROM {countriesConfigDataset}',
      getCountriesList:
        '/query?sql=SELECT name_engli as name, iso FROM {countriesDataset} WHERE iso IN({climateCountries}) ORDER BY name ASC',
      getCountriesListGeo:
Severity: Minor
Found in app/assets/javascripts/services/CountryService.js and 1 other location - About 40 mins to fix
app/assets/javascripts/map/views/maptypes/basemapStyles.js on lines 7..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

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

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

            } else if (value[0] === value[1]) {
              this.yearsSlider.noUiSlider.set([
                value[0],
                parseInt(value[0], 10) + 1,
                value[2]
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 109..121

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 488..493

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 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/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 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/ImageMaptypeLayerClass'], function(
  ImageMaptypeLayerClass
) {
  'use strict';

Severity: Major
Found in app/assets/javascripts/map/views/layers/TotalCarbonLayer.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/ProdesCoverLayer.js on lines 6..17
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 CustomDarkOnlyLabelsLayer = ImageLayerClass.extend({
    options: {
app/assets/javascripts/map/views/layers/CustomDarkBaseLabelsLayer.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

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/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/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

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

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/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/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 ImazonCoverLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/ImazonCoverLayer.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/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/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

Severity
Category
Status
Source
Language