18F/web-design-standards

View on GitHub

Showing 301 of 368 total issues

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

    it("informs the user how many characters they will need to remove", () => {
      input.value = "1234567890123456789012345";

      EVENTS.input(input);

Severity: Major
Found in packages/usa-character-count/src/test/character-count.spec.js and 9 other locations - About 50 mins to fix
packages/usa-character-count/src/test/character-count.spec.js on lines 86..92
packages/usa-character-count/src/test/character-count.spec.js on lines 94..100
packages/usa-character-count/src/test/character-count.spec.js on lines 102..111
packages/usa-character-count/src/test/valid-template-multiple-validators.spec.js on lines 47..53
packages/usa-character-count/src/test/valid-template-multiple-validators.spec.js on lines 73..79
packages/usa-character-count/src/test/valid-template-no-maxlength.spec.js on lines 53..59
packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 901..907
packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 917..923
packages/usa-date-picker/src/test/date-picker.spec.js on lines 1104..1110

Duplicated Code

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

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

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

Tuning

This issue has a mass of 51.

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

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

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

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

Refactorings

Further Reading

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

    it("should validate input on the static validate function being emitted", () => {
      input.value = "ab/cd/efg";
      DatePicker.validateDateInput(input);

      assert.strictEqual(input.validationMessage, VALIDATION_MESSAGE);
Severity: Major
Found in packages/usa-date-picker/src/test/date-picker.spec.js and 4 other locations - About 50 mins to fix
packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 893..899
packages/usa-date-picker/src/test/date-picker-min-date-max-date.spec.js on lines 909..915
packages/usa-date-picker/src/test/date-picker.spec.js on lines 1045..1050
packages/usa-date-picker/src/test/date-picker.spec.js on lines 1096..1102

Duplicated Code

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

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

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

Tuning

This issue has a mass of 51.

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

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

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

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

Refactorings

Further Reading

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "in page nav",
    selector: () => document.querySelector(".usa-in-page-nav"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "combo box",
    selector: () => document.querySelector(".usa-combo-box"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "file input",
    selector: () => document.querySelector(".usa-file-input"),
Severity: Major
Found in packages/usa-file-input/src/test/file-input.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "file input",
    selector: () => document.querySelector(".usa-file-input"),
Severity: Major
Found in packages/usa-file-input/src/test/file-input-disabled.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "in page nav",
    selector: () => document.querySelector(".usa-in-page-nav"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "combo box",
    selector: () => document.querySelector(".usa-combo-box"),
Severity: Major
Found in packages/usa-combo-box/src/test/combo-box.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  { name: "footer", selector: () => document.querySelector(".usa-footer") },
];
Severity: Major
Found in packages/usa-footer/src/test/footer.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "character count",
    selector: () => document.querySelector(".usa-character-count"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "combo box",
    selector: () => document.querySelector(".usa-combo-box"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "in page nav",
    selector: () => document.querySelector(".usa-in-page-nav"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "combo box",
    selector: () => document.querySelector(".usa-combo-box"),
Severity: Major
Found in packages/usa-combo-box/src/test/combo-box-filter.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  { name: "tooltip", selector: () => document.querySelector(".usa-tooltip") },
];
Severity: Major
Found in packages/usa-tooltip/src/test/tooltips.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "combo box",
    selector: () => document.querySelector(".usa-combo-box"),
Severity: Major
Found in packages/usa-combo-box/src/test/combo-box-placeholder.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "file input",
    selector: () => document.querySelector(".usa-file-input"),
Severity: Major
Found in packages/usa-file-input/src/test/single-file-input.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "combo box",
    selector: () => document.querySelector(".usa-combo-box"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  { name: "banner", selector: () => document.querySelector(".usa-banner") },
];
Severity: Major
Found in packages/usa-banner/src/test/banner.spec.js and 17 other locations - About 45 mins to fix
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "file input",
    selector: () => document.querySelector(".usa-file-input"),
Severity: Major
Found in packages/usa-file-input/src/test/file-input-accepts.spec.js and 17 other locations - About 45 mins to fix
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-message.spec.js on lines 10..16
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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

const tests = [
  { name: "document.body", selector: () => document.body },
  {
    name: "character count",
    selector: () => document.querySelector(".usa-character-count"),
packages/usa-banner/src/test/banner.spec.js on lines 10..13
packages/usa-character-count/src/test/invalid-template-no-wrapper.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-change-event.spec.js on lines 12..18
packages/usa-combo-box/src/test/combo-box-default-value.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box-disable-filtering.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-filter.spec.js on lines 11..17
packages/usa-combo-box/src/test/combo-box-placeholder.spec.js on lines 10..16
packages/usa-combo-box/src/test/combo-box.spec.js on lines 11..17
packages/usa-file-input/src/test/file-input-accepts.spec.js on lines 52..58
packages/usa-file-input/src/test/file-input-disabled.spec.js on lines 9..15
packages/usa-file-input/src/test/file-input.spec.js on lines 9..15
packages/usa-file-input/src/test/single-file-input.spec.js on lines 9..15
packages/usa-footer/src/test/footer.spec.js on lines 36..39
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-content.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation-custom-heading.spec.js on lines 14..20
packages/usa-in-page-navigation/src/test/in-page-navigation.spec.js on lines 37..43
packages/usa-tooltip/src/test/tooltips.spec.js on lines 8..11

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

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