teableio/teable

View on GitHub

Showing 504 of 504 total issues

File selection.service.ts has 660 lines of code (exceeds 300 allowed). Consider refactoring.
Open

import { BadRequestException, Injectable } from '@nestjs/common';
import type {
  IDateFieldOptions,
  IFieldOptionsRo,
  IFieldOptionsVo,
Severity: Major
Found in apps/nestjs-backend/src/features/selection/selection.service.ts - About 1 day to fix

    File GridViewBase.tsx has 639 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    import { RowHeightLevel, contractColorForTheme } from '@teable/core';
    import type {
      IRectangle,
      IPosition,
      IGridRef,
    Severity: Major
    Found in apps/nextjs-app/src/features/app/blocks/view/grid/GridViewBase.tsx - About 1 day to fix

      File view-open-api.service.ts has 588 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

      import {
        BadRequestException,
        Injectable,
        Logger,
        NotFoundException,

        Function FormulaEditor has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
        Open

        export const FormulaEditor: FC<IFormulaEditorProps> = (props) => {
          const { expression, onConfirm } = props;
          const fields = useFields({ withHidden: true, withDenied: true });
          const { theme } = useTheme();
          const { t } = useTranslation();
        Severity: Minor
        Found in packages/sdk/src/components/editor/formula/Editor.tsx - About 1 day 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 54 (exceeds 5 allowed). Consider refactoring.
        Open

        function parse(raw: string, preferences: string[] | undefined, options: IOptions) {
          const lowers = new Map<string, { orig: string; pos: number }>();
          const header = raw.replace(/[ \t]/g, '');
        
          if (preferences) {
        Severity: Minor
        Found in apps/nextjs-app/src/lib/i18n/acceptHeader.ts - About 1 day 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

        File baseRenderer.ts has 565 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        import { LRUCache } from 'lru-cache';
        import { parseToRGB } from '../../utils';
        import type {
          ILineProps,
          IMultiLineTextProps,

          File date-time.ts has 563 lines of code (exceeds 300 allowed). Consider refactoring.
          Open

          import type { ManipulateType, UnitType } from 'dayjs';
          import dayjs, { extend, isDayjs } from 'dayjs';
          import customParseFormat from 'dayjs/plugin/customParseFormat';
          import isBetween from 'dayjs/plugin/isBetween';
          import relativeTime from 'dayjs/plugin/relativeTime';
          Severity: Major
          Found in packages/core/src/formula/functions/date-time.ts - About 1 day to fix

            File date-time.spec.ts has 563 lines of code (exceeds 300 allowed). Consider refactoring.
            Open

            /* eslint-disable sonarjs/no-duplicate-string */
            import dayjs from 'dayjs';
            import type { IRecord } from '../../models';
            import { CellValueType } from '../../models/field/constant';
            import { TypedValue } from '../typed-value';
            Severity: Major
            Found in packages/core/src/formula/functions/date-time.spec.ts - About 1 day to fix

              File json.visitor.spec.ts has 547 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              /* eslint-disable @typescript-eslint/no-explicit-any */
              import { parseTQL } from './json.visitor';
              
              describe('JsonVisitor', () => {
                const mockFilterData = (value: any = null, operator = '=') => {
              Severity: Major
              Found in packages/core/src/query/json.visitor.spec.ts - About 7 hrs to fix

                Function LinkListBase has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                Open

                const LinkListBase: ForwardRefRenderFunction<ILinkListRef, ILinkListProps> = (
                  props,
                  forwardRef
                ) => {
                  const { readonly, type, rowCount, cellValue, recordQuery, isMultiple, onChange, onExpand } =
                Severity: Minor
                Found in packages/sdk/src/components/editor/link/LinkList.tsx - About 7 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

                File numeric.ts has 545 lines of code (exceeds 300 allowed). Consider refactoring.
                Open

                import { CellValueType } from '../../models/field/constant';
                import type { TypedValue } from '../typed-value';
                import { FormulaFunc, FormulaFuncType, FunctionName } from './common';
                
                abstract class NumericFunc extends FormulaFunc {
                Severity: Major
                Found in packages/core/src/formula/functions/numeric.ts - About 7 hrs to fix

                  Function InfiniteScrollerBase has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const InfiniteScrollerBase: ForwardRefRenderFunction<ScrollerRef, ScrollerProps> = (props, ref) => {
                    const {
                      coordInstance,
                      containerWidth,
                      containerHeight,
                  Severity: Minor
                  Found in packages/sdk/src/components/grid/InfiniteScroller.tsx - About 7 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 calcCells has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const calcCells = (props: ILayoutDrawerProps, renderRegion: RenderRegion) => {
                    const {
                      coordInstance,
                      visibleRegion,
                      activeCell,

                  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 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 {
                  Severity: Major
                  Found in apps/nestjs-backend/test/lookup.e2e-spec.ts - About 7 hrs to fix

                    Function parseClipboardText has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const parseClipboardText = (content: string) => {
                      if (!content.includes('"')) {
                        return content.split(newline).map((row) => row.split(delimiter));
                      }
                    
                    
                    Severity: Minor
                    Found in packages/core/src/utils/clipboard.ts - About 6 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

                    FieldSupplementService has 49 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @Injectable()
                    export class FieldSupplementService {
                      constructor(
                        private readonly fieldService: FieldService,
                        private readonly prismaService: PrismaService,

                      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,

                      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:
                      Severity: Minor
                      Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 6 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

                      File base-duplicate.service.ts has 485 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 6 hrs to fix

                        File numeric.spec.ts has 482 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        import { CellValueType } from '../../models/field/constant';
                        import { TypedValue } from '../typed-value';
                        import {
                          Abs,
                          Average,
                        Severity: Minor
                        Found in packages/core/src/formula/functions/numeric.spec.ts - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language