18F/web-design-standards

View on GitHub
packages/usa-date-picker/src/test/events.js

Summary

Maintainability
F
3 days
Test Coverage

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

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

EVENTS.click = (el = document.activeElement) => {
  const evt = new MouseEvent("click", {
    view: el.ownerDocument.defaultView,
    bubbles: true,
    cancelable: true,
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 1 other location - About 2 hrs to fix
packages/usa-date-range-picker/src/test/events.js on lines 21..28

Duplicated Code

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

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

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

Tuning

This issue has a mass of 76.

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

EVENTS.keydownSpace = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    keyCode: 32,
    key: " ",
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 1 other location - About 1 hr to fix
packages/usa-date-range-picker/src/test/events.js on lines 90..97

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

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.keydownShiftPageUp = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "PageUp",
    shiftKey: true,
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 3 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 212..219
packages/usa-date-range-picker/src/test/events.js on lines 199..206
packages/usa-date-range-picker/src/test/events.js on lines 212..219

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

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.keydownShiftPageDown = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "PageDown",
    shiftKey: true,
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 3 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 199..206
packages/usa-date-range-picker/src/test/events.js on lines 199..206
packages/usa-date-range-picker/src/test/events.js on lines 212..219

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

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

EVENTS.keydownArrowRight = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "ArrowRight",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownArrowUp = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "ArrowUp",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownArrowLeft = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "ArrowLeft",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownPageDown = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "PageDown",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownEscape = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "Escape",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownPageUp = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "PageUp",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownArrowDown = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "ArrowDown",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownHome = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "Home",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 163..169
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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

EVENTS.keydownEnd = (el = document.activeElement) => {
  const evt = new KeyboardEvent("keydown", {
    bubbles: true,
    key: "End",
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 17 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 78..84
packages/usa-date-picker/src/test/events.js on lines 103..109
packages/usa-date-picker/src/test/events.js on lines 115..121
packages/usa-date-picker/src/test/events.js on lines 127..133
packages/usa-date-picker/src/test/events.js on lines 139..145
packages/usa-date-picker/src/test/events.js on lines 151..157
packages/usa-date-picker/src/test/events.js on lines 175..181
packages/usa-date-picker/src/test/events.js on lines 187..193
packages/usa-date-range-picker/src/test/events.js on lines 78..84
packages/usa-date-range-picker/src/test/events.js on lines 103..109
packages/usa-date-range-picker/src/test/events.js on lines 115..121
packages/usa-date-range-picker/src/test/events.js on lines 127..133
packages/usa-date-range-picker/src/test/events.js on lines 139..145
packages/usa-date-range-picker/src/test/events.js on lines 151..157
packages/usa-date-range-picker/src/test/events.js on lines 163..169
packages/usa-date-range-picker/src/test/events.js on lines 175..181
packages/usa-date-range-picker/src/test/events.js on lines 187..193

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

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.focusout = (el = document.activeElement) => {
  const evt = new Event("focusout", {
    bubbles: true,
    cancelable: true,
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 3 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 9..15
packages/usa-date-range-picker/src/test/events.js on lines 9..15
packages/usa-date-range-picker/src/test/events.js on lines 34..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 63.

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.input = (el = document.activeElement) => {
  const evt = new KeyboardEvent("input", {
    bubbles: true,
    cancelable: true,
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 3 other locations - About 1 hr to fix
packages/usa-date-picker/src/test/events.js on lines 34..40
packages/usa-date-range-picker/src/test/events.js on lines 9..15
packages/usa-date-range-picker/src/test/events.js on lines 34..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 63.

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

EVENTS.mouseover = (el) => {
  const evt = new MouseEvent("mouseover", {
    bubbles: true,
    cancelable: true,
  });
Severity: Major
Found in packages/usa-date-picker/src/test/events.js and 1 other location - About 1 hr to fix
packages/usa-combo-box/src/test/events.js on lines 22..28

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

There are no issues that match your filters.

Category
Status