18F/web-design-standards

View on GitHub

Showing 301 of 368 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

const displayNextYear = (_buttonEl) => {
  if (_buttonEl.disabled) return;
  const { calendarEl, calendarDate, minDate, maxDate } =
    getDatePickerContext(_buttonEl);
  let date = addYears(calendarDate, 1);
Severity: Major
Found in packages/usa-date-picker/src/index.js and 3 other locations - About 5 hrs to fix
packages/usa-date-picker/src/index.js on lines 1187..1200
packages/usa-date-picker/src/index.js on lines 1207..1220
packages/usa-date-picker/src/index.js on lines 1227..1240

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

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

const displayPreviousYear = (_buttonEl) => {
  if (_buttonEl.disabled) return;
  const { calendarEl, calendarDate, minDate, maxDate } =
    getDatePickerContext(_buttonEl);
  let date = subYears(calendarDate, 1);
Severity: Major
Found in packages/usa-date-picker/src/index.js and 3 other locations - About 5 hrs to fix
packages/usa-date-picker/src/index.js on lines 1207..1220
packages/usa-date-picker/src/index.js on lines 1227..1240
packages/usa-date-picker/src/index.js on lines 1247..1260

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

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

const displayPreviousMonth = (_buttonEl) => {
  if (_buttonEl.disabled) return;
  const { calendarEl, calendarDate, minDate, maxDate } =
    getDatePickerContext(_buttonEl);
  let date = subMonths(calendarDate, 1);
Severity: Major
Found in packages/usa-date-picker/src/index.js and 3 other locations - About 5 hrs to fix
packages/usa-date-picker/src/index.js on lines 1187..1200
packages/usa-date-picker/src/index.js on lines 1227..1240
packages/usa-date-picker/src/index.js on lines 1247..1260

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language