pacificclimate/climate-explorer-frontend

View on GitHub
src/core/__tests__/util-test.js

Summary

Maintainability
F
5 days
Test Coverage

File util-test.js has 501 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/********************************************************
 * util-test.js - tests for the functions in util.js
 *
 * There is one test (sometimes multiple parts) for each
 * function in ../util.js. The tests have the same names as
Severity: Major
Found in src/core/__tests__/util-test.js - About 1 day to fix

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

      it("rejects datasets missing units", function () {
        var noUnits = JSON.parse(JSON.stringify(mockAPI.tasmaxStats));
        noUnits[id] = _.omit(noUnits[id], "units");
        const func = () => {
          util.validateStatsData({ data: noUnits });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 3 hrs to fix
    src/core/__tests__/util-test.js on lines 159..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 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

      it("rejects missing statistical values", function () {
        var missing = JSON.parse(JSON.stringify(mockAPI.tasmaxStats));
        missing[id] = _.omit(missing[id], "mean");
        const func = () => {
          util.validateStatsData({ data: missing });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 3 hrs to fix
    src/core/__tests__/util-test.js on lines 167..174

    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

      it("rejects data sets without units", function () {
        var noUnits = _.omit(mockAPI.monthlyTasmaxTimeseries, "units");
        const func = () => {
          util.validateUnstructuredTimeseriesData({ data: noUnits });
        };
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 2 hrs to fix
    src/core/__tests__/util-test.js on lines 199..205

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

    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

      it("rejects data sets without units", function () {
        var noUnits = _.omit(mockAPI.monthlyTasmaxTimeseries, "units");
        const func = () => {
          util.validateAnnualCycleData({ data: noUnits });
        };
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 2 hrs to fix
    src/core/__tests__/util-test.js on lines 259..265

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

    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

    describe("extendedDateToBasicDate", function () {
      it("converts an extended format date to a basic format date", function () {
        expect(util.extendedDateToBasicDate("1997-01-15T00:00:00Z")).toBe(
          "1997-01-15",
        );
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 439..444

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

    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

    describe("timestampToYear", function () {
      it("extracts the year from ISO 8601 timestamps", function () {
        expect(util.timestampToYear("1977-01-01T11:32:12Z")).toBe("1977");
        expect(util.timestampToYear("2020-03-24")).toBe("2020");
      });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 390..399

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

    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

      it("converts timestamps into monthly values", function () {
        expect(
          util.timestampToTimeOfYear("1977-07-15T00:00:00Z", "monthly", false),
        ).toBe("July");
        expect(
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 424..431

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

    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

      it("converts timestamps into annual values", function () {
        expect(
          util.timestampToTimeOfYear("1977-07-15T00:00:00Z", "yearly", true),
        ).toBe("Annual 1977");
        expect(
    Severity: Major
    Found in src/core/__tests__/util-test.js and 1 other location - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 402..409

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

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

      it("rejects Workzeug error messages", function () {
        const func = () => {
          util.validateStatsData({
            data: `<html>
            <head>
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 108..117
    src/core/__tests__/util-test.js on lines 189..198
    src/core/__tests__/util-test.js on lines 249..258
    src/core/__tests__/util-test.js on lines 295..304

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 61.

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

      it("rejects Workzeug error messages", function () {
        const func = () => {
          util.validateLongTermAverageData({
            data: `<html>
               <head>
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 141..150
    src/core/__tests__/util-test.js on lines 189..198
    src/core/__tests__/util-test.js on lines 249..258
    src/core/__tests__/util-test.js on lines 295..304

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 61.

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

      it("rejects Workzeug error messages", function () {
        const func = () => {
          util.validateAnnualCycleData({
            data: `<html>
            <head>
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 108..117
    src/core/__tests__/util-test.js on lines 141..150
    src/core/__tests__/util-test.js on lines 249..258
    src/core/__tests__/util-test.js on lines 295..304

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 61.

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

      it("rejects Workzeug error messages", function () {
        const func = () => {
          util.validateUnstructuredTimeseriesData({
            data: `<html>
            <head>
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 108..117
    src/core/__tests__/util-test.js on lines 141..150
    src/core/__tests__/util-test.js on lines 189..198
    src/core/__tests__/util-test.js on lines 295..304

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 61.

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

      it("rejects Workzeug error messages", function () {
        const func = () => {
          util.validateUnstructuredTimeseriesData({
            data: `<html>
            <head>
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 108..117
    src/core/__tests__/util-test.js on lines 141..150
    src/core/__tests__/util-test.js on lines 189..198
    src/core/__tests__/util-test.js on lines 249..258

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

    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

      it("rejects empty data sets", function () {
        const func = () => {
          util.validateLongTermAverageData({ data: {} });
        };
        expect(func).toThrow();
    Severity: Major
    Found in src/core/__tests__/util-test.js and 3 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 135..140
    src/core/__tests__/util-test.js on lines 183..188
    src/core/__tests__/util-test.js on lines 243..248

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

      it("rejects empty data sets", function () {
        const func = () => {
          util.validateUnstructuredTimeseriesData({ data: {} });
        };
        expect(func).toThrow();
    Severity: Major
    Found in src/core/__tests__/util-test.js and 3 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 102..107
    src/core/__tests__/util-test.js on lines 135..140
    src/core/__tests__/util-test.js on lines 183..188

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

      it("rejects empty data sets", function () {
        const func = () => {
          util.validateStatsData({ data: {} });
        };
        expect(func).toThrow();
    Severity: Major
    Found in src/core/__tests__/util-test.js and 3 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 102..107
    src/core/__tests__/util-test.js on lines 183..188
    src/core/__tests__/util-test.js on lines 243..248

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

      it("rejects empty data sets", function () {
        const func = () => {
          util.validateAnnualCycleData({ data: {} });
        };
        expect(func).toThrow();
    Severity: Major
    Found in src/core/__tests__/util-test.js and 3 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 102..107
    src/core/__tests__/util-test.js on lines 135..140
    src/core/__tests__/util-test.js on lines 243..248

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

      it("accepts valid datasets", function () {
        expect(util.validateStatsData({ data: mockAPI.tasmaxStats })).toEqual({
          data: mockAPI.tasmaxStats,
        });
      });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 225..229
    src/core/__tests__/util-test.js on lines 230..234
    src/core/__tests__/util-test.js on lines 235..239
    src/core/__tests__/util-test.js on lines 321..325

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

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

      it("accepts valid monthly resolution data", function () {
        expect(
          util.validateAnnualCycleData({ data: mockAPI.monthlyTasmaxTimeseries }),
        ).toEqual({ data: mockAPI.monthlyTasmaxTimeseries });
      });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 175..179
    src/core/__tests__/util-test.js on lines 230..234
    src/core/__tests__/util-test.js on lines 235..239
    src/core/__tests__/util-test.js on lines 321..325

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

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

      it("accepts valid seasonal resolution data", function () {
        expect(
          util.validateAnnualCycleData({ data: mockAPI.seasonalTasmaxTimeseries }),
        ).toEqual({ data: mockAPI.seasonalTasmaxTimeseries });
      });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 175..179
    src/core/__tests__/util-test.js on lines 225..229
    src/core/__tests__/util-test.js on lines 235..239
    src/core/__tests__/util-test.js on lines 321..325

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

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

      it("accepts valid yearly resolution data", function () {
        expect(
          util.validateAnnualCycleData({ data: mockAPI.annualTasmaxTimeseries }),
        ).toEqual({ data: mockAPI.annualTasmaxTimeseries });
      });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 175..179
    src/core/__tests__/util-test.js on lines 225..229
    src/core/__tests__/util-test.js on lines 230..234
    src/core/__tests__/util-test.js on lines 321..325

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

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

      it("accepts a valid watershed", function () {
        expect(util.validateWatershedData({ data: mockAPI.watershed })).toEqual({
          data: mockAPI.watershed,
        });
      });
    Severity: Major
    Found in src/core/__tests__/util-test.js and 4 other locations - About 1 hr to fix
    src/core/__tests__/util-test.js on lines 175..179
    src/core/__tests__/util-test.js on lines 225..229
    src/core/__tests__/util-test.js on lines 230..234
    src/core/__tests__/util-test.js on lines 235..239

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

    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

      {
        max: 7.41,
        mean: -20.6,
        median: -21.79,
        min: -37.53,
    Severity: Minor
    Found in src/core/__tests__/util-test.js and 1 other location - About 40 mins to fix
    src/core/__tests__/util-test.js on lines 36..45

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

    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

      {
        max: 7.91,
        mean: -19.53,
        median: -20.56,
        min: -36.13,
    Severity: Minor
    Found in src/core/__tests__/util-test.js and 1 other location - About 40 mins to fix
    src/core/__tests__/util-test.js on lines 26..35

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

    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