18F/web-design-standards

View on GitHub

Showing 368 of 368 total issues

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

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

const displayNextMonth = (_buttonEl) => {
  if (_buttonEl.disabled) return;
  const { calendarEl, calendarDate, minDate, maxDate } =
    getDatePickerContext(_buttonEl);
  let date = addMonths(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 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 2 locations. Consider refactoring.
Open

      it("should emit change events when setting the input value when a complete selection is submitted by pressing enter", () => {
        select.value = "apple";
        input.value = "fig";
        EVENTS.input(input);
        assert.ok(!list.hidden, "should display the option list");
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 110..136

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

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 emit change events when closing the list but not the clear the input value when escape is performed while the list is open", () => {
        select.value = "apple";
        input.value = "a";
        EVENTS.input(input);
        assert.ok(!list.hidden, "should display the option list");
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 138..164

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

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

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

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

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

Refactorings

Further Reading

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

    it("should accept a parse-able date with a two digit year and display the calendar of that year in the current century", () => {
      input.value = "2/29/20";
      EVENTS.click(button);

      assert.strictEqual(
Severity: Major
Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 5 hrs to fix
packages/usa-date-picker/src/test/date-picker.spec.js on lines 118..148

Duplicated Code

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

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

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

Tuning

This issue has a mass of 139.

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

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

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

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

Refactorings

Further Reading

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

    it("should display a calendar for the inputted date when the date picker button is clicked with a date entered", () => {
      input.value = "1/1/2020";
      EVENTS.click(button);

      assert.strictEqual(
Severity: Major
Found in packages/usa-date-picker/src/test/date-picker.spec.js and 1 other location - About 5 hrs to fix
packages/usa-date-picker/src/test/date-picker.spec.js on lines 1013..1043

Duplicated Code

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

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

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

Tuning

This issue has a mass of 139.

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

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

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

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

Refactorings

Further Reading

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

    it("should update the focus when moving over a non-selected valid day", () => {
      root.dataset.minDate = "2020-06-01";
      root.dataset.maxDate = "2020-06-24";
      input.value = "6/20/2020";
      EVENTS.click(button);
packages/usa-date-picker/src/test/date-picker-mousemove.spec.js on lines 41..65

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

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 ignore mouse move events over disabled days", () => {
      root.dataset.minDate = "2020-06-01";
      root.dataset.maxDate = "2020-06-24";
      input.value = "6/20/2020";
      EVENTS.click(button);
packages/usa-date-picker/src/test/date-picker-mousemove.spec.js on lines 67..91

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

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

export default {
  title: "Components/Form Inputs/Date Picker",
  argTypes: {
    defaultDate: {
      name: "Default Date (YYYY-MM-DD)",
Severity: Major
Found in packages/usa-date-picker/src/usa-date-picker.stories.js and 1 other location - About 4 hrs to fix
packages/usa-date-range-picker/src/date-range-picker.stories.js on lines 3..28

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

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

export default {
  title: "Components/Form Inputs/Date Range Picker",
  argTypes: {
    defaultDateStart: {
      name: "Default Date: Start (YYYY-MM-DD)",
packages/usa-date-picker/src/usa-date-picker.stories.js on lines 3..28

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

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 select the focused list item in the list when pressing enter on a focused item", () => {
        select.value = "pineapple";
        input.value = "berry";
        EVENTS.input(input);
        EVENTS.keydownArrowDown(input);
Severity: Major
Found in packages/usa-combo-box/src/test/combo-box.spec.js and 1 other location - About 4 hrs to fix
packages/usa-combo-box/src/test/combo-box.spec.js on lines 411..435

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

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 select the focused list item in the list when pressing space on a focused item", () => {
        select.value = "cantaloupe";
        input.value = "berry";
        EVENTS.input(input);
        EVENTS.keydownArrowDown(input);
Severity: Major
Found in packages/usa-combo-box/src/test/combo-box.spec.js and 1 other location - About 4 hrs to fix
packages/usa-combo-box/src/test/combo-box.spec.js on lines 385..409

Duplicated Code

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

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

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

Tuning

This issue has a mass of 130.

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