Showing 671 of 671 total issues
File selection.e2e-spec.ts
has 438 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,
Function TableImport
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export const TableImport = (props: ITableImportProps) => {
const base = useBase();
const router = useRouter();
const { t } = useTranslation(['table']);
const [step, setStep] = useState(Step.UPLOAD);
- 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 FormEditor
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export const FormEditor = () => {
const view = useView();
const isHydrated = useIsHydrated();
const visibleFields = useFields();
const allFields = useFields({ withHidden: true, withDenied: 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
File field-open-api.service.ts
has 417 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable, Logger, NotFoundException } from '@nestjs/common';
import { FieldKeyType, FieldOpBuilder, FieldType, IFieldRo } from '@teable/core';
import type {
IFieldVo,
IConvertFieldRo,
Function KanbanProvider
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
export const KanbanProvider = ({ children }: { children: ReactNode }) => {
const tableId = useTableId();
const view = useView() as KanbanView | undefined;
const baseId = useBaseId() as string;
const { shareId } = useContext(ShareViewContext) ?? {};
- 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 oauth-server.e2e-spec.ts
has 413 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable sonarjs/no-duplicate-string */
import type { INestApplication } from '@nestjs/common';
import { HttpError } from '@teable/core';
import {
File init-app.ts
has 411 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import { ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { WsAdapter } from '@nestjs/platform-ws';
import type { TestingModule } from '@nestjs/testing';
Function createHarParameterObjects
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const createHarParameterObjects = function ({ name, in: location, style, explode }, value) {
if (!name || !location || typeof value === 'undefined') {
throw 'Required parameters missing';
}
- 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
ReferenceService
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class ReferenceService {
private readonly logger = new Logger(ReferenceService.name);
constructor(
Function useDrag
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const useDrag = (
coordInstance: CoordinateManager,
scrollState: IScrollState,
selection: CombinedSelection,
draggable?: DraggableType
- 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 RollupOptions
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const RollupOptions = (props: {
options: Partial<IRollupFieldOptions> | undefined;
cellValueType?: CellValueType;
isMultipleCellValue?: boolean;
isLookup?: boolean;
- 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 Editor.tsx
has 399 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 { closeBracketsKeymap } from '@codemirror/autocomplete';
import { defaultKeymap, historyKeymap } from '@codemirror/commands';
import type { EditorSelection } from '@codemirror/state';
import { keymap } from '@codemirror/view';
File QueryLexer.ts
has 394 lines of code (exceeds 300 allowed). Consider refactoring. Open
// Generated from src/query/parser/QueryLexer.g4 by ANTLR 4.9.0-SNAPSHOT
import type { ATN } from 'antlr4ts/atn/ATN';
import { ATNDeserializer } from 'antlr4ts/atn/ATNDeserializer';
import { LexerATNSimulator } from 'antlr4ts/atn/LexerATNSimulator';
Function FormEditorMain
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export const FormEditorMain = (props: { fields: IFieldInstance[] }) => {
const { fields } = props;
const view = useView() as FormView | undefined;
const isHydrated = useIsHydrated();
const { openSetting } = useFieldSettingStore();
- 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 region.ts
has 393 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/naming-convention */
import { GRID_DEFAULT } from '../configs';
import { LinearRowType, RegionType, RowControlType } from '../interface';
import type {
IActiveCellBound,
ViewService
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class ViewService implements IReadonlyAdapterService {
constructor(
private readonly cls: ClsService<IClsStore>,
private readonly batchService: BatchService,
File oauth-server.service.spec.ts
has 387 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable sonarjs/no-duplicate-string */
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import type { TestingModule } from '@nestjs/testing';
File base-duplicate.service.ts
has 387 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { Injectable, Logger, NotFoundException } from '@nestjs/common';
import type { ILinkFieldOptions } from '@teable/core';
import {
FieldType,
generateBaseId,
File oauth-server.service.ts
has 387 lines of code (exceeds 300 allowed). Consider refactoring. Open
import {
BadRequestException,
HttpException,
Injectable,
NotFoundException,
Function drawRowHeader
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const drawRowHeader = (ctx: CanvasRenderingContext2D, props: IRowHeaderDrawerProps) => {
const {
x,
y,
width,
- 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"