teableio/teable

View on GitHub

Showing 671 of 671 total issues

File selection.e2e-spec.ts has 438 lines of code (exceeds 300 allowed). Consider refactoring.
Open

/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable sonarjs/no-duplicate-string */
import type { INestApplication } from '@nestjs/common';
import {
  Colors,
Severity: Minor
Found in apps/nestjs-backend/test/selection.e2e-spec.ts - About 5 hrs to fix

    Function TableImport has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    export const TableImport = (props: ITableImportProps) => {
      const base = useBase();
      const router = useRouter();
      const { t } = useTranslation(['table']);
      const [step, setStep] = useState(Step.UPLOAD);
    Severity: Minor
    Found in apps/nextjs-app/src/features/app/blocks/import-table/TableImport.tsx - About 5 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 FormEditor has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    export const FormEditor = () => {
      const view = useView();
      const isHydrated = useIsHydrated();
      const visibleFields = useFields();
      const allFields = useFields({ withHidden: true, withDenied: true });

    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-open-api.service.ts has 417 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    import { BadRequestException, Injectable, Logger, NotFoundException } from '@nestjs/common';
    import { FieldKeyType, FieldOpBuilder, FieldType, IFieldRo } from '@teable/core';
    import type {
      IFieldVo,
      IConvertFieldRo,

      Function KanbanProvider has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

      export const KanbanProvider = ({ children }: { children: ReactNode }) => {
        const tableId = useTableId();
        const view = useView() as KanbanView | undefined;
        const baseId = useBaseId() as string;
        const { shareId } = useContext(ShareViewContext) ?? {};

      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 oauth-server.e2e-spec.ts has 413 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

      /* eslint-disable @typescript-eslint/no-explicit-any */
      /* eslint-disable sonarjs/no-duplicate-string */
      import type { INestApplication } from '@nestjs/common';
      import { HttpError } from '@teable/core';
      import {
      Severity: Minor
      Found in apps/nestjs-backend/test/oauth-server.e2e-spec.ts - About 4 hrs to fix

        File init-app.ts has 411 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        /* eslint-disable sonarjs/no-duplicate-string */
        import { ValidationPipe } from '@nestjs/common';
        import { ConfigService } from '@nestjs/config';
        import { WsAdapter } from '@nestjs/platform-ws';
        import type { TestingModule } from '@nestjs/testing';
        Severity: Minor
        Found in apps/nestjs-backend/test/utils/init-app.ts - About 4 hrs to fix

          Function createHarParameterObjects has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

          const createHarParameterObjects = function ({ name, in: location, style, explode }, value) {
            if (!name || !location || typeof value === 'undefined') {
              throw 'Required parameters missing';
            }
          
          
          Severity: Minor
          Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 4 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

          ReferenceService has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Injectable()
          export class ReferenceService {
            private readonly logger = new Logger(ReferenceService.name);
          
            constructor(
          Severity: Minor
          Found in apps/nestjs-backend/src/features/calculation/reference.service.ts - About 4 hrs to fix

            Function useDrag has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

            export const useDrag = (
              coordInstance: CoordinateManager,
              scrollState: IScrollState,
              selection: CombinedSelection,
              draggable?: DraggableType
            Severity: Minor
            Found in packages/sdk/src/components/grid/hooks/useDrag.ts - About 4 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 RollupOptions has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

            export const RollupOptions = (props: {
              options: Partial<IRollupFieldOptions> | undefined;
              cellValueType?: CellValueType;
              isMultipleCellValue?: boolean;
              isLookup?: boolean;

            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 Editor.tsx has 399 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 { closeBracketsKeymap } from '@codemirror/autocomplete';
            import { defaultKeymap, historyKeymap } from '@codemirror/commands';
            import type { EditorSelection } from '@codemirror/state';
            import { keymap } from '@codemirror/view';
            Severity: Minor
            Found in packages/sdk/src/components/editor/formula/Editor.tsx - About 4 hrs to fix

              File QueryLexer.ts has 394 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              // Generated from src/query/parser/QueryLexer.g4 by ANTLR 4.9.0-SNAPSHOT
              
              import type { ATN } from 'antlr4ts/atn/ATN';
              import { ATNDeserializer } from 'antlr4ts/atn/ATNDeserializer';
              import { LexerATNSimulator } from 'antlr4ts/atn/LexerATNSimulator';
              Severity: Minor
              Found in packages/core/src/query/parser/QueryLexer.ts - About 4 hrs to fix

                Function FormEditorMain has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                export const FormEditorMain = (props: { fields: IFieldInstance[] }) => {
                  const { fields } = props;
                  const view = useView() as FormView | undefined;
                  const isHydrated = useIsHydrated();
                  const { openSetting } = useFieldSettingStore();

                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 region.ts has 393 lines of code (exceeds 300 allowed). Consider refactoring.
                Open

                /* eslint-disable @typescript-eslint/naming-convention */
                import { GRID_DEFAULT } from '../configs';
                import { LinearRowType, RegionType, RowControlType } from '../interface';
                import type {
                  IActiveCellBound,
                Severity: Minor
                Found in packages/sdk/src/components/grid/utils/region.ts - About 4 hrs to fix

                  ViewService has 33 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  @Injectable()
                  export class ViewService implements IReadonlyAdapterService {
                    constructor(
                      private readonly cls: ClsService<IClsStore>,
                      private readonly batchService: BatchService,
                  Severity: Minor
                  Found in apps/nestjs-backend/src/features/view/view.service.ts - About 4 hrs to fix

                    File oauth-server.service.spec.ts has 387 lines of code (exceeds 300 allowed). Consider refactoring.
                    Open

                    /* eslint-disable @typescript-eslint/no-explicit-any */
                    /* eslint-disable sonarjs/no-duplicate-string */
                    import { BadRequestException, UnauthorizedException } from '@nestjs/common';
                    import { JwtService } from '@nestjs/jwt';
                    import type { TestingModule } from '@nestjs/testing';
                    Severity: Minor
                    Found in apps/nestjs-backend/src/features/oauth/oauth-server.service.spec.ts - About 4 hrs to fix

                      File base-duplicate.service.ts has 387 lines of code (exceeds 300 allowed). Consider refactoring.
                      Open

                      import { Injectable, Logger, NotFoundException } from '@nestjs/common';
                      import type { ILinkFieldOptions } from '@teable/core';
                      import {
                        FieldType,
                        generateBaseId,
                      Severity: Minor
                      Found in apps/nestjs-backend/src/features/base/base-duplicate.service.ts - About 4 hrs to fix

                        File oauth-server.service.ts has 387 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        import {
                          BadRequestException,
                          HttpException,
                          Injectable,
                          NotFoundException,
                        Severity: Minor
                        Found in apps/nestjs-backend/src/features/oauth/oauth-server.service.ts - About 4 hrs to fix

                          Function drawRowHeader has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const drawRowHeader = (ctx: CanvasRenderingContext2D, props: IRowHeaderDrawerProps) => {
                            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

                          Severity
                          Category
                          Status
                          Source
                          Language