Showing 1,098 of 3,488 total issues
Function Transfer
has 329 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Transfer = <RecordType extends TransferItem = TransferItem>(
props: TransferProps<RecordType>,
) => {
const {
dataSource,
Function Base
has 325 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Base = React.forwardRef<HTMLElement, BlockProps>((props, ref) => {
const {
prefixCls: customizePrefixCls,
className,
style,
Function Footer
has 322 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Footer: React.FC = () => {
const location = useLocation();
const [locale, lang] = useLocale(locales);
const { styles } = useStyle();
File index.ts
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import { clearFix, resetComponent } from '../../style';
import { genCompactItemStyle } from '../../style/compact-item';
Function GlobalDemoStyles
has 308 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GlobalDemoStyles: React.FC = () => {
const token = useTheme();
const { antCls, iconCls } = token;
File index.ts
has 670 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { CSSProperties } from 'react';
import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import { TinyColor } from '@ctrl/tinycolor';
import type { CssUtil } from 'antd-style';
File index.test.tsx
has 670 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useMemo, useState } from 'react';
import { createEvent, fireEvent, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { resetWarned } from '../../_util/warning';
Function getColumns
has 299 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getColumns = React.useMemo<FooterColumn[]>(() => {
const isZhCN = lang === 'cn';
const col1 = {
title: <FormattedMessage id="app.footer.resources" />,
Function InternalTable
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
const InternalTable = <RecordType extends AnyObject = AnyObject>(
props: InternalTableProps<RecordType>,
ref: React.MutableRefObject<HTMLDivElement>,
) => {
const {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File index.test.tsx
has 641 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import type { SingleValueType } from 'rc-cascader/lib/Cascader';
import type { BaseOptionType, DefaultOptionType } from '..';
import Cascader from '..';
Function transformColumns
has 279 lines of code (exceeds 25 allowed). Consider refactoring. Open
(columns: ColumnsType<RecordType>): ColumnsType<RecordType> => {
// >>>>>>>>>>> Skip if not exists `rowSelection`
if (!rowSelection) {
warning(
!columns.includes(SELECTION_COLUMN),
Function FilterDropdown
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
const {
tablePrefixCls,
prefixCls,
column,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function TransferList
has 272 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TransferList = <RecordType extends KeyWiseTransferItem>(
props: TransferListProps<RecordType>,
) => {
const {
prefixCls,
Function useSelection
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
const useSelection = <RecordType extends AnyObject = AnyObject>(
config: UseSelectionConfig<RecordType>,
rowSelection?: TableRowSelection<RecordType>,
): readonly [TransformColumns<RecordType>, Set<Key>] => {
const {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File useSelection.tsx
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from 'react';
import { useCallback, useMemo } from 'react';
import DownOutlined from '@ant-design/icons/DownOutlined';
import classNames from 'classnames';
import { INTERNAL_COL_DEFINE } from 'rc-table';
Function genInputNumberStyles
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumberToken) => {
const {
componentCls,
lineWidth,
lineType,
Function InternalFormItem
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InternalFormItem<Values = any>(props: FormItemProps<Values>): React.ReactElement {
const {
name,
noStyle,
className,
Function genBaseStyle
has 250 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => {
const { treeCls, treeNodeCls, treeNodePadding, titleHeight, nodeSelectedBg, nodeHoverBg } = token;
const treeCheckBoxMarginHorizontal = token.paddingXS;
return {
File panel.ts
has 583 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { unit } from '@ant-design/cssinjs';
import type { CSSObject } from '@ant-design/cssinjs';
import { TinyColor } from '@ctrl/tinycolor';
import type { GenerateStyle } from '../../theme/internal';
Function Theme
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Theme: React.FC = () => {
const { styles } = useStyle();
const [locale, lang] = useLocale(locales);
const isZhCN = lang === 'cn';
const { search } = useLocation();