Showing 1,102 of 3,485 total issues
File InternalTable.tsx
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from 'react';
import classNames from 'classnames';
import { INTERNAL_HOOKS } from 'rc-table';
import type { Reference as RcReference, TableProps as RcTableProps } from 'rc-table';
import { convertChildrenToColumns } from 'rc-table/lib/hooks/useColumns';
Function getThemeStyle
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getThemeStyle = (token: MenuToken, themeSuffix: string): CSSInterpolation => {
const {
componentCls,
itemColor,
itemSelectedColor,
Function Transfer
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
const Transfer = <RecordType extends TransferItem = TransferItem>(
props: TransferProps<RecordType>,
) => {
const {
dataSource,
- 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 Anchor
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
const Anchor: React.FC<AnchorProps> = (props) => {
const {
rootClassName,
prefixCls: customPrefixCls,
className,
- 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 generateCalendar
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
function generateCalendar<DateType extends AnyObject>(generateConfig: GenerateConfig<DateType>) {
function isSameYear(date1: DateType, date2: DateType) {
return date1 && date2 && generateConfig.getYear(date1) === generateConfig.getYear(date2);
}
- 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 direction.tsx
has 502 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import {
DownloadOutlined,
LeftOutlined,
MinusOutlined,
Function genBaseStyle
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
const genBaseStyle: GenerateStyle<SliderToken> = (token) => {
const {
componentCls,
antCls,
controlSize,
Function genSpinStyle
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
const genSpinStyle: GenerateStyle<SpinToken> = (token: SpinToken): CSSObject => {
const { componentCls, calc } = token;
return {
[`${componentCls}`]: {
...resetComponent(token),
Function genMentionsStyle
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
const genMentionsStyle: GenerateStyle<MentionsToken> = (token) => {
const {
componentCls,
colorTextDisabled,
controlItemBgHover,
File FilterDropdown.tsx
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from 'react';
import FilterFilled from '@ant-design/icons/FilterFilled';
import classNames from 'classnames';
import type { FieldDataNode } from 'rc-tree';
import isEqual from 'rc-util/lib/isEqual';
Function InternalUpload
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
const InternalUpload: React.ForwardRefRenderFunction<UploadRef, UploadProps> = (props, ref) => {
const {
fileList,
defaultFileList,
onRemove,
- 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 genPositionStyle
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
const genPositionStyle: GenerateStyle<TabsToken> = (token: TabsToken): CSSObject => {
const {
componentCls,
margin,
colorBorderSecondary,
Function Watermark
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Watermark: React.FC<WatermarkProps> = (props) => {
const {
/**
* The antd content layer zIndex is basically below 10
* https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335
Function InternalUploadList
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InternalUploadList: React.ForwardRefRenderFunction<UploadListRef, UploadListProps> = (
props,
ref,
) => {
const {
Function App
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
const App: React.FC = () => {
const [showModal, setShowModal] = useState(false);
const [showDrawer, setShowDrawer] = useState(false);
return (
<Space direction="vertical">
File index.test.tsx
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import { createPortal } from 'react-dom';
// eslint-disable-next-line import/no-unresolved
import type { InputProps, InputRef } from '..';
Function getRadioButtonStyle
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getRadioButtonStyle: GenerateStyle<RadioToken> = (token) => {
const {
buttonColor,
controlHeight,
componentCls,
Function genBaseStyle
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
const genBaseStyle: GenerateStyle<TourToken> = (token) => {
const {
componentCls,
lineHeight,
padding,
Function Dropdown
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Dropdown: CompoundedComponent = (props) => {
const {
menu,
arrow,
prefixCls: customizePrefixCls,
Function printLog
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function printLog() {
const tags = await git.tags();
const { fromVersion } = await inquirer.prompt([
{
type: 'list',