Showing 671 of 671 total issues
File import-open-api.service.ts
has 316 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { Worker } from 'worker_threads';
import { Injectable, Logger, BadRequestException } from '@nestjs/common';
import type { IFieldRo } from '@teable/core';
import {
FieldType,
File Guide.tsx
has 315 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { IUserMeVo } from '@teable/openapi';
import dynamic from 'next/dynamic';
import { useRouter } from 'next/router';
import { useTranslation, Trans } from 'next-i18next';
import { useEffect, useMemo, useRef, useState } from 'react';
File view-open-api.controller.ts
has 313 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import {
Body,
Controller,
Delete,
Function ComboForm
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const ComboForm = (props: {
type: IComboType;
config: IComboConfig;
onChange: (config: IComboConfig) => void;
}) => {
- 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 getRecordRangesMap
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const getRecordRangesMap = (sheetData?: IWorksheetData['cellData']) => {
const rangesMap: Record<string, [number, number]> = {};
if (!sheetData) {
return rangesMap;
- 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 hasCycle
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function hasCycle(graphItems: IGraphItem[]): boolean {
const adjList: Record<string, string[]> = {};
const visiting = new Set<string>();
const visited = new Set<string>();
- 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 parse
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
parse(
select: IBaseQuerySelect[] | undefined,
content: {
knex: Knex;
queryBuilder: Knex.QueryBuilder;
- 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 topoOrderWithDepends
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function topoOrderWithDepends(startNodeId: string, graph: IGraphItem[]): ITopoItem[] {
const visitedNodes = new Set<string>();
const visitingNodes = new Set<string>();
const sortedNodes: ITopoItem[] = [];
- 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 KanbanStackHeader
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const KanbanStackHeader = (props: IKanbanStackHeaderProps) => {
const { stack, isUncategorized, setEditMode } = props;
const tableId = useTableId();
const viewId = useViewId();
- 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 PreviewPanel.tsx
has 310 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { useMutation, useQuery } from '@tanstack/react-query';
import { FieldType } from '@teable/core';
import type { IRecordsVo } from '@teable/openapi';
import {
shareViewFormSubmit,
File local.spec.ts
has 310 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable sonarjs/no-duplicate-string */
import * as fs from 'fs';
import { join, resolve } from 'path';
import { BadRequestException } from '@nestjs/common';
File CommentEditor.tsx
has 305 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { generateAttachmentId } from '@teable/core';
import type { ICreateCommentRo, IUpdateCommentRo } from '@teable/openapi';
import { createComment, getCommentDetail, updateComment, UploadType } from '@teable/openapi';
import { Button, toast } from '@teable/ui-lib';
File Combo.tsx
has 304 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/cognitive-complexity */
import {
ChartContainer,
ChartLegend,
ChartLegendContent,
File table.e2e-spec.ts
has 304 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
/* eslint-disable @typescript-eslint/naming-convention */
import type { INestApplication } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import { FieldKeyType, FieldType, Relationship, RowHeightLevel, ViewType } from '@teable/core';
Function useUndoRedo
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const useUndoRedo = () => {
const tableId = useTableId();
const { t } = useTranslation();
const performUndo = useCallback(async () => {
if (!tableId) {
- 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 CellScrollerBase
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const CellScrollerBase: ForwardRefRenderFunction<CellScrollerRef, CellScrollerProps> = (
props,
ref
) => {
const { containerRef, style, scrollEnable, activeCellBound, setCellScrollTop } = 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
Function drawChartBar
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const drawChartBar = (ctx: CanvasRenderingContext2D, props: IChartBarProps) => {
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"
Further reading
Function FilterDatePicker
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function FilterDatePicker(props: IFilerDatePickerProps) {
const { value: initValue, operator, onSelect, field } = props;
const [innerValue, setInnerValue] = useState<IDateFilter | null>(initValue);
const { t } = useTranslation();
const dateMap = useDateI18nMap();
- 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 collectFilterLinkFieldRecords
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private async collectFilterLinkFieldRecords(
linkFields: Record<string, string>,
filter?: IFilter
) {
if (!filter || !filter.filterSet) {
- 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 pruneGraph
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function pruneGraph(node: string, graph: IGraphItem[]): IGraphItem[] {
const relatedNodes = new Set<string>();
const prunedGraph: IGraphItem[] = [];
function dfs(currentNode: string) {
- 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"