Vizzuality/gfw-climate

View on GitHub

Showing 1,213 of 1,213 total issues

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

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

  var IntactForestLayer2000 = CartoDBLayerClass.extend({
    options: {
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/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)
      );
Severity: Minor
Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 35 mins to fix
app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 43..46
app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 45..48

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

      this.tooltip = d3
        .select('body')
        .append('div')
        .attr('class', 'linegraph-tooltip')
        .style('visibility', 'hidden');
Severity: Minor
Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 35 mins to fix
app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 239..243
app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 263..267

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

      _subscriptions: [
        {
          'Place/go': function(params) {
            this.status.set(params);
            this.placeGo(params);
app/assets/javascripts/embed/presenters/EmbedCountryPresenter.js on lines 33..40

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

        deviationGroup
          .append('text')
          .attr('class', 'value')
          .text(function(d) {
            var value = Math.round(d.delta_perc);
app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 575..596
app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 433..450
app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 533..548

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

        xAxis
          .selectAll('line')
          .attr('x1', _this.defaults.paddingXAxisLabels)
          .attr('x2', _this.defaults.paddingXAxisLabels);
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 442..445

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

        xAxis
          .selectAll('line')
          .attr('x1', _this.defaults.paddingXAxisLabels)
          .attr('x2', _this.defaults.paddingXAxisLabels);
app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 348..351

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

        var z = d3.scale
          .linear()
          .domain([zMin, zMax])
          .range([height, 0])
          .nice();
Severity: Minor
Found in app/assets/javascripts/widgets/indicators/bars/BarChart.js and 1 other location - About 35 mins to fix
app/assets/javascripts/widgets/indicators/bars/BarChart.js on lines 112..116

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

        var y = d3.scale
          .linear()
          .domain([yMin, yMax])
          .range([height, 0])
          .nice();
Severity: Minor
Found in app/assets/javascripts/widgets/indicators/bars/BarChart.js and 1 other location - About 35 mins to fix
app/assets/javascripts/widgets/indicators/bars/BarChart.js on lines 106..110

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