Vizzuality/gfw-climate

View on GitHub

Showing 920 of 1,213 total issues

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      renderMobile: function() {
        this.$el.html(this.templateMobile());
        this.cacheVars();
        this.inits();
      },
Severity: Major
Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 3 other locations - About 50 mins to fix
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 120..124
app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 97..101
app/assets/javascripts/widgets/indicators/multiline/MultiLineChartIndicator.js on lines 101..105

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      _initBindings: function() {
        // backdrop
        this.$backdrop.on(
          'click',
          _.bind(function() {
Severity: Minor
Found in app/assets/javascripts/views/SourceBottomView.js and 1 other location - About 50 mins to fix
app/assets/javascripts/views/SourceMobileFriendlyView.js on lines 64..72

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

        var barsContent = this.svg
          .append('g')
          .attr(
            'transform',
            'translate(' + leftOffset + ', ' + this.defaults.rowHeight + ')'
app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 556..561

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      render: function() {
        this.$el.html(this.template());
        this.cacheVars();
        this._drawGraph();
      },
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 120..124
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 126..130
app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 97..101

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      changeArea: function(e) {
        this.area = $(e.currentTarget).val();
        this.$countryButton.removeClass('disabled');
      },
Severity: Minor
Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 50 mins to fix
app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 301..304

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

        var barsContent = this.svg
          .append('g')
          .attr(
            'transform',
            'translate(' + leftOffset + ', ' + this.defaults.rowHeight + ')'
app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 514..519

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      render: function() {
        this.$el.html(this.template());
        this.cacheVars();
        this.inits();
      },
Severity: Major
Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 3 other locations - About 50 mins to fix
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 126..130
app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 97..101
app/assets/javascripts/widgets/indicators/multiline/MultiLineChartIndicator.js on lines 101..105

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      _initBindings: function() {
        // backdrop
        this.$backdrop.on(
          'click',
          _.bind(function() {
Severity: Minor
Found in app/assets/javascripts/views/SourceMobileFriendlyView.js and 1 other location - About 50 mins to fix
app/assets/javascripts/views/SourceBottomView.js on lines 59..67

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

    _getUrl: function(x, y, z) {
      return new UriTemplate(this.options.urlTemplate).fillFromObject({
        x: x,
        y: y,
        z: z
Severity: Minor
Found in app/assets/javascripts/abstract/layer/ImageLayerClass.js and 1 other location - About 50 mins to fix
app/assets/javascripts/abstract/layer/CanvasLayerClass.js on lines 151..157

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      _changeDataByYear: function(ev) {
        var current = ev.currentTarget;
        this.currentYear = parseInt(current.value, 10);

        this._renderMainChart();
app/assets/javascripts/insights/views/InsightsGladAlertsView.js on lines 364..369

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      render: function() {
        this.$el.html(this.template());
        this.cacheVars();
        this.inits();
      },
Severity: Major
Found in app/assets/javascripts/map/views/tabs/SubscriptionView.js and 3 other locations - About 50 mins to fix
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 120..124
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 126..130
app/assets/javascripts/widgets/indicators/multiline/MultiLineChartIndicator.js on lines 101..105

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

    _changeDataByYear: function(ev) {
      var current = ev.currentTarget;
      this.currentYear = parseInt(current.value, 10);

      this._renderMainChart();
Severity: Minor
Found in app/assets/javascripts/insights/views/InsightsGladAlertsView.js and 1 other location - About 50 mins to fix
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsView.js on lines 426..431

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

    _getUrl: function(x, y, z) {
      return new UriTemplate(this.options.urlTemplate).fillFromObject({
        x: x,
        y: y,
        z: z
Severity: Minor
Found in app/assets/javascripts/abstract/layer/CanvasLayerClass.js and 1 other location - About 50 mins to fix
app/assets/javascripts/abstract/layer/ImageLayerClass.js on lines 83..89

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      changeArea: function(e) {
        this.area = $(e.currentTarget).val();
        this.$countryButton.removeClass('disabled');
      },
Severity: Minor
Found in app/assets/javascripts/map/views/tabs/SubscriptionView.js and 1 other location - About 50 mins to fix
app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 335..338

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

        this.svg
          .append('g')
          .attr('class', 'xaxis')
          .attr('transform', 'translate(0,{0})'.format(height / 2 - 3))
          .call(
Severity: Minor
Found in app/assets/javascripts/abstract/timeline/TimelineMonthClass.js and 1 other location - About 50 mins to fix
app/assets/javascripts/abstract/timeline/TimelineMonthClass.js on lines 364..368

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language