resource-watch/query

View on GitHub

Showing 65 of 65 total issues

File endpoints.js has 918 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-template-curly-in-string */
module.exports = {
    cf_viirsfiresbyiso: {
        uri: '/viirs-active-fires/admin/${iso}',
        method: 'GET',
Severity: Major
Found in app/src/services/endpoints.js - About 2 days to fix

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

        cf_imazonalertsbyisoandregion: {
            uri: '/imazon-alerts/admin/${iso}/${id1}',
            method: 'GET',
            arguments: [{
                name: 'iso',
    Severity: Major
    Found in app/src/services/endpoints.js and 3 other locations - About 4 hrs to fix
    app/src/services/endpoints.js on lines 388..416
    app/src/services/endpoints.js on lines 578..606
    app/src/services/endpoints.js on lines 632..660

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

    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

        cf_quiccalertsbyuse: {
            uri: '/quicc-alerts/use/${name}/${id}',
            method: 'GET',
            arguments: [{
                name: 'name',
    Severity: Major
    Found in app/src/services/endpoints.js and 3 other locations - About 4 hrs to fix
    app/src/services/endpoints.js on lines 334..362
    app/src/services/endpoints.js on lines 388..416
    app/src/services/endpoints.js on lines 578..606

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

    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

        cf_quiccalertsbyisoandregion: {
            uri: '/quicc-alerts/admin/${iso}/${id1}',
            method: 'GET',
            arguments: [{
                name: 'iso',
    Severity: Major
    Found in app/src/services/endpoints.js and 3 other locations - About 4 hrs to fix
    app/src/services/endpoints.js on lines 334..362
    app/src/services/endpoints.js on lines 388..416
    app/src/services/endpoints.js on lines 632..660

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

    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

        cf_imazonalertsbyuse: {
            uri: '/imazon-alerts/use/${name}/${id}',
            method: 'GET',
            arguments: [{
                name: 'name',
    Severity: Major
    Found in app/src/services/endpoints.js and 3 other locations - About 4 hrs to fix
    app/src/services/endpoints.js on lines 334..362
    app/src/services/endpoints.js on lines 578..606
    app/src/services/endpoints.js on lines 632..660

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

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

        cf_quiccalertsbywdpa: {
            uri: '/quicc-alerts/wdpa/${id}',
            method: 'GET',
            arguments: [{
                name: 'id',
    Severity: Major
    Found in app/src/services/endpoints.js and 5 other locations - About 3 hrs to fix
    app/src/services/endpoints.js on lines 309..333
    app/src/services/endpoints.js on lines 363..387
    app/src/services/endpoints.js on lines 417..441
    app/src/services/endpoints.js on lines 553..577
    app/src/services/endpoints.js on lines 661..685

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

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

        cf_imazonalertsbygeostore: {
            uri: '/imazon-alerts',
            method: 'GET',
            arguments: [{
                name: 'geostore',
    Severity: Major
    Found in app/src/services/endpoints.js and 5 other locations - About 3 hrs to fix
    app/src/services/endpoints.js on lines 309..333
    app/src/services/endpoints.js on lines 363..387
    app/src/services/endpoints.js on lines 553..577
    app/src/services/endpoints.js on lines 607..631
    app/src/services/endpoints.js on lines 661..685

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

    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

        cf_umdlossgainbyuse: {
            uri: '/terrai-alerts/use/${name}/${id}',
            method: 'GET',
            arguments: [{
                name: 'name',
    Severity: Major
    Found in app/src/services/endpoints.js and 1 other location - About 3 hrs to fix
    app/src/services/endpoints.js on lines 818..842

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

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

        cf_imazonalertsbywdpa: {
            uri: '/imazon-alerts/wdpa/${id}',
            method: 'GET',
            arguments: [{
                name: 'id',
    Severity: Major
    Found in app/src/services/endpoints.js and 5 other locations - About 3 hrs to fix
    app/src/services/endpoints.js on lines 309..333
    app/src/services/endpoints.js on lines 417..441
    app/src/services/endpoints.js on lines 553..577
    app/src/services/endpoints.js on lines 607..631
    app/src/services/endpoints.js on lines 661..685

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

    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

        cf_umdlossgainbyisoandregion: {
            uri: '/terrai-alerts/admin/${iso}/${id1}',
            method: 'GET',
            arguments: [{
                name: 'iso',
    Severity: Major
    Found in app/src/services/endpoints.js and 1 other location - About 3 hrs to fix
    app/src/services/endpoints.js on lines 864..888

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

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

        cf_quiccalertsbygeostore: {
            uri: '/quicc-alerts',
            method: 'GET',
            arguments: [{
                name: 'geostore',
    Severity: Major
    Found in app/src/services/endpoints.js and 5 other locations - About 3 hrs to fix
    app/src/services/endpoints.js on lines 309..333
    app/src/services/endpoints.js on lines 363..387
    app/src/services/endpoints.js on lines 417..441
    app/src/services/endpoints.js on lines 553..577
    app/src/services/endpoints.js on lines 607..631

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

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

        cf_imazonalertsbyiso: {
            uri: '/imazon-alerts/admin/${iso}',
            method: 'GET',
            arguments: [{
                name: 'iso',
    Severity: Major
    Found in app/src/services/endpoints.js and 5 other locations - About 3 hrs to fix
    app/src/services/endpoints.js on lines 363..387
    app/src/services/endpoints.js on lines 417..441
    app/src/services/endpoints.js on lines 553..577
    app/src/services/endpoints.js on lines 607..631
    app/src/services/endpoints.js on lines 661..685

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

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

        cf_quiccalertsbyiso: {
            uri: '/quicc-alerts/admin/${iso}',
            method: 'GET',
            arguments: [{
                name: 'iso',
    Severity: Major
    Found in app/src/services/endpoints.js and 5 other locations - About 3 hrs to fix
    app/src/services/endpoints.js on lines 309..333
    app/src/services/endpoints.js on lines 363..387
    app/src/services/endpoints.js on lines 417..441
    app/src/services/endpoints.js on lines 607..631
    app/src/services/endpoints.js on lines 661..685

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

    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 isFunction has a Cognitive Complexity of 25 (exceeds 5 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: Minor
    Found in app/src/services/query.service.js - About 3 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 isQuery has 76 lines of code (exceeds 25 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: Major
    Found in app/src/services/query.service.js - About 3 hrs to fix

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

          cf_prodeslossbyisoandregion: {
              uri: '/prodes-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 224..244
      app/src/services/endpoints.js on lines 262..282
      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_viirsfiresbyisoandregion: {
              uri: '/viirs-active-fires/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 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
      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_viirsfiresbyuse: {
              uri: '/viirs-active-fires/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 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
      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_gladalertsbyuse: {
              uri: '/glad-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 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_prodeslossbyuse: {
              uri: '/prodes-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 262..282
      app/src/services/endpoints.js on lines 468..488
      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

      Severity
      Category
      Status
      Source
      Language