ant-design/ant-design

View on GitHub
components/input-number/style/index.ts

Summary

Maintainability
F
3 days
Test Coverage

Function genInputNumberStyles has 258 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumberToken) => {
  const {
    componentCls,
    lineWidth,
    lineType,
Severity: Major
Found in components/input-number/style/index.ts - About 1 day to fix

    File index.ts has 407 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { unit } from '@ant-design/cssinjs';
    
    import {
      genBasicInputStyle,
      genInputGroupStyle,
    Severity: Minor
    Found in components/input-number/style/index.ts - About 5 hrs to fix

      Function genAffixWrapperStyles has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const genAffixWrapperStyles: GenerateStyle<InputNumberToken> = (token: InputNumberToken) => {
        const {
          componentCls,
          paddingBlock,
          paddingInline,
      Severity: Major
      Found in components/input-number/style/index.ts - About 3 hrs to fix

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

                  [`input${componentCls}-input`]: {
                    height: calc(controlHeightSM).sub(calc(lineWidth).mul(2)).equal(),
                    padding: `${unit(paddingBlockSM)} ${unit(paddingInlineSM)}`,
                  },
        Severity: Major
        Found in components/input-number/style/index.ts and 1 other location - About 2 hrs to fix
        components/input-number/style/index.ts on lines 129..132

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

        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

                  [`input${componentCls}-input`]: {
                    height: calc(controlHeightLG).sub(calc(lineWidth).mul(2)).equal(),
                    padding: `${unit(paddingBlockLG)} ${unit(paddingInlineLG)}`,
                  },
        Severity: Major
        Found in components/input-number/style/index.ts and 1 other location - About 2 hrs to fix
        components/input-number/style/index.ts on lines 139..142

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

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

          const {
            componentCls,
            paddingBlock,
            paddingInline,
            inputAffixPadding,
        Severity: Major
        Found in components/input-number/style/index.ts and 6 other locations - About 1 hr to fix
        components/color-picker/style/picker.ts on lines 9..21
        components/form/style/index.ts on lines 169..181
        components/image/style/index.ts on lines 81..93
        components/popconfirm/style/index.ts on lines 16..28
        components/popover/style/index.ts on lines 173..185
        components/table/style/sticky.ts on lines 8..20

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 63.

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

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

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

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

        Refactorings

        Further Reading

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

                  [`${componentCls}-handler-wrap`]: {
                    background: handleBg,
                    [`${componentCls}-handler-down`]: {
                      borderBlockStart: `${unit(lineWidth)} ${lineType} ${handleBorderColor}`,
                    },
        Severity: Major
        Found in components/input-number/style/index.ts and 1 other location - About 1 hr to fix
        components/input-number/style/index.ts on lines 100..105

        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

                  [`${componentCls}-handler-wrap`]: {
                    background: filledHandleBg,
                    [`${componentCls}-handler-down`]: {
                      borderBlockStart: `${unit(lineWidth)} ${lineType} ${handleBorderColor}`,
                    },
        Severity: Major
        Found in components/input-number/style/index.ts and 1 other location - About 1 hr to fix
        components/input-number/style/index.ts on lines 92..97

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

              '&-lg': {
                borderRadius: borderRadiusLG,
                paddingInlineStart: paddingInlineLG,
        
                [`input${componentCls}-input`]: {
        Severity: Minor
        Found in components/input-number/style/index.ts and 1 other location - About 40 mins to fix
        components/input-number/style/index.ts on lines 397..404

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

        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

              '&-sm': {
                borderRadius: borderRadiusSM,
                paddingInlineStart: paddingInlineSM,
        
                [`input${componentCls}-input`]: {
        Severity: Minor
        Found in components/input-number/style/index.ts and 1 other location - About 40 mins to fix
        components/input-number/style/index.ts on lines 388..395

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

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

                    [`&:not(${componentCls}-compact-last-item)${componentCls}-compact-first-item`]: {
                      [`${componentCls}, ${componentCls}-group-addon`]: {
                        borderStartEndRadius: 0,
                        borderEndEndRadius: 0,
                      },
        Severity: Major
        Found in components/input-number/style/index.ts and 5 other locations - About 40 mins to fix
        components/input-number/style/index.ts on lines 201..206
        components/input/style/index.ts on lines 613..618
        components/input/style/index.ts on lines 620..625
        components/style/compact-item-vertical.ts on lines 32..37
        components/style/compact-item-vertical.ts on lines 39..44

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

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

                    [`&:not(${componentCls}-compact-first-item)${componentCls}-compact-last-item`]: {
                      [`${componentCls}, ${componentCls}-group-addon`]: {
                        borderStartStartRadius: 0,
                        borderEndStartRadius: 0,
                      },
        Severity: Major
        Found in components/input-number/style/index.ts and 5 other locations - About 40 mins to fix
        components/input-number/style/index.ts on lines 194..199
        components/input/style/index.ts on lines 613..618
        components/input/style/index.ts on lines 620..625
        components/style/compact-item-vertical.ts on lines 32..37
        components/style/compact-item-vertical.ts on lines 39..44

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

        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