ant-design/ant-design

View on GitHub

Showing 1,098 of 3,488 total issues

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

/* eslint-disable no-unsafe-optional-chaining */
/* eslint-disable react/no-multi-comp */
import React, { useEffect, useState } from 'react';

import type { ColumnGroupType, ColumnType, TableProps } from '..';
Severity: Major
Found in components/table/__tests__/Table.filter.test.tsx - About 1 wk to fix

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

    import type { ChangeEventHandler } from 'react';
    import React, { version as ReactVersion, useEffect, useRef, useState } from 'react';
    import { AlertFilled } from '@ant-design/icons';
    import type { ColProps } from 'antd/es/grid';
    import classNames from 'classnames';
    Severity: Major
    Found in components/form/__tests__/index.test.tsx - About 5 days to fix

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

      import React from 'react';
      
      import type { TableProps } from '..';
      import Table from '..';
      import { resetWarned } from '../../_util/warning';
      Severity: Major
      Found in components/table/__tests__/Table.rowSelection.test.tsx - About 4 days to fix

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

        import React from 'react';
        
        import type { UploadFile, UploadProps } from '..';
        import Upload from '..';
        import { act, fireEvent, render, waitFakeTimer, waitFor } from '../../../tests/utils';
        Severity: Major
        Found in components/upload/__tests__/uploadlist.test.tsx - About 3 days to fix

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

          import React from 'react';
          
          import ConfigProvider from '..';
          import { fireEvent, render } from '../../../tests/utils';
          import Alert from '../../alert';
          Severity: Major
          Found in components/config-provider/__tests__/style.test.tsx - About 3 days to fix

            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

                    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

                        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

                                Function FilterDropdown has 364 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
                                  const {
                                    tablePrefixCls,
                                    prefixCls,
                                    column,
                                Severity: Major
                                Found in components/table/hooks/useFilter/FilterDropdown.tsx - About 1 day to fix

                                  Function genPickerStyle has 350 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
                                    const {
                                      componentCls,
                                      antCls,
                                      controlHeight,
                                  Severity: Major
                                  Found in components/date-picker/style/index.ts - About 1 day to fix

                                    Function InternalUpload has 348 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const InternalUpload: React.ForwardRefRenderFunction<UploadRef, UploadProps> = (props, ref) => {
                                      const {
                                        fileList,
                                        defaultFileList,
                                        onRemove,
                                    Severity: Major
                                    Found in components/upload/Upload.tsx - About 1 day to fix

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

                                      import React, { useCallback, useEffect, useState } from 'react';
                                      import { fireEvent, render, waitFor } from '@testing-library/react';
                                      import type { DefaultRecordType } from 'rc-table/lib/interface';
                                      
                                      import type { SelectAllLabel, TransferProps } from '..';
                                      Severity: Major
                                      Found in components/transfer/__tests__/index.test.tsx - About 1 day to fix

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

                                        import * as React from 'react';
                                        import { SmileOutlined } from '@ant-design/icons';
                                        import CSSMotion from 'rc-motion';
                                        import { genCSSMotion } from 'rc-motion/lib/CSSMotion';
                                        import KeyCode from 'rc-util/lib/KeyCode';
                                        Severity: Major
                                        Found in components/modal/__tests__/confirm.test.tsx - About 1 day to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language