testokur/testokur-ui

View on GitHub
src/components/Button/getColor.ts

Summary

Maintainability
F
1 wk
Test Coverage

Function getColor has 156 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getColor = (name: string, type: Types, theme: TestOkurTheme): string => {
  const backgroundButtonMappings = curry<string>({
    Primary: () => theme.colors.backgroundButtonPrimary,
    Secondary: () => theme.colors.backgroundButtonSecondary,
    Success: () => theme.colors.backgroundButtonSuccess,
Severity: Major
Found in src/components/Button/getColor.ts - About 6 hrs to fix

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

      const backgroundButtonBorderedHoverMapping = curry<string>({
        Primary: () => theme.colors.backgroundButtonBorderedHover,
        Secondary: () => theme.colors.backgroundButtonBorderedHover,
        Success: () => theme.colors.backgroundButtonBorderedHover,
        Info: () => theme.colors.backgroundButtonBorderedHover,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const colorTextButtonMapping = curry<string>({
        Primary: () => theme.colors.colorTextButtonPrimary,
        Secondary: () => theme.colors.colorTextButtonSecondary,
        Success: () => theme.colors.colorTextButtonSuccess,
        Info: () => theme.colors.colorTextButtonInfo,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const colorTextButtonBorderedActiveMapping = curry<string>({
        Primary: () => theme.colors.colorTextButtonPrimaryBorderedActive,
        Secondary: () => theme.colors.colorTextButtonSecondaryBorderedActive,
        Success: () => theme.colors.colorTextButtonSuccessBorderedActive,
        Info: () => theme.colors.colorTextButtonInfoBorderedActive,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const backgroundButtonBorderedActiveMapping = curry<string>({
        Primary: () => theme.colors.backgroundButtonBorderedActive,
        Secondary: () => theme.colors.backgroundButtonBorderedActive,
        Success: () => theme.colors.backgroundButtonBorderedActive,
        Info: () => theme.colors.backgroundButtonBorderedActive,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const colorTextButtonBorderedMapping = curry<string>({
        Primary: () => theme.colors.colorTextButtonPrimaryBordered,
        Secondary: () => theme.colors.colorTextButtonSecondaryBordered,
        Success: () => theme.colors.colorTextButtonSuccessBordered,
        Info: () => theme.colors.colorTextButtonInfoBordered,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const borderColorButtonHoverMapping = curry<string>({
        Primary: () => theme.colors.borderColorButtonPrimaryBorderedHover,
        Secondary: () => theme.colors.borderColorButtonSecondaryBorderedHover,
        Success: () => theme.colors.borderColorButtonSuccessBorderedHover,
        Info: () => theme.colors.colorTextButtonInfoBorderedHover,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 141..148

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

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

      const colorTextButtonBorderedHoverMapping = curry<string>({
        Primary: () => theme.colors.colorTextButtonPrimaryBorderedHover,
        Secondary: () => theme.colors.colorTextButtonSecondaryBorderedHover,
        Success: () => theme.colors.colorTextButtonSuccessBorderedHover,
        Info: () => theme.colors.colorTextButtonInfoBorderedHover,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const backgroundButtonActiveMappings = curry<string>({
        Primary: () => theme.colors.backgroundButtonPrimaryActive,
        Secondary: () => theme.colors.backgroundButtonSecondaryActive,
        Success: () => theme.colors.backgroundButtonSuccessActive,
        Info: () => theme.colors.backgroundButtonInfoActive,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const backgroundButtonHoverMappings = curry<string>({
        Primary: () => theme.colors.backgroundButtonPrimaryHover,
        Secondary: () => theme.colors.backgroundButtonSecondaryHover,
        Success: () => theme.colors.backgroundButtonSuccessHover,
        Info: () => theme.colors.backgroundButtonInfoHover,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const colorTextButtonActiveMapping = curry<string>({
        Primary: () => theme.colors.colorTextButtonPrimaryActive,
        Secondary: () => theme.colors.colorTextButtonSecondaryActive,
        Success: () => theme.colors.colorTextButtonSuccessActive,
        Info: () => theme.colors.colorTextButtonInfoActive,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const backgroundButtonFocusMappings = curry<string>({
        Primary: () => theme.colors.backgroundButtonPrimary,
        Secondary: () => theme.colors.backgroundButtonSecondary,
        Success: () => theme.colors.backgroundButtonSuccess,
        Info: () => theme.colors.backgroundButtonInfo,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const backgroundButtonBorderedMapping = curry<string>({
        Primary: () => theme.colors.backgroundButtonBordered,
        Secondary: () => theme.colors.backgroundButtonBordered,
        Success: () => theme.colors.backgroundButtonBordered,
        Info: () => theme.colors.backgroundButtonBordered,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const borderColorButtonActiveMapping = curry<string>({
        Primary: () => theme.colors.borderColorButtonPrimaryBorderedActive,
        Secondary: () => theme.colors.borderColorButtonSecondaryBorderedActive,
        Success: () => theme.colors.borderColorButtonSuccessBorderedActive,
        Info: () => theme.colors.colorTextButtonInfoBorderedActive,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139

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

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

      const backgroundButtonMappings = curry<string>({
        Primary: () => theme.colors.backgroundButtonPrimary,
        Secondary: () => theme.colors.backgroundButtonSecondary,
        Success: () => theme.colors.backgroundButtonSuccess,
        Info: () => theme.colors.backgroundButtonInfo,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const borderColorButtonMapping = curry<string>({
        Primary: () => theme.colors.borderColorButtonPrimaryBordered,
        Secondary: () => theme.colors.borderColorButtonSecondaryBordered,
        Success: () => theme.colors.borderColorButtonSuccessBordered,
        Info: () => theme.colors.colorTextButtonInfoBordered,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 87..94
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

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

      const colorTextButtonHoverMapping = curry<string>({
        Primary: () => theme.colors.colorTextButtonPrimaryHover,
        Secondary: () => theme.colors.colorTextButtonSecondaryHover,
        Success: () => theme.colors.colorTextButtonSuccessHover,
        Info: () => theme.colors.colorTextButtonInfoHover,
    Severity: Major
    Found in src/components/Button/getColor.ts and 15 other locations - About 3 hrs to fix
    src/components/Button/getColor.ts on lines 6..13
    src/components/Button/getColor.ts on lines 15..22
    src/components/Button/getColor.ts on lines 24..31
    src/components/Button/getColor.ts on lines 33..40
    src/components/Button/getColor.ts on lines 42..49
    src/components/Button/getColor.ts on lines 51..58
    src/components/Button/getColor.ts on lines 60..67
    src/components/Button/getColor.ts on lines 69..76
    src/components/Button/getColor.ts on lines 78..85
    src/components/Button/getColor.ts on lines 96..103
    src/components/Button/getColor.ts on lines 105..112
    src/components/Button/getColor.ts on lines 114..121
    src/components/Button/getColor.ts on lines 123..130
    src/components/Button/getColor.ts on lines 132..139
    src/components/Button/getColor.ts on lines 141..148

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

    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