testokur/testokur-ui

View on GitHub

Showing 117 of 117 total issues

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

  const paddingButtonMapping = curry<string>({
    Small: () => theme.spacing.paddingButtonSmall,
    Medium: () => theme.spacing.paddingButtonNormal,
    Large: () => theme.spacing.paddingButtonLarge,
  });
Severity: Major
Found in src/components/Button/getButtonSpacing.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 28..32
src/components/Button/getButtonSpacing.ts on lines 34..38
src/components/Button/getButtonSpacing.ts on lines 40..44
src/components/Button/getSizeToken.ts on lines 5..9
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 17..21
src/components/Button/getSizeToken.ts on lines 23..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

  const paddingButtonWithIconsMapping = curry<string>({
    Small: () => theme.spacing.paddingButtonSmallWithIcons,
    Medium: () => theme.spacing.paddingButtonNormalWithIcons,
    Large: () => theme.spacing.paddingButtonLargeWithIcons,
  });
Severity: Major
Found in src/components/Button/getButtonSpacing.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 22..26
src/components/Button/getButtonSpacing.ts on lines 34..38
src/components/Button/getButtonSpacing.ts on lines 40..44
src/components/Button/getSizeToken.ts on lines 5..9
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 17..21
src/components/Button/getSizeToken.ts on lines 23..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

  const heightButtonMapping = curry<string>({
    Small: () => theme.size.heightButtonSmall,
    Medium: () => theme.size.heightButtonNormal,
    Large: () => theme.size.heightButtonLarge,
  });
Severity: Major
Found in src/components/Button/getSizeToken.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 22..26
src/components/Button/getButtonSpacing.ts on lines 28..32
src/components/Button/getButtonSpacing.ts on lines 34..38
src/components/Button/getButtonSpacing.ts on lines 40..44
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 17..21
src/components/Button/getSizeToken.ts on lines 23..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

  const fontSizeButtonMapping = curry<string>({
    Small: () => theme.size.fontSizeButtonSmall,
    Medium: () => theme.size.fontSizeButtonMedium,
    Large: () => theme.size.fontSizeButtonLarge,
  });
Severity: Major
Found in src/components/Button/getSizeToken.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 22..26
src/components/Button/getButtonSpacing.ts on lines 28..32
src/components/Button/getButtonSpacing.ts on lines 34..38
src/components/Button/getButtonSpacing.ts on lines 40..44
src/components/Button/getSizeToken.ts on lines 5..9
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 17..21

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

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

  const paddingButtonWithRightIconMapping = curry<string>({
    Small: () => theme.spacing.paddingButtonSmallWithRightIcon,
    Medium: () => theme.spacing.paddingButtonNormalWithRightIcon,
    Large: () => theme.spacing.paddingButtonLargeWithRightIcon,
  });
Severity: Major
Found in src/components/Button/getButtonSpacing.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 22..26
src/components/Button/getButtonSpacing.ts on lines 28..32
src/components/Button/getButtonSpacing.ts on lines 34..38
src/components/Button/getSizeToken.ts on lines 5..9
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 17..21
src/components/Button/getSizeToken.ts on lines 23..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

  const loadingHeightMapping = curry<string>({
    Small: () => theme.size.heightIconSmall,
    Medium: () => theme.size.heightIconMedium,
    Large: () => theme.size.heightIconLarge,
  });
Severity: Major
Found in src/components/Button/getSizeToken.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 22..26
src/components/Button/getButtonSpacing.ts on lines 28..32
src/components/Button/getButtonSpacing.ts on lines 34..38
src/components/Button/getButtonSpacing.ts on lines 40..44
src/components/Button/getSizeToken.ts on lines 5..9
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 23..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

  const paddingButtonWithLeftIconMapping = curry<string>({
    Small: () => theme.spacing.paddingButtonSmallWithLeftIcon,
    Medium: () => theme.spacing.paddingButtonNormalWithLeftIcon,
    Large: () => theme.spacing.paddingButtonLargeWithLeftIcon,
  });
Severity: Major
Found in src/components/Button/getButtonSpacing.ts and 8 other locations - About 1 hr to fix
src/components/Badge/getFontSize.ts on lines 5..9
src/components/Button/getButtonSpacing.ts on lines 22..26
src/components/Button/getButtonSpacing.ts on lines 28..32
src/components/Button/getButtonSpacing.ts on lines 40..44
src/components/Button/getSizeToken.ts on lines 5..9
src/components/Button/getSizeToken.ts on lines 11..15
src/components/Button/getSizeToken.ts on lines 17..21
src/components/Button/getSizeToken.ts on lines 23..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

Function getHeadingToken has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getHeadingToken = (name: string, theme: TestOkurTheme, type: Types): string | number => {
  const weightHeadingMapping = curry<number>({
    PageTitle: () => theme.font.fontWeightHeadingDisplay,
    PageSubtitle: () => theme.font.fontWeightHeadingDisplaySubtitle,
    Title1: () => theme.font.fontWeightHeadingTitle1,
Severity: Minor
Found in src/components/Heading/getHeadingToken.ts - About 1 hr to fix

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

    export const CancelledCritical = (): JSX.Element => {
      return <Cancelled size={Sizes.Large} color={Colors.Critical} ariaLabel="Cancelled" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 33..35

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

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

    export const ChevronDownLargeSuccess = (): JSX.Element => {
      return <ChevronDown size={Sizes.Large} color={Colors.Success} ariaLabel="ChevronDown" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 33..35
    src/components/Icons/component.stories.tsx on lines 37..39

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

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

    export const EmailPrimary = (): JSX.Element => {
      return <Email size={Sizes.Large} color={Colors.Info} ariaLabel="Email" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 33..35
    src/components/Icons/component.stories.tsx on lines 37..39

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

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

    export const CheckSuccessful = (): JSX.Element => {
      return <Check size={Sizes.Large} color={Colors.Success} ariaLabel="Check" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 33..35
    src/components/Icons/component.stories.tsx on lines 37..39

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

    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

    export const WtihDateTimeMask = (): JSX.Element => {
      return <MaskedInputField maskingType={MaskingType.DateTime} onChange={action('change')} label="Enter Date Time" />;
    };
    Severity: Major
    Found in src/components/MaskedInputField/component.stories.tsx and 1 other location - About 1 hr to fix
    src/components/MaskedInputField/component.stories.tsx on lines 9..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 61.

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

    export const ExpiredCritical = (): JSX.Element => {
      return <Expired size={Sizes.Large} color={Colors.Critical} ariaLabel="Expired" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 37..39

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

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

    export const ArrowRepeatFailed = (): JSX.Element => {
      return <ArrowRepeat size={Sizes.Large} color={Colors.Warning} ariaLabel="Arrow Repeat" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 33..35
    src/components/Icons/component.stories.tsx on lines 37..39

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

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

    export const TimeWarning = (): JSX.Element => {
      return <Time size={Sizes.Large} color={Colors.Warning} ariaLabel="Time" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 29..31
    src/components/Icons/component.stories.tsx on lines 33..35
    src/components/Icons/component.stories.tsx on lines 37..39

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

    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

    export const WithPhoneMask = (): JSX.Element => {
      return <MaskedInputField maskingType={MaskingType.Phone} onChange={action('change')} label="Enter Phone Number" />;
    };
    Severity: Major
    Found in src/components/MaskedInputField/component.stories.tsx and 1 other location - About 1 hr to fix
    src/components/MaskedInputField/component.stories.tsx on lines 13..15

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

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

    export const ExclamationCritical = (): JSX.Element => {
      return <Exclamation size={Sizes.Large} color={Colors.Critical} ariaLabel="Exclamation" />;
    };
    Severity: Major
    Found in src/components/Icons/component.stories.tsx and 7 other locations - About 1 hr to fix
    src/components/Icons/component.stories.tsx on lines 9..11
    src/components/Icons/component.stories.tsx on lines 13..15
    src/components/Icons/component.stories.tsx on lines 17..19
    src/components/Icons/component.stories.tsx on lines 21..23
    src/components/Icons/component.stories.tsx on lines 25..27
    src/components/Icons/component.stories.tsx on lines 33..35
    src/components/Icons/component.stories.tsx on lines 37..39

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

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

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

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

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

    Refactorings

    Further Reading

    Function Default has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const Default = (): JSX.Element => {
      const block = boolean('block', true);
      const children = text('Children', 'This is hidden content');
      const largeDesktop = boolean('largeDesktop', false);
      const desktop = boolean('desktop', false);
    Severity: Minor
    Found in src/components/Hide/component.stories.tsx - About 1 hr to fix

      Function doFormat has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      const doFormat = (value: string, format: string, mask: string): [string, number] => {
        const strippedValue = value.replace(/[^0-9]/g, '');
        const chars = strippedValue.split('');
        let count = 0;
        let caretPosition = 0;
      Severity: Minor
      Found in src/components/MaskedInputField/doFormat.ts - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Severity
      Category
      Status
      Source
      Language