Showing 671 of 671 total issues
Function ExpandRecord
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export const ExpandRecord = (props: IExpandRecordProps) => {
const {
model,
visible,
recordId,
- 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 view.e2e-spec.ts
has 360 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import type { INestApplication } from '@nestjs/common';
import type { IColumn, IFieldRo, IFieldVo, IViewRo } from '@teable/core';
import { FieldKeyType, FieldType, Relationship, ViewType } from '@teable/core';
import type { ICreateTableRo, ITableFullVo } from '@teable/openapi';
Function genColumns
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
async genColumns() {
const supportTypes = Importer.SUPPORTEDTYPE;
const parseResult = await this.parse();
const { fileName, type } = this.config;
const result: IAnalyzeVo['worksheets'] = {};
- 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 FormulaEditor
has 360 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const FormulaEditor: FC<IFormulaEditorProps> = (props) => {
const { expression, onConfirm } = props;
const fields = useFields({ withHidden: true, withDenied: true });
const { resolvedTheme } = useTheme();
const { t } = useTranslation();
CoordinateManager
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
export class CoordinateManager implements ICoordinate {
protected defaultRowHeight: number;
protected defaultColumnWidth: number;
public pureRowCount: number;
public rowCount: number;
SelectionService
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class SelectionService {
constructor(
private readonly recordService: RecordService,
private readonly fieldService: FieldService,
File base.service.ts
has 355 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { ForbiddenException, Injectable, Logger, NotFoundException } from '@nestjs/common';
import type { IRole } from '@teable/core';
import { ActionPrefix, actionPrefixMap, generateBaseId, isUnrestrictedRole } from '@teable/core';
import { PrismaService } from '@teable/db-main-prisma';
import { CollaboratorType, ResourceType } from '@teable/openapi';
Function FormulaOptionsInner
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export const FormulaOptionsInner = (props: {
options: Partial<IFormulaFieldOptions> | undefined;
onChange?: (options: Partial<IFormulaFieldOptions>) => void;
}) => {
const { options = {}, onChange } = props;
- 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.schema.ts
has 349 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { RefinementCtx } from 'zod';
import { assertNever } from '../../asserts';
import type { IEnsureKeysMatchInterface } from '../../types';
import { IdPrefix } from '../../utils';
import { z } from '../../zod';
SqliteProvider
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export class SqliteProvider implements IDbProvider {
private readonly logger = new Logger(SqliteProvider.name);
constructor(private readonly knex: Knex) {}
PostgresProvider
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export class PostgresProvider implements IDbProvider {
private readonly logger = new Logger(PostgresProvider.name);
constructor(private readonly knex: Knex) {}
driver = DriverClient.Pg;
FieldService
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class FieldService implements IReadonlyAdapterService {
constructor(
private readonly batchService: BatchService,
private readonly prismaService: PrismaService,
ViewOpenApiService
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class ViewOpenApiService {
private logger = new Logger(ViewOpenApiService.name);
constructor(
File typecast.validate.ts
has 348 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException } from '@nestjs/common';
import type {
IAttachmentCellValue,
IAttachmentItem,
ILinkCellValue,
Function GridViewBase
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const GridViewBase = (props: IGridViewProps) => {
const { groupPointsServerData } = props;
const view = useView();
const tableId = useTableId();
const router = useRouter();
- 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 plugin.service.ts
has 345 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import { Injectable, NotFoundException } from '@nestjs/common';
import {
generatePluginId,
generatePluginUserId,
File UniverSheet.tsx
has 342 lines of code (exceeds 300 allowed). Consider refactoring. Open
'use client';
import type {
IWorkbookData,
ICommandInfo,
File operator.ts
has 342 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/naming-convention */
import { pick, pullAll, uniq } from 'lodash';
import { z } from 'zod';
import { CellValueType, FieldType } from '../../field/constant';
import type { FieldCore } from '../../field/field';
File import.class.ts
has 340 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { existsSync } from 'fs';
import { join } from 'path';
import { BadRequestException } from '@nestjs/common';
import { getUniqName, FieldType } from '@teable/core';
import type { IValidateTypes, IAnalyzeVo } from '@teable/openapi';
File table-import.e2e-spec.ts
has 340 lines of code (exceeds 300 allowed). Consider refactoring. Open
import fs from 'fs';
import path from 'path';
import type { INestApplication } from '@nestjs/common';
import { FieldType, defaultDatetimeFormatting } from '@teable/core';
import type { IInplaceImportOptionRo } from '@teable/openapi';