crystal-ball/componentry

View on GitHub

Showing 70 of 85 total issues

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

        <Dropdown.Content>
          <Dropdown.Item>Interactive Item 1</Dropdown.Item>
          <Dropdown.Item>Interactive Item 2</Dropdown.Item>
        </Dropdown.Content>
Severity: Major
Found in src/components/Dropdown/Dropdown.stories.tsx and 2 other locations - About 1 hr to fix
src/components/Card/Card.stories.tsx on lines 65..68
src/components/Popover/Popover.stories.tsx on lines 16..23

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

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

      <Popover.Content>
        <Popover.Heading>Fun Fact!</Popover.Heading>
        <Popover.Body>
          The new Texas Instrument calculators have ABC keyboards because if they had
          QWERTY keyboards, they would be considered computers and wouldn’t be allowed for
Severity: Major
Found in src/components/Popover/Popover.stories.tsx and 2 other locations - About 1 hr to fix
src/components/Card/Card.stories.tsx on lines 65..68
src/components/Dropdown/Dropdown.stories.tsx on lines 44..47

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

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

    render(
      <TestComponent active>
        <TestComponent.Action>Action</TestComponent.Action>
        <TestComponent.Content>Content</TestComponent.Content>
      </TestComponent>,
Severity: Major
Found in src/test/activation-tests.js and 1 other location - About 1 hr to fix
src/test/activation-tests.js on lines 129..134

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

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

export interface Button {
  <As extends React.ElementType = 'button'>(props: ButtonProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Button/Button.tsx and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface Text {
  <As extends React.ElementType = 'div'>(props: TextProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Text/Text.ts and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33

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

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

export interface Block {
  <As extends React.ElementType = 'div'>(props: BlockProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Block/Block.ts and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface Grid {
  <As extends React.ElementType = 'div'>(props: GridProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Grid/Grid.ts and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface IconButton {
  <As extends React.ElementType = 'button'>(
    props: IconButtonProps<As>,
  ): React.ReactElement
  displayName?: string
Severity: Major
Found in src/components/IconButton/IconButton.tsx and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface Paper {
  <As extends React.ElementType = 'div'>(props: PaperProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Paper/Paper.ts and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Text/Text.ts on lines 51..54

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

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

export interface Icon {
  <As extends React.ElementType = 'svg'>(props: IconProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Icon/Icon.tsx and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface Flex {
  <As extends React.ElementType = 'div'>(props: FlexProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Flex/Flex.ts and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface Link {
  <As extends React.ElementType = 'a'>(props: LinkProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Link/Link.ts and 9 other locations - About 1 hr to fix
src/components/Badge/Badge.ts on lines 37..40
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

export interface Badge {
  <As extends React.ElementType = 'div'>(props: BadgeProps<As>): React.ReactElement
  displayName?: string
}
Severity: Major
Found in src/components/Badge/Badge.ts and 9 other locations - About 1 hr to fix
src/components/Block/Block.ts on lines 27..30
src/components/Button/Button.tsx on lines 49..52
src/components/Flex/Flex.ts on lines 36..39
src/components/Grid/Grid.ts on lines 32..35
src/components/Icon/Icon.tsx on lines 63..66
src/components/IconButton/IconButton.tsx on lines 44..49
src/components/Link/Link.ts on lines 34..37
src/components/Paper/Paper.ts on lines 30..33
src/components/Text/Text.ts on lines 51..54

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

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

    rerender(
      <TestComponent>
        <TestComponent.Action>Action</TestComponent.Action>
        <TestComponent.Content>Content</TestComponent.Content>
      </TestComponent>,
Severity: Major
Found in src/test/activation-tests.js and 1 other location - About 1 hr to fix
src/test/activation-tests.js on lines 257..262

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

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

    const { rerender } = render(
      <TestComponent>
        <TestComponent.Action>Action</TestComponent.Action>
        <TestComponent.Content>Content</TestComponent.Content>
      </TestComponent>,
Severity: Major
Found in src/test/activation-tests.js and 1 other location - About 1 hr to fix
src/test/activation-tests.js on lines 266..271

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

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

    if (testLabelledBy) {
      // If aria-labelledby, content should have attr pointing to id on action
      expect(screen.getByText('Action')).toHaveAttribute('id', 'test-guid')
      expect(screen.getByText('Content')).toHaveAttribute('aria-labelledby', 'test-guid')
    }
Severity: Major
Found in src/test/activation-tests.js and 1 other location - About 1 hr to fix
src/test/activation-tests.js on lines 57..61

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

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

    if (testControls) {
      // If aria-controls, action should have attr pointing to id on content
      expect(screen.getByText('Action')).toHaveAttribute('aria-controls', 'test-guid')
      expect(screen.getByText('Content')).toHaveAttribute('id', 'test-guid')
    }
Severity: Major
Found in src/test/activation-tests.js and 1 other location - About 1 hr to fix
src/test/activation-tests.js on lines 63..67

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

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

const touchMoveSuppressOutline = () => {
  document.body.classList.add('suppress-outline')
  document.removeEventListener('touchmove', touchMoveSuppressOutline)
  document.addEventListener('keydown', onKeyTab)
}
Severity: Minor
Found in src/utils/dom.ts and 1 other location - About 55 mins to fix
src/utils/dom.ts on lines 28..32

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

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

const mouseMoveSuppressOutline = () => {
  document.body.classList.add('suppress-outline')
  document.removeEventListener('mousemove', mouseMoveSuppressOutline)
  document.addEventListener('keydown', onKeyTab)
}
Severity: Minor
Found in src/utils/dom.ts and 1 other location - About 55 mins to fix
src/utils/dom.ts on lines 33..37

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

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

    <>
      <Badge size='small'>Badge</Badge>
      <Badge>Badge</Badge>
      <Badge size='large'>Badge</Badge>
    </>
Severity: Minor
Found in src/components/Badge/Badge.stories.tsx and 1 other location - About 50 mins to fix
src/components/Button/Button.stories.tsx on lines 68..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 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

Severity
Category
Status
Source
Language