ant-design/ant-design

View on GitHub
.dumi/pages/index/components/ComponentsList.tsx

Summary

Maintainability
D
2 days
Test Coverage

Function ComponentsList has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ComponentsList: React.FC = () => {
  const token = useTheme();
  const { styles } = useStyle();
  const [locale] = useLocale(locales);
  const { isMobile } = useContext(SiteContext);
Severity: Major
Found in .dumi/pages/index/components/ComponentsList.tsx - About 4 hrs to fix

    File ComponentsList.tsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useContext } from 'react';
    import { CustomerServiceOutlined, QuestionCircleOutlined, SyncOutlined } from '@ant-design/icons';
    import {
      Alert,
      Carousel,
    Severity: Minor
    Found in .dumi/pages/index/components/ComponentsList.tsx - About 2 hrs to fix

      Function useStyle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const useStyle = () => {
        const isRootDark = useDark();
      
        return createStyles(({ token }) => {
          const { carousel } = getCarouselStyle();
      Severity: Minor
      Found in .dumi/pages/index/components/ComponentsList.tsx - About 1 hr to fix

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

              <Carousel className={styles.carousel}>
                {COMPONENTS.map<React.ReactNode>(({ title, node, type }, index) => (
                  <ComponentItem title={title} node={node} type={type} index={index} key={index} />
                ))}
              </Carousel>
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 2 hrs to fix
        .dumi/pages/index/components/ComponentsList.tsx on lines 272..276

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

        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

              <div style={{ display: 'flex', alignItems: 'stretch', columnGap: token.paddingLG }}>
                {COMPONENTS.map<React.ReactNode>(({ title, node, type }, index) => (
                  <ComponentItem title={title} node={node} type={type} index={index} key={index} />
                ))}
              </div>
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 2 hrs to fix
        .dumi/pages/index/components/ComponentsList.tsx on lines 264..268

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

        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

                    <Flex gap="small" align="center">
                      <Progress type="circle" status="exception" percent={88} size={14} />
                      {locale.taskFailed}
                    </Flex>
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 1 hr to fix
        .dumi/pages/index/components/ComponentsList.tsx on lines 187..190

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

        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

                    <Flex gap="small" align="center">
                      <Progress type="circle" trailColor="#e6f4ff" percent={60} size={14} />
                      {locale.inProgress}
                    </Flex>
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 1 hr to fix
        .dumi/pages/index/components/ComponentsList.tsx on lines 195..198

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

        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

          en: {
            yesterday: 'Yesterday',
            lastWeek: 'Last Week',
            lastMonth: 'Last Month',
            lastYear: 'Last Year',
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 1 hr to fix
        .dumi/pages/index/components/ComponentsList.tsx on lines 36..48

        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

          cn: {
            yesterday: '昨天',
            lastWeek: '上周',
            lastMonth: '上月',
            lastYear: '去年',
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 1 hr to fix
        .dumi/pages/index/components/ComponentsList.tsx on lines 49..61

        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

                    <FloatButtonDoNotUseOrYouWillBeFired
                      shape="square"
                      items={[
                        { icon: <QuestionCircleOutlined /> },
                        { icon: <CustomerServiceOutlined /> },
        Severity: Major
        Found in .dumi/pages/index/components/ComponentsList.tsx and 1 other location - About 1 hr to fix
        components/float-button/demo/render-panel.tsx on lines 18..25

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

        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