18F/web-design-standards

View on GitHub
packages/usa-date-picker/src/test/date-picker.spec.js

Summary

Maintainability
F
2 wks
Test Coverage

File date-picker.spec.js has 1001 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const fs = require("fs");
const path = require("path");
const assert = require("assert");
const DatePicker = require("../index");
const EVENTS = require("./events");
Severity: Major
Found in packages/usa-date-picker/src/test/date-picker.spec.js - About 2 days to fix

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

        it("should allow for navigation to the succeeding year by clicking the right double arrow button within the calendar", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 3 other locations - About 6 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 186..222
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 224..258
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 260..296

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

    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("should allow for navigation to the preceding year by clicking the left double arrow button within the calendar", () => {
          input.value = "1/1/2016";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 3 other locations - About 6 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 186..222
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 224..258
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 298..332

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

    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("should allow for navigation to the preceding month by clicking the left single arrow button within the calendar", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 3 other locations - About 6 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 224..258
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 260..296
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 298..332

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

    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("should allow for navigation to the succeeding month by clicking the right single arrow button within the calendar", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 3 other locations - About 6 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 186..222
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 260..296
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 298..332

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the next day when right is pressed from the currently focused day", () => {
          input.value = "1/10/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day of the next month when page down is pressed from the currently focused day", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day of week of the previous week when up is pressed from the currently focused day", () => {
          input.value = "1/10/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the last day of the next month when page down is pressed from the the last day of a longer month", () => {
          input.value = "1/31/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day/month of the next year when shift + page down is pressed from the currently focused day", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day of week of the next week when down is pressed from the currently focused day", () => {
          input.value = "1/10/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the previous day when left is pressed from the currently focused day", () => {
          input.value = "1/10/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the last day of the previous month when page up is pressed from the the last day of a longer month", () => {
          input.value = "12/31/2019";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to February 28th of the next year when shift + page down is pressed from a focused February 29th date of a leap year", () => {
          input.value = "2/29/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the first day (e.g. Sunday) of the current week when home is pressed from the currently focused day", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day/month of the previous year when shift + page up is pressed from the currently focused day", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day of the previous month when page up is pressed from the currently focused day", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to February 28th of the previous year when shift + page up is pressed from a focused February 29th date of a leap year", () => {
          input.value = "2/29/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the last day (e.g. Saturday) of the current week when end is pressed from the currently focused day", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 843..875
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should move focus to the same day of the month January when page down is pressed from the currently focused day in December", () => {
          input.value = "12/31/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 14 other locations - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 503..535
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 537..569
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 571..603
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 605..637
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 639..671
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 673..705
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 707..739
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 741..773
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 775..807
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 809..841
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 877..909
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 911..943
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 945..977
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 979..1011

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

    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("should accept a parse-able date with a two digit year and display the calendar of that year in the current century", () => {
          input.value = "2/29/20";
          EVENTS.click(button);
    
          assert.strictEqual(
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 118..148

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

    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("should display a calendar for the inputted date when the date picker button is clicked with a date entered", () => {
          input.value = "1/1/2020";
          EVENTS.click(button);
    
          assert.strictEqual(
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 5 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1013..1043

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

    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("should allow for the selection of a month within month selection screen", () => {
          input.value = "2/1/2020";
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl().querySelector(
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 3 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 462..482

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

    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("should allow for the selection of a year within year selection screen", () => {
          input.value = "2/1/2020";
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl().querySelector(
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 3 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 365..385

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

    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("should allow for navigation to the preceding dozen years by clicking the left single arrow button within the year selection screen", () => {
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl().querySelector(
              ".usa-date-picker__calendar__year-selection"
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 3 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 440..460

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

    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("should allow for navigation to the succeeding dozen year by clicking the right single arrow button within the year selection screen", () => {
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl().querySelector(
              ".usa-date-picker__calendar__year-selection"
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 3 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 418..438

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

    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("should close the calendar you press escape from the input", () => {
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
            false,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 2 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 68..82

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

    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("should hide the calendar when the date picker button is clicked and the calendar is already open", () => {
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
            false,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 2 hrs to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 101..116

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 75.

    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("should close the calendar you click outside of an active calendar", () => {
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
            false,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 1 hr to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 486..501

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 73.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should close the calendar when escape is pressed within the calendar", () => {
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
            false,
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 1 hr to fix
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 84..99

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 73.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should show an empty input as valid", () => {
          input.value = "";
    
          EVENTS.keydownEnter(input);
    
    
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 9 other locations - About 50 mins to fix
    packages/usa-character-count/src/test/character-count.spec.js on lines 86..92
    packages/usa-character-count/src/test/character-count.spec.js on lines 94..100
    packages/usa-character-count/src/test/character-count.spec.js on lines 102..111
    packages/usa-character-count/src/test/character-count.spec.js on lines 113..122
    packages/usa-character-count/src/test/valid-template-multiple-validators.spec.js on lines 47..53
    packages/usa-character-count/src/test/valid-template-multiple-validators.spec.js on lines 73..79
    packages/usa-character-count/src/test/valid-template-no-maxlength.spec.js on lines 53..59
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 901..907
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 917..923

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

    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("should show an improper date as invalid as the user leaves the input", () => {
          input.value = "abcdefg... That means the convo is done";
          EVENTS.focusout(input);
    
          assert.strictEqual(input.validationMessage, VALIDATION_MESSAGE);
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 4 other locations - About 50 mins to fix
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 893..899
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 909..915
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1052..1057
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1096..1102

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

    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("should show an improper date as invalid if the user presses enter from the input", () => {
          input.value = "2/31/2019";
    
          EVENTS.keydownEnter(input);
    
    
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 4 other locations - About 50 mins to fix
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 893..899
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 909..915
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1045..1050
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1052..1057

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

    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("should validate input on the static validate function being emitted", () => {
          input.value = "ab/cd/efg";
          DatePicker.validateDateInput(input);
    
          assert.strictEqual(input.validationMessage, VALIDATION_MESSAGE);
    Severity: Major
    Found in packages/usa-date-picker/src/test/date-picker.spec.js and 4 other locations - About 50 mins to fix
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 893..899
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 909..915
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1045..1050
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1096..1102

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

    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