ant-design/ant-design

View on GitHub

Showing 3,488 of 3,488 total issues

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

const localeValues: Locale = {
  locale: 'ka',
  Pagination,
  DatePicker,
  TimePicker,
Severity: Major
Found in components/locale/ka_GE.ts and 6 other locations - About 3 days to fix
components/locale/bn_BD.ts on lines 11..130
components/locale/hi_IN.ts on lines 11..130
components/locale/ml_IN.ts on lines 11..130
components/locale/ro_RO.ts on lines 11..130
components/locale/sr_RS.ts on lines 11..130
components/locale/ur_PK.ts on lines 11..130

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

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

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

const localeValues: Locale = {
  locale: 'fr',
  Pagination,
  DatePicker,
  TimePicker,
Severity: Major
Found in components/locale/fr_CA.ts and 1 other location - About 3 days to fix
components/locale/fr_BE.ts on lines 11..129

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

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

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

const localeValues: Locale = {
  locale: 'fr',
  Pagination,
  DatePicker,
  TimePicker,
Severity: Major
Found in components/locale/fr_BE.ts and 1 other location - About 3 days to fix
components/locale/fr_CA.ts on lines 11..129

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

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

const localeValues: Locale = {
  locale: 'he',
  Pagination,
  DatePicker,
  TimePicker,
Severity: Major
Found in components/locale/he_IL.ts and 1 other location - About 2 days to fix
components/locale/ar_EG.ts on lines 11..117

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

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

const localeValues: Locale = {
  locale: 'ar',
  Pagination,
  DatePicker,
  TimePicker,
Severity: Major
Found in components/locale/ar_EG.ts and 1 other location - About 2 days to fix
components/locale/he_IL.ts on lines 11..117

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

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

Function useSelection has 535 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const useSelection = <RecordType extends AnyObject = AnyObject>(
  config: UseSelectionConfig<RecordType>,
  rowSelection?: TableRowSelection<RecordType>,
): readonly [TransformColumns<RecordType>, Set<Key>] => {
  const {
Severity: Major
Found in components/table/hooks/useSelection.tsx - About 2 days to fix

    File Table.sorter.test.tsx has 1021 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable react/no-multi-comp */
    import React from 'react';
    
    import type { ColumnType, TableProps } from '..';
    import Table from '..';
    Severity: Major
    Found in components/table/__tests__/Table.sorter.test.tsx - About 2 days to fix

      File index.test.tsx has 1019 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useMemo, useState } from 'react';
      import {
        AppstoreOutlined,
        InboxOutlined,
        MailOutlined,
      Severity: Major
      Found in components/menu/__tests__/index.test.tsx - About 2 days to fix

        Function CodePreviewer has 452 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const CodePreviewer: React.FC<AntdPreviewerProps> = (props) => {
          const {
            asset,
            expand,
            iframe,
        Severity: Major
        Found in .dumi/theme/builtins/Previewer/CodePreviewer.tsx - About 2 days to fix

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

          const localeValues: Locale = {
            locale: 'bg',
            Pagination,
            DatePicker,
            TimePicker,
          Severity: Major
          Found in components/locale/bg_BG.ts and 1 other location - About 2 days to fix
          components/locale/is_IS.ts on lines 10..98

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

          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

          const localeValues: Locale = {
            locale: 'is',
            Pagination,
            DatePicker,
            TimePicker,
          Severity: Major
          Found in components/locale/is_IS.ts and 1 other location - About 2 days to fix
          components/locale/bg_BG.ts on lines 10..98

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

          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

          File upload.test.tsx has 904 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { useEffect, useRef } from 'react';
          import { produce } from 'immer';
          import cloneDeep from 'lodash/cloneDeep';
          import type { UploadRequestOption } from 'rc-upload/lib/interface';
          
          
          Severity: Major
          Found in components/upload/__tests__/upload.test.tsx - About 2 days to fix

            File Anchor.test.tsx has 898 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useState } from 'react';
            import { resetWarned } from 'rc-util/lib/warning';
            import scrollIntoView from 'scroll-into-view-if-needed';
            
            import Anchor from '..';
            Severity: Major
            Found in components/anchor/__tests__/Anchor.test.tsx - About 2 days to fix

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

              describe('notification static warning', () => {
                beforeAll(() => {
                  actWrapper(act);
                });
              
              
              Severity: Major
              Found in components/notification/__tests__/static-warning.test.tsx and 1 other location - About 2 days to fix
              components/message/__tests__/static-warning.test.tsx on lines 8..58

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

              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

              describe('message static warning', () => {
                beforeAll(() => {
                  actWrapper(act);
                });
              
              
              Severity: Major
              Found in components/message/__tests__/static-warning.test.tsx and 1 other location - About 2 days to fix
              components/notification/__tests__/static-warning.test.tsx on lines 8..58

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

              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

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

              import { unit } from '@ant-design/cssinjs';
              import type { CSSObject } from '@ant-design/cssinjs';
              
              import { genFocusStyle, resetComponent, textEllipsis } from '../../style';
              import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
              Severity: Major
              Found in components/tabs/style/index.ts - About 2 days to fix

                Function genPanelStyle has 403 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
                  const {
                    componentCls,
                    pickerCellCls,
                    pickerCellInnerCls,
                Severity: Major
                Found in components/date-picker/style/panel.ts - About 2 days to fix

                  Function InternalTable has 396 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const InternalTable = <RecordType extends AnyObject = AnyObject>(
                    props: InternalTableProps<RecordType>,
                    ref: React.MutableRefObject<HTMLDivElement>,
                  ) => {
                    const {
                  Severity: Major
                  Found in components/table/InternalTable.tsx - About 1 day to fix

                    Function GlobalStyle has 393 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const GlobalStyle: React.FC = () => {
                      const token = useTheme();
                    
                      const { antCls } = token;
                    
                    
                    Severity: Major
                    Found in .dumi/theme/common/styles/Markdown.tsx - About 1 day to fix

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

                        it('should not show pager if pagination.hideOnSinglePage is true and only 1 page', () => {
                          const { container, rerender } = render(
                            createTable({ pagination: { pageSize: 3, hideOnSinglePage: true } }),
                          );
                          expect(container.querySelectorAll('.ant-pagination')).toHaveLength(1);
                      Severity: Major
                      Found in components/table/__tests__/Table.pagination.test.tsx and 1 other location - About 1 day to fix
                      components/list/__tests__/pagination.test.tsx on lines 47..62

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

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language