Showing 671 of 671 total issues
Function SpaceTrashPage
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const SpaceTrashPage = () => {
const router = useRouter();
const isHydrated = useIsHydrated();
const queryClient = useQueryClient();
const { t } = useTranslation(spaceConfig.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
Function FieldEditor
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const FieldEditor = (props: {
isPrimary?: boolean;
field: Partial<IFieldEditorRo>;
operator: FieldOperator;
onChange?: (field: IFieldEditorRo) => void;
- 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 trash.service.ts
has 330 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import {
BadRequestException,
ForbiddenException,
Injectable,
File QueryBuilder.tsx
has 329 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { X } from '@teable/icons';
import { BaseQueryColumnType, getFields } from '@teable/openapi';
import type {
IBaseQueryColumn,
IBaseQuery,
Function SelectEditorMainBase
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const {
value: originValue,
options = [],
isMultiple,
- 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 checkRegion
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
checkRegion: (cell: ISelectCell, props: ICellClickProps, shouldCalculate?: boolean) => {
const { data, displayData, readonly } = cell;
const { width, isActive, hoverCellPosition, activeCellBound } = props;
const editable = !readonly && isActive && activeCellBound;
if (!editable) return { type: CellRegionType.Blank };
- 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 FieldCreateOrSelectModal
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
>((props, forwardRef) => {
const {
title,
description,
content,
- 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 updateLookupField
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private updateLookupField(field: IFieldInstance, fieldMap: IFieldMap): IOtOperation[] {
const ops: (IOtOperation | undefined)[] = [];
const lookupOptions = field.lookupOptions as ILookupOptionsVo;
const linkField = fieldMap[lookupOptions.linkFieldId] as LinkFieldDto;
const lookupField = fieldMap[lookupOptions.lookupFieldId];
- 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 groupDbCollection2GroupPoints
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
@Timing()
// eslint-disable-next-line sonarjs/cognitive-complexity
private async groupDbCollection2GroupPoints(
groupResult: { [key: string]: unknown; __c: number }[],
groupFields: IFieldInstance[],
- 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 Guide
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const Guide = ({ user }: { user?: IUserMeVo }) => {
const router = useRouter();
const { t } = useTranslation(tableConfig.i18nNamespaces);
const { completedGuideMap, setCompletedGuideMap } = useCompletedGuideMapStore();
- 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 base.e2e-spec.ts
has 323 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { INestApplication } from '@nestjs/common';
import { Role } from '@teable/core';
import type {
ICreateBaseVo,
ICreateSpaceVo,
EventEmitterService
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class EventEmitterService {
private readonly logger = new Logger(EventEmitterService.name);
private readonly eventNameMapping = {
File visitor.ts
has 319 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
import { CellValueType } from '../models/field/constant';
import type { FieldCore } from '../models/field/field';
Function Reaction
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const Reaction = (props: ICommentReactionProps) => {
const { value, commentId } = props;
const tableId = useTableId();
const recordId = useRecordId();
const { user: sessionUser } = useSession();
- 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 BaseFieldValue
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function BaseFieldValue(props: IBaseFieldValue) {
const { onSelect, components, field, operator, value, linkContext } = props;
const { t } = useTranslation();
const showEmptyComponent = useMemo(() => {
- 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 replaceFieldIdsWithNames
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function replaceFieldIdsWithNames(obj: any, fieldMap: { [fieldId: string]: { name: string } }) {
if (typeof obj === 'object' && obj !== null) {
for (const key in obj) {
// eslint-disable-next-line no-prototype-builtins
if (obj.hasOwnProperty(key)) {
- 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 updateLinkRecord
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private async updateLinkRecord(
tableId: string,
fkRecordMap: IFkRecordMap,
fieldMapByTableId: { [tableId: string]: IFieldMap },
originRecordMapByTableId: IRecordMapByTableId
- 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 SignForm
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const SignForm: FC<ISignForm> = (props) => {
const { className, type = 'signin', onSuccess } = props;
const { t } = useTranslation(authConfig.i18nNamespaces);
const [isLoading, setIsLoading] = useState<boolean>(false);
- 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 chart.tsx
has 317 lines of code (exceeds 300 allowed). Consider refactoring. Open
'use client';
import * as React from 'react';
import * as RechartsPrimitive from 'recharts';
File table-export.e2e-spec.ts
has 317 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import fs from 'fs';
import path from 'path';
import type { INestApplication } from '@nestjs/common';
import type { IFieldVo, IViewRo } from '@teable/core';