pacificclimate/climate-explorer-frontend

View on GitHub
src/core/__test_data__/sample-API-results.js

Summary

Maintainability
D
1 day
Test Coverage

File sample-API-results.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*********************************************************************
 * sample-API-results.js - sample data for testing.
 *
 * A collection of objects representing sample results from the
 * climate explorer backend API, used to test data validation, graph
Severity: Minor
Found in src/core/__test_data__/sample-API-results.js - About 3 hrs to fix

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

    const tasmaxData = {
      r1i1p1: {
        data: {
          "1997-01-15T00:00:00Z": -19.534196834187902,
          "2055-01-15T00:00:00Z": -17.825752320828578,
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 1 other location - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 154..166

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

    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

    const tasminData = {
      r1i1p1: {
        data: {
          "1997-01-15T00:00:00Z": -28.265036079409857,
          "2055-01-15T00:00:00Z": -24.776227407561837,
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 1 other location - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 140..152

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

    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

      "tasmax_mClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19610101-19901231_Canada":
        {
          institution: "PCIC",
          ensemble_member: "r1i1p1",
          variables: {
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 5 other locations - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 204..217
    src/core/__test_data__/sample-API-results.js on lines 219..232
    src/core/__test_data__/sample-API-results.js on lines 234..247
    src/core/__test_data__/sample-API-results.js on lines 249..262
    src/core/__test_data__/sample-API-results.js on lines 264..277

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

    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

      "tasmax_mClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19810101-20101231_Canada":
        {
          institution: "PCIC",
          ensemble_member: "r1i1p1",
          variables: {
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 5 other locations - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 189..202
    src/core/__test_data__/sample-API-results.js on lines 204..217
    src/core/__test_data__/sample-API-results.js on lines 219..232
    src/core/__test_data__/sample-API-results.js on lines 234..247
    src/core/__test_data__/sample-API-results.js on lines 249..262

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

    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

      "tasmin_mClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19610101-19901231_Canada":
        {
          institution: "PCIC",
          ensemble_member: "r1i1p1",
          variables: {
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 5 other locations - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 189..202
    src/core/__test_data__/sample-API-results.js on lines 204..217
    src/core/__test_data__/sample-API-results.js on lines 219..232
    src/core/__test_data__/sample-API-results.js on lines 249..262
    src/core/__test_data__/sample-API-results.js on lines 264..277

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

    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

      "tasmax_aClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19610101-19901231_Canada":
        {
          institution: "PCIC",
          ensemble_member: "r1i1p1",
          variables: {
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 5 other locations - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 189..202
    src/core/__test_data__/sample-API-results.js on lines 204..217
    src/core/__test_data__/sample-API-results.js on lines 234..247
    src/core/__test_data__/sample-API-results.js on lines 249..262
    src/core/__test_data__/sample-API-results.js on lines 264..277

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

    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

      "tasmax_sClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19610101-19901231_Canada":
        {
          institution: "PCIC",
          ensemble_member: "r1i1p1",
          variables: {
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 5 other locations - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 189..202
    src/core/__test_data__/sample-API-results.js on lines 219..232
    src/core/__test_data__/sample-API-results.js on lines 234..247
    src/core/__test_data__/sample-API-results.js on lines 249..262
    src/core/__test_data__/sample-API-results.js on lines 264..277

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

    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

      "pr_mClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19610101-19901231_Canada":
        {
          institution: "PCIC",
          ensemble_member: "r1i1p1",
          variables: {
    Severity: Major
    Found in src/core/__test_data__/sample-API-results.js and 5 other locations - About 1 hr to fix
    src/core/__test_data__/sample-API-results.js on lines 189..202
    src/core/__test_data__/sample-API-results.js on lines 204..217
    src/core/__test_data__/sample-API-results.js on lines 219..232
    src/core/__test_data__/sample-API-results.js on lines 234..247
    src/core/__test_data__/sample-API-results.js on lines 264..277

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

    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

      "tasmax_mClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19810101-20101231_Canada":
        {
          min: -36.134885262000005,
          units: "degC",
          mean: -19.534196834187902,
    Severity: Minor
    Found in src/core/__test_data__/sample-API-results.js and 1 other location - About 50 mins to fix
    src/core/__test_data__/sample-API-results.js on lines 112..122

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 52.

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

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

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

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

    Refactorings

    Further Reading

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

      "tasmax_mClim_BCCAQv2_bcc-csm1-1-m_historical-rcp45_r1i1p1_19610101-19901231_Canada":
        {
          min: -37.532611494,
          units: "degC",
          mean: -20.599000150601793,
    Severity: Minor
    Found in src/core/__test_data__/sample-API-results.js and 1 other location - About 50 mins to fix
    src/core/__test_data__/sample-API-results.js on lines 123..133

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 52.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status