Vizzuality/gfw-climate

View on GitHub

Showing 1,213 of 1,213 total issues

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

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

  var IdnLeuserLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/IdnLeuserLayer.js and 53 other locations - About 1 hr to fix
app/assets/javascripts/map/views/layers/AusLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/BraLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CafLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CanLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CanLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CanMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CarbonLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CmrLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CmrMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CmrOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CmrResourceRightsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CodLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CodMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogWoodFiberPlantationsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/ColMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CriLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/GabLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GabMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GabWoodFiberPlantationsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GnqLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GnqResourceRightsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnForMorLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnWoodFiberPlantationsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/KhmMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/KhmProtectedAreasLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/LandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/LbrLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/LbrOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/LbrResourceRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/LoggingLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MexMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MysLoggingLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MysOilPalmLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MysWoodFiberPlantationsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/NamResourceRightsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/NzlLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/OilPalmLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PanLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerBufferLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerNatPALayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerPermForestLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerPrivPALayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerRegPALayer.js on lines 6..21
app/assets/javascripts/map/views/layers/ProtectedAreasCDBLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/ResourceRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/UsaConservationEasementsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/WoodFiberPlantationsLayer.js on lines 6..21

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

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

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

  var CodMiningLayer = CartoDBLayerClass.extend({
    options: {
Severity: Major
Found in app/assets/javascripts/map/views/layers/CodMiningLayer.js and 53 other locations - About 1 hr to fix
app/assets/javascripts/map/views/layers/AusLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/BraLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CafLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CanLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CanLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CanMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CarbonLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CmrLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CmrMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CmrOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CmrResourceRightsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CodLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/CogWoodFiberPlantationsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/ColMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/CriLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/GabLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GabMiningLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GabWoodFiberPlantationsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GnqLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/GnqResourceRightsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnForMorLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnLeuserLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/IdnWoodFiberPlantationsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/KhmMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/KhmProtectedAreasLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/LandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/LbrLoggingLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/LbrOilPalmLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/LbrResourceRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/LoggingLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MexMiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MiningLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MysLoggingLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MysOilPalmLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/MysWoodFiberPlantationsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/NamResourceRightsLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/NzlLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/OilPalmLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PanLandRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerBufferLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerNatPALayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerPermForestLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerPrivPALayer.js on lines 6..21
app/assets/javascripts/map/views/layers/PerRegPALayer.js on lines 6..21
app/assets/javascripts/map/views/layers/ProtectedAreasCDBLayer.js on lines 6..20
app/assets/javascripts/map/views/layers/ResourceRightsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/UsaConservationEasementsLayer.js on lines 6..21
app/assets/javascripts/map/views/layers/WoodFiberPlantationsLayer.js on lines 6..21

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

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

        try {
          var successful = document.execCommand('copy');
          $(e.currentTarget).html('copied');
        } catch (err) {
          mps.publish('Notification/open', ['not-clipboard-support']);
Severity: Major
Found in app/assets/javascripts/widgets/views/ShareWidgetView.js and 1 other location - About 1 hr to fix
app/assets/javascripts/views/ShareView.js on lines 253..258

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

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

Function _hideYears has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      _hideYears: function(elementID) {
        var $opositeSelector;
        var selectedYear;
        var condition;
        var value;
Severity: Minor
Found in app/assets/javascripts/embed/views/pantropical/PantropicalView.js - About 1 hr to fix

    Function commonIsoChanges has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          commonIsoChanges: function() {
            this.setIsoLayers();
            this.setButtons(!!this.iso);
            if (this.mobile) {
              var country = _.find(
    Severity: Minor
    Found in app/assets/javascripts/map/views/tabs/CountriesView.js - About 1 hr to fix

      Function _buildResource has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            _buildResource: function(resource) {
              mps.publish('Spinner/start');
              var date, dateFormat;
              var baselayer = this.status.get('baselayer');
      
      
      Severity: Minor
      Found in app/assets/javascripts/map/presenters/tabs/SubscriptionPresenter.js - About 1 hr to fix

        Function _render has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _render: function(tile) {
              var month = this.endMonth || -BASE_MONTH + MAX_MONTHS;
              var month_start = this.startMonth || 0;
              var month_change = this.top_date;
              var w = tile.canvas.width;
        Severity: Minor
        Found in app/assets/javascripts/abstract/layer/CanvasJSONLayerClass.js - About 1 hr to fix

          Function _setType has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                _setType: function(e, kind) {
                  this.$searchbox.addClass('blocked');
                  if (!!e && !!!kind) {
                    var $target = $(e.target);
                    if ($target.hasClass('selected')) return;
          Severity: Minor
          Found in app/assets/javascripts/map/views/controls/SearchboxView.js - About 1 hr to fix

            Function _initCrownSlider has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  _initCrownSlider: function() {
                    this.crownSlider = document.getElementById('crown-cover-slider');
                    nouislider.create(this.crownSlider, {
                      start: this.status.get('thresh'),
                      animate: true,
            Severity: Minor
            Found in app/assets/javascripts/countries/views/CountryReportView.js - About 1 hr to fix

              Function _hideYears has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    _hideYears: function(elementID) {
                      var $opositeSelector;
                      var selectedYear;
                      var condition;
                      var value;
              Severity: Minor
              Found in app/assets/javascripts/countries/views/CountryPantropicalView.js - About 1 hr to fix

                Function _parseData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      _parseData: function() {
                        var country = this.status.get('country'),
                          data,
                          filter;
                
                
                Severity: Minor
                Found in app/assets/javascripts/countries/views/show/FixedHeaderView.js - About 1 hr to fix

                  Function search_field_scale has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          (Chosen.prototype.search_field_scale = function() {
                            var b, c, d, e, f, g, h, i, j;
                            if (this.is_multiple) {
                              for (
                                d = 0,
                  Severity: Minor
                  Found in app/assets/javascripts/chosen.jquery.min.js - About 1 hr to fix

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

                          _getUrl: function(x, y, z) {
                            return new UriTemplate(this.options.urlTemplate).fillFromObject({
                              x: x,
                              y: y,
                              z: z,
                    Severity: Major
                    Found in app/assets/javascripts/map/views/layers/LossLayer.js and 3 other locations - About 1 hr to fix
                    app/assets/javascripts/map/views/layers/BiomassLossLayer.js on lines 141..148
                    app/assets/javascripts/map/views/layers/CarbonStocksLayer.js on lines 113..120
                    app/assets/javascripts/map/views/layers/Forest2000Layer.js on lines 75..82

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

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

                        _defineRequests: function() {
                          var cache = this._cacheConfig;
                          var config = { cache: cache, url: this._uriTemplate };
                          ds.define(this.requestId, config);
                        },
                    Severity: Major
                    Found in app/assets/javascripts/map/services/SitesService.js and 4 other locations - About 1 hr to fix
                    app/assets/javascripts/map/services/CountriesService.js on lines 33..38
                    app/assets/javascripts/map/services/CountryService.js on lines 33..38
                    app/assets/javascripts/map/services/RegionService.js on lines 38..43
                    app/assets/javascripts/map/services/TreeLossCarbonEmissionsService.js on lines 36..41

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

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

                        _defineRequests: function() {
                          var cache = this._cacheConfig;
                          var config = { cache: cache, url: this._uriTemplate };
                    
                          ds.define(this.requestId, config);
                    app/assets/javascripts/map/services/CountriesService.js on lines 33..38
                    app/assets/javascripts/map/services/CountryService.js on lines 33..38
                    app/assets/javascripts/map/services/RegionService.js on lines 38..43
                    app/assets/javascripts/map/services/SitesService.js on lines 33..37

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

                    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

                          _getUrl: function(x, y, z) {
                            return new UriTemplate(this.options.urlTemplate).fillFromObject({
                              x: x,
                              y: y,
                              z: z,
                    Severity: Major
                    Found in app/assets/javascripts/map/views/layers/Forest2000Layer.js and 3 other locations - About 1 hr to fix
                    app/assets/javascripts/map/views/layers/BiomassLossLayer.js on lines 141..148
                    app/assets/javascripts/map/views/layers/CarbonStocksLayer.js on lines 113..120
                    app/assets/javascripts/map/views/layers/LossLayer.js on lines 97..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 61.

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

                        _defineRequests: function() {
                          var cache = this._cacheConfig;
                          var config = { cache: cache, url: this._uriTemplate };
                    
                          ds.define(this.requestId, config);
                    Severity: Major
                    Found in app/assets/javascripts/map/services/CountryService.js and 4 other locations - About 1 hr to fix
                    app/assets/javascripts/map/services/CountriesService.js on lines 33..38
                    app/assets/javascripts/map/services/RegionService.js on lines 38..43
                    app/assets/javascripts/map/services/SitesService.js on lines 33..37
                    app/assets/javascripts/map/services/TreeLossCarbonEmissionsService.js on lines 36..41

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

                    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

                        render: function() {
                          var self = this;
                    
                          this.$el.html('');
                    
                    
                    app/assets/javascripts/embed/views/pantropical/PantropicalTotalEmissionsView.js on lines 11..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 61.

                    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

                          _getUrl: function(x, y, z) {
                            return new UriTemplate(this.options.urlTemplate).fillFromObject({
                              x: x,
                              y: y,
                              z: z,
                    app/assets/javascripts/map/views/layers/CarbonStocksLayer.js on lines 113..120
                    app/assets/javascripts/map/views/layers/Forest2000Layer.js on lines 75..82
                    app/assets/javascripts/map/views/layers/LossLayer.js on lines 97..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 61.

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

                        _defineRequests: function() {
                          var cache = this._cacheConfig;
                          var config = { cache: cache, url: this._uriTemplate };
                    
                          ds.define(this.requestId, config);
                    Severity: Major
                    Found in app/assets/javascripts/map/services/CountriesService.js and 4 other locations - About 1 hr to fix
                    app/assets/javascripts/map/services/CountryService.js on lines 33..38
                    app/assets/javascripts/map/services/RegionService.js on lines 38..43
                    app/assets/javascripts/map/services/SitesService.js on lines 33..37
                    app/assets/javascripts/map/services/TreeLossCarbonEmissionsService.js on lines 36..41

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

                    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