18F/web-design-standards

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

Summary

Maintainability
F
2 wks
Test Coverage

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

const fs = require("fs");
const path = require("path");
const assert = require("assert");
const EVENTS = require("./events");
const DatePicker = require("../index");

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

        it("should disable back buttons when displaying the minimum month", () => {
          input.value = "05/30/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 102..131

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

    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 disable forward buttons when displaying the maximum month", () => {
          input.value = "06/01/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 71..100

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

    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 selection of a month in the month selection screen that is partially disabled due to a minimum date being set", () => {
          input.value = "12/01/2020";
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl(".usa-date-picker__calendar__month-selection")
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 322..349

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

    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 selection of a month in the month selection screen that is partially disabled due to a maximum date being set", () => {
          input.value = "01/30/2021";
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl(".usa-date-picker__calendar__month-selection")
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 272..299

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

    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 selection of a year in the year selection screen that is partially disabled due to a maximum date being set", () => {
          input.value = "12/01/2020";
          EVENTS.click(button);
          EVENTS.click(getCalendarEl(".usa-date-picker__calendar__year-selection"));
          assert.ok(
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 374..397

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

    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 selection of a year in the year selection screen that is partially disabled due to a minimum date being set", () => {
          input.value = "04/01/2021";
          EVENTS.click(button);
          EVENTS.click(getCalendarEl(".usa-date-picker__calendar__year-selection"));
          assert.ok(
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 399..422

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

    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 not allow selection of a date that is before the minimum date", () => {
          input.value = "05/25/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 528..548

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

    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 not allow selection of a year in the year selection screen that is fully disabled due to a minimum date being set", () => {
          input.value = "07/04/2020";
          EVENTS.click(button);
          EVENTS.click(getCalendarEl(".usa-date-picker__calendar__year-selection"));
          assert.ok(
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 301..320
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 351..372
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 443..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 97.

    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 not allow selection of a date that is after the maximum date", () => {
          input.value = "06/15/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 506..526

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

    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 not allow selection of a year  in the year selection screen that is fully disabled due to a maximum date being set", () => {
          input.value = "12/01/2020";
          EVENTS.click(button);
          EVENTS.click(getCalendarEl(".usa-date-picker__calendar__year-selection"));
          assert.ok(
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 301..320
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 351..372
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 424..441

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

    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 not allow selection of a month in the month selection screen that is fully disabled due to a minimum date being set", () => {
          input.value = "10/31/2020";
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl(".usa-date-picker__calendar__month-selection")
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 351..372
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 424..441
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 443..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 97.

    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 not allow selection of a month in the month selection screen that is fully disabled due to a maximum date being set", () => {
          input.value = "02/29/2021";
          EVENTS.click(button);
          EVENTS.click(
            getCalendarEl(".usa-date-picker__calendar__month-selection")
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 301..320
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 424..441
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 443..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 97.

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

        it("should allow navigation back a year to a month that is partially disabled due to a minimum date being set", () => {
          input.value = "05/15/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 133..150
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 152..169
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 196..213
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 215..232
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 234..251
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 253..270

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

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

        it("should allow navigation back a month to a month that is partially disabled due to a minimum date being set", () => {
          input.value = "06/15/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 52..69
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 133..150
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 196..213
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 215..232
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 234..251
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 253..270

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

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

        it("should allow navigation forward a year to a month that is partially disabled due to a maximum date being set", () => {
          input.value = "06/25/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 52..69
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 133..150
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 152..169
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 215..232
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 234..251
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 253..270

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

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

        it("should allow navigation back a year to a month that is less than a year from the minimum date being set and cap at that minimum date", () => {
          input.value = "04/15/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 52..69
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 152..169
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 196..213
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 215..232
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 234..251
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 253..270

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

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

        it("should allow navigation forward a year to a month that is less than a year from the maximum date and cap at that maximum date", () => {
          input.value = "07/25/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 52..69
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 133..150
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 152..169
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 196..213
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 234..251
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 253..270

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

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

        it("should not allow navigation forward a month to a month that is fully disabled due to a maximum date being set", () => {
          input.value = "06/17/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 52..69
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 133..150
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 152..169
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 196..213
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 215..232
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 234..251

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

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

        it("should allow navigation forward a month to a month that is partially disabled due to a maximum date being set", () => {
          input.value = "05/25/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 52..69
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 133..150
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 152..169
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 196..213
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 215..232
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 253..270

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

    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 selection of a date that is the minimum date", () => {
          input.value = "05/25/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 484..504

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

    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 selection of a date that is the maximum date", () => {
          input.value = "06/15/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.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 94.

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

        it("should allow keyboard navigation to move forward one week to a date that is the maximum date", () => {
          input.value = "06/13/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move to the start of the week to a date that is before the minimum date but cap at minimum date", () => {
          input.value = "05/23/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move forward one month to a date that is the maximum date", () => {
          input.value = "05/20/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one year to a date that is before the minimum date but cap at minimum date", () => {
          input.value = "05/21/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should not allow keyboard navigation to move forward one day to a date that is after the maximum date", () => {
          input.value = "06/20/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should not allow keyboard navigation to move back one day to a date that is before the minimum date", () => {
          input.value = "05/22/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move forward one year to a date that is the maximum date", () => {
          input.value = "06/20/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move forward one day to a date that is the maximum date", () => {
          input.value = "06/19/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one day to a date that is the minimum date", () => {
          input.value = "05/23/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one week to a date that is before the minimum date but cap at minimum date", () => {
          input.value = "05/28/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move forward one month to a date that is after the maximum date but cap at maximum date", () => {
          input.value = "05/21/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move forward one week to a date that is after the maximum date but cap at maximum date", () => {
          input.value = "06/14/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move forward one year to a date that is after the maximum date but cap at maximum date", () => {
          input.value = "06/21/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one week to a date that is the minimum date", () => {
          input.value = "05/29/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one year to a date that is the minimum date", () => {
          input.value = "05/22/2021";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one month to a date that is the minimum date", () => {
          input.value = "06/22/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 683..700
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should allow keyboard navigation to move back one month to a date that is before the minimum date but cap at minimum date", () => {
          input.value = "06/21/2020";
          EVENTS.click(button);
          assert.strictEqual(
            getCalendarEl().hidden,
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 550..567
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 569..586
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 588..605
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 607..624
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 626..643
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 645..662
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 664..681
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 702..719
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 721..738
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 740..757
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 759..776
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 778..795
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 797..814
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 836..853
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 855..872
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 874..891

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

        it("should open the calendar on the min date when the input date is before the min date", () => {
          input.value = "04/15/2020";
          EVENTS.click(button);
    
          assert.strictEqual(
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 43..59
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 61..77
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 79..95
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 952..967

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

    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 open the calendar on the max date when the input date is after the max date", () => {
          input.value = "04/15/2023";
          EVENTS.click(button);
    
          assert.strictEqual(
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 43..59
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 61..77
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 79..95
    packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 935..950

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

    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 a date that is the maximum date as valid", () => {
          input.value = "06/20/2021";
    
          EVENTS.keydownEnter(input);
    
    
    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 917..923
    packages/usa-date-picker/src/test/date-picker.spec.js on lines 1104..1110

    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 a date that is before the minimum date as invalid", () => {
          input.value = "05/01/2020";
    
          EVENTS.keydownEnter(input);
    
    
    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.spec.js on lines 1045..1050
    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 10 locations. Consider refactoring.
    Open

        it("should show a date that is the minimum date as valid", () => {
          input.value = "05/22/2020";
    
          EVENTS.keydownEnter(input);
    
    
    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.spec.js on lines 1104..1110

    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 a date that is after the maximum date as invalid", () => {
          input.value = "06/30/2021";
    
          EVENTS.keydownEnter(input);
    
    
    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
    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

    Identical blocks of code found in 5 locations. Consider refactoring.
    Open

        afterEach(() => {
          DatePicker.off(containerSelector());
          window.onerror = null;
          body.textContent = "";
        });
    packages/usa-date-picker/src/test/date-picker-default-date.spec.js on lines 37..41
    packages/usa-date-picker/src/test/date-picker-default-value.spec.js on lines 37..41
    packages/usa-date-picker/src/test/date-picker-disabled.spec.js on lines 35..39
    packages/usa-date-picker/src/test/date-picker-range-date.spec.js on lines 37..41

    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