bylapidist/components

View on GitHub
src/components/Button/Button.stories.tsx

Summary

Maintainability
A
0 mins
Test Coverage

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

export default {
    title: 'Inputs/Button',
    component: Button,
    decorators: [(getStory) => <ThemeProvider>{getStory()}</ThemeProvider>]
} as Meta<typeof Button>;
Severity: Major
Found in src/components/Button/Button.stories.tsx and 9 other locations - About 55 mins to fix
src/components/Box/Box.stories.tsx on lines 8..12
src/components/Heading/Heading.stories.tsx on lines 7..11
src/components/Link/Link.stories.tsx on lines 7..11
src/components/Logo/Logo.stories.tsx on lines 7..11
src/components/Tabs/Tabs.stories.tsx on lines 7..11
src/components/Tag/Tag.stories.tsx on lines 7..11
src/components/Text/Text.stories.tsx on lines 7..11
src/components/Timeline/Timeline.stories.tsx on lines 7..11
src/components/Toggle/Toggle.stories.tsx on lines 7..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 53.

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

export const SecondarySmall: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'secondary',
        size: 'small'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const DangerDisabled: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'danger',
        disabled: true
Severity: Major
Found in src/components/Button/Button.stories.tsx and 6 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 76..82
src/components/Button/Button.stories.tsx on lines 108..114
src/components/Button/Button.stories.tsx on lines 156..162
src/components/Toggle/Toggle.stories.tsx on lines 74..80
src/components/Toggle/Toggle.stories.tsx on lines 106..112
src/components/Toggle/Toggle.stories.tsx on lines 138..144

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

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

export const TertiarySmall: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'tertiary',
        size: 'small'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const TertiaryMedium: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'tertiary',
        size: 'medium'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const TertiaryLarge: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'tertiary',
        size: 'large'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const DangerMedium: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'danger',
        size: 'medium'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const Block: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'primary',
        block: true
Severity: Major
Found in src/components/Button/Button.stories.tsx and 6 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 76..82
src/components/Button/Button.stories.tsx on lines 108..114
src/components/Button/Button.stories.tsx on lines 140..146
src/components/Toggle/Toggle.stories.tsx on lines 74..80
src/components/Toggle/Toggle.stories.tsx on lines 106..112
src/components/Toggle/Toggle.stories.tsx on lines 138..144

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

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

export const DangerSmall: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'danger',
        size: 'small'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const SecondaryMedium: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'secondary',
        size: 'medium'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const SecondaryDisabled: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'secondary',
        disabled: true
Severity: Major
Found in src/components/Button/Button.stories.tsx and 6 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 108..114
src/components/Button/Button.stories.tsx on lines 140..146
src/components/Button/Button.stories.tsx on lines 156..162
src/components/Toggle/Toggle.stories.tsx on lines 74..80
src/components/Toggle/Toggle.stories.tsx on lines 106..112
src/components/Toggle/Toggle.stories.tsx on lines 138..144

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

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

export const DangerLarge: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'danger',
        size: 'large'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 68..74
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const SecondaryLarge: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'secondary',
        size: 'large'
Severity: Major
Found in src/components/Button/Button.stories.tsx and 17 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 52..58
src/components/Button/Button.stories.tsx on lines 60..66
src/components/Button/Button.stories.tsx on lines 84..90
src/components/Button/Button.stories.tsx on lines 92..98
src/components/Button/Button.stories.tsx on lines 100..106
src/components/Button/Button.stories.tsx on lines 116..122
src/components/Button/Button.stories.tsx on lines 124..130
src/components/Button/Button.stories.tsx on lines 132..138
src/components/Toggle/Toggle.stories.tsx on lines 50..56
src/components/Toggle/Toggle.stories.tsx on lines 58..64
src/components/Toggle/Toggle.stories.tsx on lines 66..72
src/components/Toggle/Toggle.stories.tsx on lines 82..88
src/components/Toggle/Toggle.stories.tsx on lines 90..96
src/components/Toggle/Toggle.stories.tsx on lines 98..104
src/components/Toggle/Toggle.stories.tsx on lines 114..120
src/components/Toggle/Toggle.stories.tsx on lines 122..128
src/components/Toggle/Toggle.stories.tsx on lines 130..136

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

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

export const TertiaryDisabled: StoryObj<BaseProps & ButtonProps> = {
    args: {
        ...defaultArgs,
        level: 'tertiary',
        disabled: true
Severity: Major
Found in src/components/Button/Button.stories.tsx and 6 other locations - About 35 mins to fix
src/components/Button/Button.stories.tsx on lines 76..82
src/components/Button/Button.stories.tsx on lines 140..146
src/components/Button/Button.stories.tsx on lines 156..162
src/components/Toggle/Toggle.stories.tsx on lines 74..80
src/components/Toggle/Toggle.stories.tsx on lines 106..112
src/components/Toggle/Toggle.stories.tsx on lines 138..144

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

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