ant-design/ant-design

View on GitHub
components/float-button/style/index.ts

Summary

Maintainability
F
4 days
Test Coverage

Function sharedFloatButtonStyle has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const sharedFloatButtonStyle: GenerateStyle<FloatButtonToken, CSSObject> = (token) => {
  const {
    antCls,
    componentCls,
    floatButtonBodyPadding,
Severity: Major
Found in components/float-button/style/index.ts - About 5 hrs to fix

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

    import type { CSSObject } from '@ant-design/cssinjs';
    import { Keyframes, unit } from '@ant-design/cssinjs';
    
    import { resetComponent } from '../../style';
    import { initFadeMotion } from '../../style/motion/fade';
    Severity: Minor
    Found in components/float-button/style/index.ts - About 5 hrs to fix

      Function floatButtonGroupStyle has 114 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const floatButtonGroupStyle: GenerateStyle<FloatButtonToken, CSSObject> = (token) => {
        const {
          antCls,
          componentCls,
          floatButtonSize,
      Severity: Major
      Found in components/float-button/style/index.ts - About 4 hrs to fix

        Function initFloatButtonGroupMotion has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const initFloatButtonGroupMotion = (token: FloatButtonToken) => {
          const { componentCls, floatButtonSize, motionDurationSlow, motionEaseInOutCirc } = token;
          const groupPrefixCls = `${componentCls}-group`;
          const moveDownIn = new Keyframes('antFloatButtonMoveDownIn', {
            '0%': {
        Severity: Minor
        Found in components/float-button/style/index.ts - About 1 hr to fix

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

                [`${componentCls}-body`]: {
                  backgroundColor: token.colorPrimary,
                  transition: `background-color ${token.motionDurationMid}`,
                  '&:hover': {
                    backgroundColor: token.colorPrimaryHover,
          Severity: Major
          Found in components/float-button/style/index.ts and 1 other location - About 5 hrs to fix
          components/float-button/style/index.ts on lines 323..341

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

          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}-body`]: {
                  backgroundColor: token.floatButtonBackgroundColor,
                  transition: `background-color ${token.motionDurationMid}`,
                  '&:hover': {
                    backgroundColor: token.colorFillContent,
          Severity: Major
          Found in components/float-button/style/index.ts and 1 other location - About 5 hrs to fix
          components/float-button/style/index.ts on lines 345..363

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

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

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

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

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

          Refactorings

          Further Reading

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

              const {
                colorTextLightSolid,
                colorBgElevated,
                controlHeightLG,
                marginXXL,
          Severity: Major
          Found in components/float-button/style/index.ts and 7 other locations - About 1 hr to fix
          components/_util/ActionButton.tsx on lines 30..41
          components/avatar/style/index.ts on lines 167..178
          components/color-picker/style/index.ts on lines 125..136
          components/date-picker/style/panel.ts on lines 635..646
          components/float-button/style/index.ts on lines 214..225
          components/select/style/multiple.ts on lines 100..111
          components/steps/style/index.ts on lines 434..445

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 58.

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

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

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

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

          Refactorings

          Further Reading

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

            const {
              antCls,
              componentCls,
              floatButtonBodyPadding,
              floatButtonIconSize,
          Severity: Major
          Found in components/float-button/style/index.ts and 7 other locations - About 1 hr to fix
          components/_util/ActionButton.tsx on lines 30..41
          components/avatar/style/index.ts on lines 167..178
          components/color-picker/style/index.ts on lines 125..136
          components/date-picker/style/panel.ts on lines 635..646
          components/float-button/style/index.ts on lines 377..388
          components/select/style/multiple.ts on lines 100..111
          components/steps/style/index.ts on lines 434..445

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 58.

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

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

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

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

          Refactorings

          Further Reading

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

            const {
              antCls,
              componentCls,
              floatButtonSize,
              margin,
          Severity: Major
          Found in components/float-button/style/index.ts and 11 other locations - About 55 mins to fix
          components/affix/index.tsx on lines 60..70
          components/breadcrumb/Breadcrumb.tsx on lines 139..149
          components/modal/style/confirm.ts on lines 13..23
          components/notification/useNotification.tsx on lines 58..68
          components/result/style/index.ts on lines 42..52
          components/slider/style/index.ts on lines 112..122
          components/steps/style/progress.ts on lines 8..18
          components/table/hooks/useSelection.tsx on lines 99..109
          components/transfer/ListBody.tsx on lines 42..52
          components/transfer/ListItem.tsx on lines 24..34
          components/typography/Base/CopyBtn.tsx on lines 23..33

          Duplicated Code

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

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

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

          Tuning

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

          There are no issues that match your filters.

          Category
          Status