Showing 671 of 671 total issues
Function TextEditorBase
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const { cell, rect, style, theme, isEditing, onChange } = props;
const { cellLineColorActived } = theme;
const { width, height } = rect;
const { displayData, type } = cell;
- 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 getViewProjection
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private async getViewProjection(
tableId: string,
query: IGetRecordsRo
): Promise<Record<string, boolean> | undefined> {
const viewId = query.viewId;
- 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 processMultilineSyntax
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
async processMultilineSyntax(
input: string,
callBack: (result: unknown) => void = () => {}
): Promise<void> {
if (this.processing) {
- 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 event-emitter.service.ts
has 338 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { Injectable, Logger } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import type { ICreateOpBuilder, IOpBuilder, IOpContextBase, IOtOperation } from '@teable/core';
import {
FieldOpBuilder,
File user.service.ts
has 336 lines of code (exceeds 300 allowed). Consider refactoring. Open
import https from 'https';
import { join } from 'path';
import { BadRequestException, Injectable } from '@nestjs/common';
import {
generateAccountId,
Function expr
has 346 lines of code (exceeds 300 allowed). Consider refactoring. Open
public expr(_p?: number): ExprContext {
if (_p === undefined) {
_p = 0;
}
File table.service.ts
has 335 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable, Logger, NotFoundException } from '@nestjs/common';
import type { IOtOperation, ISnapshotBase } from '@teable/core';
import {
generateTableId,
getRandomString,
Query
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
export class Query extends Parser {
public static readonly COMMA = 1;
public static readonly OPEN_PAREN = 2;
public static readonly CLOSE_PAREN = 3;
public static readonly OPEN_BRACKET = 4;
ViewOpenApiController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Controller('api/table/:tableId/view')
export class ViewOpenApiController {
constructor(
private readonly viewService: ViewService,
private readonly viewOpenApiService: ViewOpenApiService
BaseController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Controller('api/base/')
export class BaseController {
constructor(
private readonly baseService: BaseService,
private readonly dbConnectionService: DbConnectionService,
File formula.field.spec.ts
has 332 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { plainToInstance } from 'class-transformer';
import { Colors } from '../colors';
import { DbFieldType, FieldType, CellValueType } from '../constant';
import { DateFormattingPreset, NumberFormattingType, TimeFormatting } from '../formatting';
import {
File record-calculate.service.ts
has 332 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import type { IMakeOptional, IUserFieldOptions } from '@teable/core';
import { FieldKeyType, generateRecordId, FieldType } from '@teable/core';
import { PrismaService } from '@teable/db-main-prisma';
import type { ICreateRecordsRo, ICreateRecordsVo, IRecord } from '@teable/openapi';
Function useAutoScroll
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const useAutoScroll = (props: IUseAutoScroll) => {
const { coordInstance, isSelecting, dragType, isDragging, scrollBy } = props;
const speedScalar = useRef(0);
const { containerWidth, containerHeight, freezeRegionWidth, rowInitSize } = coordInstance;
const [scrollDirection, setScrollDirection] = useState<
- 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 CommentQuote
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const CommentQuote = (props: ICommentQuoteProps) => {
const { className, quoteId, onClose } = props;
const tableId = useTableId();
const recordId = useRecordId();
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 formatTarget
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const formatTarget = function (targetStr) {
const language = targetStr.split('_')[0];
const title = capitalizeFirstLetter(language);
let library = targetStr.split('_')[1];
if (!library) {
- 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 FilePreviewProvider
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const FilePreviewProvider = (props: IFilePreviewProvider) => {
const { children, container, i18nMap } = props;
const [current, setCurrent] = useState<number | string>();
const [files, setFiles] = useState<IFileItemInner[]>([]);
- 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 SelectEditorBase
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const { cell, isEditing, style, onChange, setEditing, theme } = props;
const { data, isMultiple, choiceSorted = [], choiceMap = {} } = cell;
const [values, setValues] = useState(data);
const inputRef = useRef<HTMLInputElement | null>(null);
- 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 useGridPrefillingRow
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const useGridPrefillingRow = (columns: (IGridColumn & { id: string })[]) => {
const fields = useFields();
const fieldEditable = useFieldCellEditable();
const [prefillingRowOrder, setPrefillingRowOrder] = useState<IUpdateOrderRo>();
- 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 getFilterBySelectTypeChanges
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
getFilterBySelectTypeChanges(
originData: IFilterSet,
fieldId: string,
updateNameOptions: { id?: string; oldName: string; newName: string }[],
deleteOptions: ISelectFieldOptions['choices']
- 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 createAISyntaxParser
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function createAISyntaxParser() {
let baseId: string | undefined;
let tableId: string | undefined;
let viewId: string | undefined;
- 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"