Showing 1,102 of 3,485 total issues
Function genDrawerStyle
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
const {
borderRadiusSM,
componentCls,
zIndexPopup,
Function Slider
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Slider = React.forwardRef<SliderRef, SliderSingleProps | SliderRangeProps>((props, ref) => {
const {
prefixCls: customizePrefixCls,
range,
className,
Function App
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const App: React.FC = () => {
const [form] = Form.useForm();
const onFinish = (values: any) => {
console.log('Received values of form: ', values);
File index.test.tsx
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import React from 'react';
File index.ts
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { unit } from '@ant-design/cssinjs';
import { genFocusOutline, resetComponent } from '../../style';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
Function List
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
Open
function List<T>({
pagination = false as ListProps<T>['pagination'],
prefixCls: customizePrefixCls,
bordered = false,
split = true,
- 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 genTimelineStyle
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const genTimelineStyle: GenerateStyle<TimelineToken, CSSObject> = (token) => {
const { componentCls, calc } = token;
return {
[componentCls]: {
Function InternalBadge
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InternalBadge = React.forwardRef<HTMLSpanElement, BadgeProps>((props, ref) => {
const {
prefixCls: customizePrefixCls,
scrollNumberPrefixCls: customizeScrollNumberPrefixCls,
children,
Function genCheckboxStyle
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const genCheckboxStyle: GenerateStyle<CheckboxToken> = (token) => {
const { checkboxCls } = token;
const wrapperCls = `${checkboxCls}-wrapper`;
return [
Function Affix
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Affix = React.forwardRef<AffixRef, AffixProps>((props, ref) => {
const {
style,
offsetTop,
offsetBottom,
Function InternalSelect
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InternalSelect = <
ValueType = any,
OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType,
>(
props: SelectProps<ValueType, OptionType>,
File index.ts
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import { genFocusStyle } from '../../style';
import type { GenerateStyle } from '../../theme/internal';
Function InternalTooltip
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InternalTooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref) => {
const {
prefixCls: customizePrefixCls,
openClassName,
getTooltipContainer,
Function App
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const App: React.FC = () => {
const [bordered, setBordered] = useState(false);
const [loading, setLoading] = useState(false);
const [size, setSize] = useState<SizeType>('large');
const [expandable, setExpandable] = useState<ExpandableConfig<DataType> | undefined>(
File Table.test.tsx
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useRef } from 'react';
import { ConfigProvider } from 'antd';
import type { TableProps, TableRef } from '..';
import Table from '..';
Function genTransferListStyle
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const genTransferListStyle: GenerateStyle<TransferToken> = (token: TransferToken): CSSObject => {
const {
componentCls,
colorBorder,
colorSplit,
File components.test.tsx
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import ConfigProvider from '..';
Function genFormItemStyle
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const genFormItemStyle: GenerateStyle<FormToken> = (token) => {
const {
formItemCls,
iconCls,
componentCls,
Function ColorPicker
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ColorPicker: CompoundedComponent = (props) => {
const {
value,
defaultValue,
format,
File textarea.test.tsx
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { ChangeEventHandler, TextareaHTMLAttributes } from 'react';
import React, { useState } from 'react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import Input from '..';