Showing 500 of 500 total issues
File field-converting.e2e-spec.ts
has 2676 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import type { INestApplication } from '@nestjs/common';
import type {
IFieldRo,
IFieldVo,
File link-api.e2e-spec.ts
has 2226 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/cognitive-complexity */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable sonarjs/no-duplicate-string */
File Query.ts
has 1466 lines of code (exceeds 300 allowed). Consider refactoring. Open
// Generated from src/query/parser/Query.g4 by ANTLR 4.9.0-SNAPSHOT
import { ATN } from 'antlr4ts/atn/ATN';
import { ATNDeserializer } from 'antlr4ts/atn/ATNDeserializer';
import { ParserATNSimulator } from 'antlr4ts/atn/ParserATNSimulator';
File layoutRenderer.ts
has 1453 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { contractColorForTheme } from '@teable/core';
import { isEqual, groupBy, cloneDeep } from 'lodash';
import { GRID_DEFAULT, ROW_RELATED_REGIONS } from '../../configs';
import type { IVisibleRegion } from '../../hooks';
import { getDropTargetIndex } from '../../hooks';
File field-supplement.service.ts
has 1063 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import { BadRequestException, Injectable } from '@nestjs/common';
import type {
IFieldRo,
IFieldVo,
File Formula.ts
has 1043 lines of code (exceeds 300 allowed). Consider refactoring. Open
// Generated from src/formula/parser/Formula.g4 by ANTLR 4.9.0-SNAPSHOT
import { ATN } from "antlr4ts/atn/ATN";
import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer";
File link.service.ts
has 997 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable } from '@nestjs/common';
import type { ILinkCellValue, ILinkFieldOptions } from '@teable/core';
import { FieldType, Relationship } from '@teable/core';
import type { Field } from '@teable/db-main-prisma';
import { PrismaService } from '@teable/db-main-prisma';
Function InteractionLayerBase
has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const {
theme,
width,
height,
- 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 expr
has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring. Open
public expr(_p?: number): ExprContext {
if (_p === undefined) {
_p = 0;
}
- 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 reference.service.ts
has 969 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable, Logger } from '@nestjs/common';
import type {
IFieldVo,
ILinkCellValue,
ILinkFieldOptions,
File constants.ts
has 966 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string, @typescript-eslint/naming-convention */
import { FormulaFuncType, FunctionName, FUNCTIONS, FormulaLexer } from '@teable/core';
import { Hash, A, CheckSquare, Calendar } from '@teable/icons';
import type { IFunctionMap, IFunctionSchema } from './interface';
Function GridViewBase
has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring. Open
export const GridViewBase: React.FC<IGridViewProps> = (props: IGridViewProps) => {
const { onRowExpand } = props;
const { t } = useTranslation(tableConfig.i18nNamespaces);
const router = useRouter();
const gridRef = useRef<IGridRef>(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
File selection.service.spec.ts
has 909 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
import { faker } from '@faker-js/faker';
import type { TestingModule } from '@nestjs/testing';
import { Test } from '@nestjs/testing';
import type { IFieldOptionsVo, IFieldVo, IRecord } from '@teable/core';
File record.service.ts
has 870 lines of code (exceeds 300 allowed). Consider refactoring. Open
import {
BadRequestException,
Injectable,
InternalServerErrorException,
Logger,
File field-converting.service.ts
has 865 lines of code (exceeds 300 allowed). Consider refactoring. Open
import {
BadRequestException,
Injectable,
InternalServerErrorException,
Logger,
Function createCellValue2GridDisplay
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
(fields: IFieldInstance[], editable: (field: IFieldInstance) => boolean) =>
// eslint-disable-next-line sonarjs/cognitive-complexity
(record: Record, col: number): ICell => {
const field = fields[col];
- 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 generateGroupCellFn
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
(fields: IFieldInstance[]) =>
// eslint-disable-next-line sonarjs/cognitive-complexity
(cellValue: unknown, depth: number): ICell => {
const field = fields[depth];
- 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 InteractionLayerBase
has 619 lines of code (exceeds 300 allowed). Consider refactoring. Open
> = (props, ref) => {
const {
theme,
width,
height,
File InteractionLayer.tsx
has 712 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';
Function GridViewBase
has 563 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const GridViewBase: React.FC<IGridViewProps> = (props: IGridViewProps) => {
const { onRowExpand } = props;
const { t } = useTranslation(tableConfig.i18nNamespaces);
const router = useRouter();
const gridRef = useRef<IGridRef>(null);