Showing 671 of 671 total issues
File base-query.e2e-spec.ts
has 758 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable sonarjs/no-duplicate-string */
import type { INestApplication } from '@nestjs/common';
import {
Colors,
File InteractionLayer.tsx
has 740 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
import { isEqual } from 'lodash';
import type { Dispatch, ForwardRefRenderFunction, SetStateAction } from 'react';
import { useState, useRef, forwardRef, useImperativeHandle, useMemo, useLayoutEffect } from 'react';
import { useClickAway, useMouse } from 'react-use';
File selection.service.ts
has 723 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable } from '@nestjs/common';
import type {
IDateFieldOptions,
IFieldOptionsRo,
IFieldOptionsVo,
File field.e2e-spec.ts
has 606 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { INestApplication } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import type {
IFieldRo,
IFieldVo,
File numeric.ts
has 584 lines of code (exceeds 300 allowed). Consider refactoring. Open
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import { CellValueType } from '../../models/field/constant';
File date-time.ts
has 579 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { ManipulateType, UnitType } from 'dayjs';
import dayjs, { isDayjs } from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import isBetween from 'dayjs/plugin/isBetween';
import relativeTime from 'dayjs/plugin/relativeTime';
File view.service.ts
has 576 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable } from '@nestjs/common';
import type {
ISnapshotBase,
IViewRo,
IViewVo,
File baseRenderer.ts
has 569 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { LRUCache } from 'lru-cache';
import { parseToRGB } from '../../utils';
import type {
ILineProps,
IMultiLineTextProps,
Function FormulaEditor
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
export const FormulaEditor: FC<IFormulaEditorProps> = (props) => {
const { expression, onConfirm } = props;
const fields = useFields({ withHidden: true, withDenied: true });
const { resolvedTheme } = useTheme();
const { t } = useTranslation();
- 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 parse
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
function parse(raw: string, preferences: string[] | undefined, options: IOptions) {
const lowers = new Map<string, { orig: string; pos: number }>();
const header = raw.replace(/[ \t]/g, '');
if (preferences) {
- 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 KanbanContainer
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
export const KanbanContainer = () => {
const tableId = useTableId();
const viewId = useViewId();
const { collapsedStackMap } = useKanbanStackCollapsedStore();
const { permission, stackField, stackCollection } = useKanban() as Required<IKanbanContext>;
- 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 LinkListBase
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
const LinkListBase: ForwardRefRenderFunction<ILinkListRef, ILinkListProps> = (
props,
forwardRef
) => {
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 json.visitor.spec.ts
has 547 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
import { parseTQL } from './json.visitor';
describe('JsonVisitor', () => {
const mockFilterData = (value: any = null, operator = '=') => {
Function calcCells
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
export const calcCells = (props: ILayoutDrawerProps, renderRegion: RenderRegion) => {
const {
coordInstance,
visibleRegion,
activeCell,
- 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 InfiniteScrollerBase
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
const InfiniteScrollerBase: ForwardRefRenderFunction<ScrollerRef, ScrollerProps> = (props, ref) => {
const {
coordInstance,
containerWidth,
containerHeight,
- 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 FieldMenu
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
export const FieldMenu = () => {
const isTouchDevice = useIsTouchDevice();
const view = useView() as GridView | undefined;
const { filter, sort, group } = view || {};
const tableId = useTableId();
- 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
FieldSupplementService
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class FieldSupplementService {
constructor(
private readonly fieldService: FieldService,
private readonly prismaService: PrismaService,
File use-grid-columns.tsx
has 512 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { IAttachmentCellValue, INumberShowAs, ISingleLineTextShowAs } from '@teable/core';
import { RowHeightLevel, CellValueType, ColorUtils, FieldType } from '@teable/core';
import { useTheme } from '@teable/next-themes';
import { keyBy } from 'lodash';
import { LRUCache } from 'lru-cache';
Function parseClipboardText
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
export const parseClipboardText = (content: string) => {
const _newline = content.includes(windowsNewline) ? windowsNewline : newline;
if (!content.includes('"')) {
return content.split(_newline).map((row) => row.split(delimiter));
}
- 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 useSelectionOperation
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
export const useSelectionOperation = (props?: {
collapsedGroupIds?: string[];
copyReq?: UseMutateAsyncFunction<AxiosResponse<ICopyVo>, unknown, IRangesRo, unknown>;
}) => {
const { collapsedGroupIds, copyReq } = props || {};
- 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"