18F/web-design-standards

View on GitHub

Showing 368 of 368 total issues

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

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

const EVENTS = {
  escape(el) {
    const escapeKeyEvent = new KeyboardEvent("keydown", {
      key: "Escape",
      bubbles: true,
packages/usa-nav/src/test/navigation.spec.js on lines 10..27

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

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

const EVENTS = {
  escape(el) {
    const escapeKeyEvent = new KeyboardEvent("keydown", {
      key: "Escape",
      bubbles: true,
Severity: Major
Found in packages/usa-nav/src/test/navigation.spec.js and 1 other location - About 2 hrs to fix
packages/usa-language-selector/src/test/language-selector.spec.js on lines 8..25

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

Function svg4everybody has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function svg4everybody(rawopts) {
    function oninterval() {
      // if all <use>s in the array are being bypassed, don't proceed.
      if (
        numberOfSvgUseElementsToBypass &&
Severity: Major
Found in packages/uswds-core/src/js/polyfills/svg4everybody.js - About 2 hrs to fix

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

    EVENTS.keyupEnter = (el = document.activeElement) => {
      const evt = new KeyboardEvent("keyup", {
        bubbles: true,
        keyCode: 13,
        key: "Enter",
    Severity: Major
    Found in packages/usa-date-picker/src/test/events.js and 3 other locations - About 2 hrs to fix
    packages/usa-date-picker/src/test/events.js on lines 47..56
    packages/usa-date-range-picker/src/test/events.js on lines 47..56
    packages/usa-date-range-picker/src/test/events.js on lines 63..72

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

    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

    EVENTS.keydownEnter = (el = document.activeElement) => {
      const evt = new KeyboardEvent("keydown", {
        bubbles: true,
        keyCode: 13,
        key: "Enter",
    Severity: Major
    Found in packages/usa-date-range-picker/src/test/events.js and 3 other locations - About 2 hrs to fix
    packages/usa-date-picker/src/test/events.js on lines 47..56
    packages/usa-date-picker/src/test/events.js on lines 63..72
    packages/usa-date-range-picker/src/test/events.js on lines 63..72

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

    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

    EVENTS.keyupEnter = (el = document.activeElement) => {
      const evt = new KeyboardEvent("keyup", {
        bubbles: true,
        keyCode: 13,
        key: "Enter",
    Severity: Major
    Found in packages/usa-date-range-picker/src/test/events.js and 3 other locations - About 2 hrs to fix
    packages/usa-date-picker/src/test/events.js on lines 47..56
    packages/usa-date-picker/src/test/events.js on lines 63..72
    packages/usa-date-range-picker/src/test/events.js on lines 47..56

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

    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

    EVENTS.keydownEnter = (el = document.activeElement) => {
      const evt = new KeyboardEvent("keydown", {
        bubbles: true,
        keyCode: 13,
        key: "Enter",
    Severity: Major
    Found in packages/usa-date-picker/src/test/events.js and 3 other locations - About 2 hrs to fix
    packages/usa-date-picker/src/test/events.js on lines 63..72
    packages/usa-date-range-picker/src/test/events.js on lines 47..56
    packages/usa-date-range-picker/src/test/events.js on lines 63..72

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

    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 focus the first complete hour found in the list from the query when pressing down from the input", () => {
          input.value = "1p";
    
          EVENTS.input(input);
          assert.ok(!list.hidden, "should display the option list");
    Severity: Major
    Found in packages/usa-time-picker/src/test/time-picker.spec.js and 1 other location - About 2 hrs to fix
    packages/usa-time-picker/src/test/time-picker.spec.js on lines 93..106

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

    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 focus the first item found in the list from the query when pressing down from the input", () => {
          input.value = "4p";
    
          EVENTS.input(input);
          assert.ok(!list.hidden, "should display the option list");
    Severity: Major
    Found in packages/usa-time-picker/src/test/time-picker.spec.js and 1 other location - About 2 hrs to fix
    packages/usa-time-picker/src/test/time-picker.spec.js on lines 108..121

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

    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

    AriaDisabled.argTypes = {
      disabled_state: {
        defaultValue: "aria-disabled",
      },
      defaultDateStart: {
    packages/usa-date-picker/src/usa-date-picker.stories.js on lines 83..99
    packages/usa-date-picker/src/usa-date-picker.stories.js on lines 102..118
    packages/usa-date-range-picker/src/date-range-picker.stories.js on lines 67..83

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

    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

    AriaDisabled.argTypes = {
      disabled_state: {
        defaultValue: "aria-disabled",
      },
      defaultDate: {
    Severity: Major
    Found in packages/usa-date-picker/src/usa-date-picker.stories.js and 3 other locations - About 2 hrs to fix
    packages/usa-date-picker/src/usa-date-picker.stories.js on lines 83..99
    packages/usa-date-range-picker/src/date-range-picker.stories.js on lines 67..83
    packages/usa-date-range-picker/src/date-range-picker.stories.js on lines 86..102

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

    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