Showing 671 of 671 total issues
Function ProcessBar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ onClick, done, type, parsedResult }) => {
const [ref, { width, height }] = useMeasure<HTMLDivElement>();
const [taskDone, setTaskDone] = React.useState(false);
const isGenerateChart = type === 'chart';
- 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 NotificationList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const NotificationList: React.FC<NotificationListProps> = (props) => {
const { notifyStatus, data, className, hasNextPage, isFetchingNextPage, onShowMoreClick } = props;
const { t } = useTranslation('common');
const queryClient = useQueryClient();
const dayjs = useLanDayjs();
- 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 DraggableBaseGrid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const DraggableBaseGrid = (props: IDraggableBaseGridProps) => {
const { bases } = props;
const queryClient = useQueryClient();
const isHydrated = useIsHydrated();
const [innerBases, setInnerBases] = useState<IGetBaseAllVo>([]);
- 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 PinItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const PinItem = (props: IPinItemProps) => {
const { className, pin, baseMap, spaceMap, right } = props;
const router = useRouter();
switch (pin.type) {
- 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 UsageLimitModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const UsageLimitModal = () => {
const base = useBase();
const router = useRouter();
const { t } = useTranslation('common');
const { modalType, modalOpen, toggleModal } = useUsageLimitModalStore();
- 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 MessageInput
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const MessageInput: React.FC<Props> = ({ disabled, sendMessage, chat }) => {
const [value, setValue] = useState<string>('');
const [isInIME, setIsInIME] = useState(false);
const textareaRef = useRef<HTMLTextAreaElement>(null);
const messageStore = useMessageStore();
- 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 MultiNumberShowAs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const MultiNumberShowAs: React.FC<IMultiNumberShowAsProps> = (props) => {
const { showAs, onChange } = props;
const { type, color } = (showAs || {}) as IMultiNumberShowAs;
const selectedType = showAs == null ? numberFlag : type;
const { t } = useTranslation(tableConfig.i18nNamespaces);
- 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
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return (
<CellSelect
value={value as ISingleSelectCellValue | IMultipleSelectCellValue}
options={transformSelectOptions(options.choices)}
className={className}
Avoid too many return
statements within this function. Open
return <CellCheckbox value={value as boolean | boolean[]} className={className} />;
Avoid too many return
statements within this function. Open
return { ...BLANK_REGION_DATA, type: RegionType.RowHeader };
Avoid too many return
statements within this function. Open
return {
success: true,
data: { accessToken: token.data.accessToken },
};
Avoid too many return
statements within this function. Open
return <Spin />;
Avoid too many return
statements within this function. Open
return <CellCheckbox value={value as boolean | boolean[]} className={className} />;
Avoid too many return
statements within this function. Open
return (
<CellNumber
value={value as number}
formatting={options.formatting as INumberFormatting}
className={className}
Avoid too many return
statements within this function. Open
return Response.json({ error: `getToken: ${res.error}` }, { status: 401 });
Avoid too many return
statements within this function. Open
return onChange?.(isMultiple && cv ? [...cv, ...newValues] : newValues);
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return <CellText value={value as string} className={className} />;