Showing 671 of 671 total issues
RecordService
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class RecordService {
private logger = new Logger(RecordService.name);
constructor(
File field.service.ts
has 508 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import type {
IFieldVo,
IGetFieldsQuery,
ISnapshotBase,
File lookup.e2e-spec.ts
has 508 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { INestApplication } from '@nestjs/common';
import type {
File record-open-api.service.ts
has 505 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import type { IAttachmentCellValue, IAttachmentItem, IMakeOptional } from '@teable/core';
import { FieldKeyType, FieldType } from '@teable/core';
import { PrismaService } from '@teable/db-main-prisma';
import { UploadType } from '@teable/openapi';
File numeric.spec.ts
has 503 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import { CellValueType } from '../../models/field/constant';
import { TypedValue } from '../typed-value';
import {
Abs,
File comment-open-api.service.ts
has 502 lines of code (exceeds 300 allowed). Consider refactoring. Open
import {
Injectable,
Logger,
ForbiddenException,
BadGatewayException,
File aggregation.e2e-spec.ts
has 502 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { INestApplication } from '@nestjs/common';
import type { IGroup } from '@teable/core';
import { is, SortFunc, StatisticsFunc } from '@teable/core';
import type { IGroupHeaderPoint, ITableFullVo } from '@teable/openapi';
import { getAggregation, getGroupPoints, getRowCount, GroupPointType } from '@teable/openapi';
File aggregation.service.ts
has 498 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { Injectable, Logger } from '@nestjs/common';
import type { IGridColumnMeta, IFilter, IGroup } from '@teable/core';
import { mergeWithDefaultFilter, nullsToUndefined, StatisticsFunc, ViewType } from '@teable/core';
import type { Prisma } from '@teable/db-main-prisma';
import { PrismaService } from '@teable/db-main-prisma';
Function drawMultiLineText
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export const drawMultiLineText = (ctx: CanvasRenderingContext2D, props: IMultiLineTextProps) => {
const {
x = 0,
y = 0,
text,
- 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 getHeadersArray
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
const getHeadersArray = function (openApi, path, method) {
const headers = [];
const pathObj = openApi.paths[path][method];
// 'accept' header:
- 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 FormulaLexer.ts
has 477 lines of code (exceeds 300 allowed). Consider refactoring. Open
// Generated from src/formula/parser/FormulaLexer.g4 by ANTLR 4.9.0-SNAPSHOT
import { ATN } from "antlr4ts/atn/ATN";
import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer";
File rollup.e2e-spec.ts
has 472 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { INestApplication } from '@nestjs/common';
import type { IFieldRo, IFieldVo, ILookupOptionsRo, IRecord, LinkFieldCore } from '@teable/core';
File openapi-to-har.js
has 470 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable */
/**
* Translates given OpenAPI document to an array of HTTP Archive (HAR) 1.2 Request Object.
* See more:
* - http://swagger.io/specification/
FieldConvertingService
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class FieldConvertingService {
private readonly logger = new Logger(FieldConvertingService.name);
constructor(
File time-zone.ts
has 455 lines of code (exceeds 300 allowed). Consider refactoring. Open
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import { z } from '../../../zod';
dayjs.extend(utc);
File text.spec.ts
has 447 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import { CellValueType } from '../../models/field/constant';
import { TypedValue } from '../typed-value';
import {
Concatenate,
Function PreviewPanel
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const PreviewPanel = (props: IPreviewPanel) => {
const { shareId, baseId, workBookData, ...restProps } = props;
const isHydrated = useIsHydrated();
const view = useView();
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 drawColumnStatistics
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const drawColumnStatistics = (
ctx: CanvasRenderingContext2D,
props: ILayoutDrawerProps,
renderRegion: RenderRegion
// eslint-disable-next-line sonarjs/cognitive-complexity
- 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 RecordHistory
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const RecordHistory = (props: IRecordHistoryProps) => {
const { recordId, onRecordClick } = props;
const tableId = useTableId() as string;
const { t } = useTranslation();
const isHydrated = useIsHydrated();
- 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 createTablePrompt.bak.ts
has 441 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const CREATE_TABLE_PROMPT = `
openapi: 3.0.0
info:
title: Teable App
description: Manage Data as easy as drink a cup of tea