resource-watch/query

View on GitHub

Showing 65 of 65 total issues

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

    cf_terraialertsbyuse: {
        uri: '/terrai-alerts/use/${name}/${id}',
        method: 'GET',
        arguments: [{
            name: 'name',
Severity: Major
Found in app/src/services/endpoints.js and 9 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 20..40
app/src/services/endpoints.js on lines 58..78
app/src/services/endpoints.js on lines 122..142
app/src/services/endpoints.js on lines 160..180
app/src/services/endpoints.js on lines 224..244
app/src/services/endpoints.js on lines 262..282
app/src/services/endpoints.js on lines 468..488
app/src/services/endpoints.js on lines 506..526
app/src/services/endpoints.js on lines 712..732

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

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

    cf_gladalertsbyisoandregion: {
        uri: '/glad-alerts/admin/${iso}/${id1}',
        method: 'GET',
        arguments: [{
            name: 'iso',
Severity: Major
Found in app/src/services/endpoints.js and 9 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 20..40
app/src/services/endpoints.js on lines 58..78
app/src/services/endpoints.js on lines 160..180
app/src/services/endpoints.js on lines 224..244
app/src/services/endpoints.js on lines 262..282
app/src/services/endpoints.js on lines 468..488
app/src/services/endpoints.js on lines 506..526
app/src/services/endpoints.js on lines 712..732
app/src/services/endpoints.js on lines 750..770

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

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

    cf_guiralossbyuse: {
        uri: '/guira-loss/use/${name}/${id}',
        method: 'GET',
        arguments: [{
            name: 'name',
Severity: Major
Found in app/src/services/endpoints.js and 9 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 20..40
app/src/services/endpoints.js on lines 58..78
app/src/services/endpoints.js on lines 122..142
app/src/services/endpoints.js on lines 160..180
app/src/services/endpoints.js on lines 224..244
app/src/services/endpoints.js on lines 468..488
app/src/services/endpoints.js on lines 506..526
app/src/services/endpoints.js on lines 712..732
app/src/services/endpoints.js on lines 750..770

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

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

    cf_terraialertsbyisoandregion: {
        uri: '/terrai-alerts/admin/${iso}/${id1}',
        method: 'GET',
        arguments: [{
            name: 'iso',
Severity: Major
Found in app/src/services/endpoints.js and 9 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 20..40
app/src/services/endpoints.js on lines 58..78
app/src/services/endpoints.js on lines 122..142
app/src/services/endpoints.js on lines 160..180
app/src/services/endpoints.js on lines 224..244
app/src/services/endpoints.js on lines 262..282
app/src/services/endpoints.js on lines 468..488
app/src/services/endpoints.js on lines 506..526
app/src/services/endpoints.js on lines 750..770

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

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

    cf_guiralossbyisoandregion: {
        uri: '/guira-loss/admin/${iso}/${id1}',
        method: 'GET',
        arguments: [{
            name: 'iso',
Severity: Major
Found in app/src/services/endpoints.js and 9 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 20..40
app/src/services/endpoints.js on lines 58..78
app/src/services/endpoints.js on lines 122..142
app/src/services/endpoints.js on lines 160..180
app/src/services/endpoints.js on lines 262..282
app/src/services/endpoints.js on lines 468..488
app/src/services/endpoints.js on lines 506..526
app/src/services/endpoints.js on lines 712..732
app/src/services/endpoints.js on lines 750..770

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

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

    cf_umdlossgainbyiso: {
        uri: '/terrai-alerts/admin/${iso}',
        method: 'GET',
        arguments: [{
            name: 'iso',
Severity: Major
Found in app/src/services/endpoints.js and 2 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 843..863
app/src/services/endpoints.js on lines 889..909

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

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

    cf_umdlossgainbywdpa: {
        uri: '/terrai-alerts/wdpa/${id}',
        method: 'GET',
        arguments: [{
            name: 'id',
Severity: Major
Found in app/src/services/endpoints.js and 2 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 797..817
app/src/services/endpoints.js on lines 889..909

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

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

    cf_umdlossgainbygeostore: {
        uri: '/terrai-alerts',
        method: 'GET',
        arguments: [{
            name: 'geostore',
Severity: Major
Found in app/src/services/endpoints.js and 2 other locations - About 2 hrs to fix
app/src/services/endpoints.js on lines 797..817
app/src/services/endpoints.js on lines 843..863

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

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 isQuery has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    static async isQuery(tableName, parsed, sql, ctx, endpoint) {
        logger.debug('Is query');
        let datasetId = ctx.params.dataset || tableName;
        if (parsed.from && !datasetId) {
            datasetId = parsed.from.replace(/"/g, '').replace(/'/g, '');
Severity: Minor
Found in app/src/services/query.service.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function exports has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = (grunt) => {

    grunt.file.setBase('..');
    // eslint-disable-next-line import/no-extraneous-dependencies
    require('load-grunt-tasks')(grunt);
Severity: Major
Found in app/Gruntfile.js - About 2 hrs to fix

    Function isFunction has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static isFunction(parsed) {
            logger.debug('Checking if it is a function', parsed);
    
            if (!parsed.select || parsed.select.length !== 1 || parsed.select[0].type !== 'function') {
                throw new ValidationError(400, 'Invalid query. Function not found or not supported');
    Severity: Major
    Found in app/src/services/query.service.js - About 2 hrs to fix

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

          cf_guiralossbywdpa: {
              uri: '/guira-loss/wdpa/${id}',
              method: 'GET',
              arguments: [{
                  name: 'id',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_terraialertsbyiso: {
              uri: '/terrai-alerts/admin/${iso}',
              method: 'GET',
              arguments: [{
                  name: 'iso',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_gladalertsbyiso: {
              uri: '/glad-alerts/admin/${iso}',
              method: 'GET',
              arguments: [{
                  name: 'iso',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_prodeslossbywdpa: {
              uri: '/prodes-loss/wdpa/${id}',
              method: 'GET',
              arguments: [{
                  name: 'id',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_guiralossbygeostore: {
              uri: '/guira-loss',
              method: 'GET',
              arguments: [{
                  name: 'geostore',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_prodeslossbygeostore: {
              uri: '/prodes-loss',
              method: 'GET',
              arguments: [{
                  name: 'geostore',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_prodeslossbyiso: {
              uri: '/prodes-loss/admin/${iso}',
              method: 'GET',
              arguments: [{
                  name: 'iso',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_terraialertsbywdpa: {
              uri: '/terrai-alerts/wdpa/${id}',
              method: 'GET',
              arguments: [{
                  name: 'id',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 41..57
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 771..787

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

      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

          cf_viirsfiresbywdpa: {
              uri: '/viirs-active-fires/wdpa/${id}',
              method: 'GET',
              arguments: [{
                  name: 'id',
      Severity: Major
      Found in app/src/services/endpoints.js and 14 other locations - About 1 hr to fix
      app/src/services/endpoints.js on lines 3..19
      app/src/services/endpoints.js on lines 79..95
      app/src/services/endpoints.js on lines 105..121
      app/src/services/endpoints.js on lines 143..159
      app/src/services/endpoints.js on lines 181..197
      app/src/services/endpoints.js on lines 207..223
      app/src/services/endpoints.js on lines 245..261
      app/src/services/endpoints.js on lines 283..299
      app/src/services/endpoints.js on lines 451..467
      app/src/services/endpoints.js on lines 489..505
      app/src/services/endpoints.js on lines 527..543
      app/src/services/endpoints.js on lines 695..711
      app/src/services/endpoints.js on lines 733..749
      app/src/services/endpoints.js on lines 771..787

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

      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