18F/web-design-standards

View on GitHub

Showing 368 of 368 total issues

Function displayList has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const displayList = (el) => {
  const {
    comboBoxEl,
    selectEl,
    inputEl,
Severity: Major
Found in packages/usa-combo-box/src/index.js - About 3 hrs to fix

    Function displayList has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    const displayList = (el) => {
      const {
        comboBoxEl,
        selectEl,
        inputEl,
    Severity: Minor
    Found in packages/usa-combo-box/src/index.js - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 106.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 106.

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

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

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

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

    Refactorings

    Further Reading

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

      typeCheck() {
        return new Promise((resolve, reject) => {
          childProcess
            .spawn("./node_modules/.bin/tsc", { stdio: "inherit" })
            .on("error", reject)
    Severity: Major
    Found in tasks/javascript.js and 1 other location - About 3 hrs to fix
    tasks/lint.js on lines 26..40

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

    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

    function typecheck() {
      return new Promise((resolve, reject) => {
        childProcess
          .spawn("./node_modules/.bin/tsc", { stdio: "inherit" })
          .on("error", reject)
    Severity: Major
    Found in tasks/lint.js and 1 other location - About 3 hrs to fix
    tasks/javascript.js on lines 52..66

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should update the range end date picker properties to have a min date and range date when the range start date picker has an updated valid value", () => {
          rangeStartInputEl.value = "12/12/2020";
    
          EVENTS.input(rangeStartInputEl);
    
    
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 97..113
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 115..127
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 129..149
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 151..163

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should reset the range end date picker properties when the range start date picker has an updated invalid value", () => {
          rangeEndInputEl.value = "35/35/3535";
    
          EVENTS.input(rangeEndInputEl);
    
    
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 75..95
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 97..113
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 115..127
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 129..149

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should reset the range start date picker properties when the range end date picker has an empty value", () => {
          rangeEndInputEl.value = "";
    
          EVENTS.input(rangeEndInputEl);
    
    
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 75..95
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 97..113
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 129..149
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 151..163

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should reset the range end date picker properties when the range start date picker has an updated invalid value", () => {
          rangeStartInputEl.value = "ab/dc/efg";
    
          EVENTS.input(rangeStartInputEl);
    
    
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 75..95
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 115..127
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 129..149
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 151..163

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

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

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

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

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

    Refactorings

    Further Reading

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

        it("should update the range start date picker properties to have a max date and range date when the range end date picker has an updated valid value", () => {
          rangeEndInputEl.value = "12/11/2020";
    
          EVENTS.input(rangeEndInputEl);
    
    
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 75..95
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 97..113
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 115..127
    packages/usa-date-range-picker/src/test/date-range-picker.spec.js on lines 151..163

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

    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 toggleModal has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function toggleModal(event) {
      let originalOpener;
      let clickedElement = event.target;
      const { body } = document;
      const safeActive = !isActive();
    Severity: Major
    Found in packages/usa-modal/src/index.js - About 3 hrs to fix

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 97.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 97.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 97.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 97.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 97.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 97.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

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

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

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

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

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language