teableio/teable

View on GitHub

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';
    Severity: Minor
    Found in apps/nextjs-app/src/components/Guide.tsx - About 2 hrs to fix

      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;
        }) => {

        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;
        Severity: Minor
        Found in plugins/src/app/sheet-form-view/components/sheet/utils.ts - About 2 hrs to fix

        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>();
        
        
        Severity: Minor
        Found in apps/nestjs-backend/src/features/calculation/utils/dfs.ts - About 2 hrs to fix

        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;
        Severity: Minor
        Found in apps/nestjs-backend/src/features/base/base-query/parse/select.ts - About 2 hrs to fix

        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[] = [];
        
        
        Severity: Minor
        Found in apps/nestjs-backend/src/features/calculation/utils/dfs.ts - About 2 hrs to fix

        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();

        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,
        Severity: Minor
        Found in plugins/src/app/sheet-form-view/components/sheet/PreviewPanel.tsx - About 2 hrs to fix

          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';
          Severity: Minor
          Found in apps/nestjs-backend/src/features/attachments/plugins/local.spec.ts - About 2 hrs to fix

            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';
            Severity: Minor
            Found in packages/sdk/src/components/comment/comment-editor/CommentEditor.tsx - About 2 hrs to fix

              File Combo.tsx has 304 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              /* eslint-disable sonarjs/cognitive-complexity */
              import {
                ChartContainer,
                ChartLegend,
                ChartLegendContent,
              Severity: Minor
              Found in plugins/src/app/chart/components/chart/chart-show/combo/Combo.tsx - About 2 hrs to fix

                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';
                Severity: Minor
                Found in apps/nestjs-backend/test/table.e2e-spec.ts - About 2 hrs to fix

                  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) {
                  Severity: Minor
                  Found in packages/sdk/src/hooks/use-undo-redo.ts - About 2 hrs to fix

                  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;
                  Severity: Minor
                  Found in packages/sdk/src/components/grid/CellScroller.tsx - About 2 hrs to fix

                  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,

                  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();

                  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) {

                  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) {
                  Severity: Minor
                  Found in apps/nestjs-backend/src/features/calculation/utils/dfs.ts - About 2 hrs to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language