teableio/teable

View on GitHub

Showing 671 of 671 total issues

File base-query.e2e-spec.ts has 758 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: Major
Found in apps/nestjs-backend/test/base-query.e2e-spec.ts - About 1 day to fix

    File InteractionLayer.tsx has 740 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 { isEqual } from 'lodash';
    import type { Dispatch, ForwardRefRenderFunction, SetStateAction } from 'react';
    import { useState, useRef, forwardRef, useImperativeHandle, useMemo, useLayoutEffect } from 'react';
    import { useClickAway, useMouse } from 'react-use';
    Severity: Major
    Found in packages/sdk/src/components/grid/InteractionLayer.tsx - About 1 day to fix

      File selection.service.ts has 723 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 field.e2e-spec.ts has 606 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        import type { INestApplication } from '@nestjs/common';
        import { EventEmitter2 } from '@nestjs/event-emitter';
        import type {
          IFieldRo,
          IFieldVo,
        Severity: Major
        Found in apps/nestjs-backend/test/field.e2e-spec.ts - About 1 day to fix

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

          import dayjs from 'dayjs';
          import relativeTime from 'dayjs/plugin/relativeTime';
          import timezone from 'dayjs/plugin/timezone';
          import utc from 'dayjs/plugin/utc';
          import { CellValueType } from '../../models/field/constant';
          Severity: Major
          Found in packages/core/src/formula/functions/numeric.ts - About 1 day to fix

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

            import type { ManipulateType, UnitType } from 'dayjs';
            import dayjs, { 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 view.service.ts has 576 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

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

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

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

                  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 { resolvedTheme } = 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

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

                  export const KanbanContainer = () => {
                    const tableId = useTableId();
                    const viewId = useViewId();
                    const { collapsedStackMap } = useKanbanStackCollapsedStore();
                    const { permission, stackField, stackCollection } = useKanban() as Required<IKanbanContext>;

                  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 LinkListBase has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const LinkListBase: ForwardRefRenderFunction<ILinkListRef, ILinkListProps> = (
                    props,
                    forwardRef
                  ) => {
                    const {
                  Severity: Minor
                  Found in packages/sdk/src/components/editor/link/LinkList.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

                  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 calcCells has a Cognitive Complexity of 51 (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

                    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 FieldMenu has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const FieldMenu = () => {
                      const isTouchDevice = useIsTouchDevice();
                      const view = useView() as GridView | undefined;
                      const { filter, sort, group } = view || {};
                      const tableId = useTableId();

                    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 51 functions (exceeds 20 allowed). Consider refactoring.
                    Open

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

                      File use-grid-columns.tsx has 512 lines of code (exceeds 300 allowed). Consider refactoring.
                      Open

                      import type { IAttachmentCellValue, INumberShowAs, ISingleLineTextShowAs } from '@teable/core';
                      import { RowHeightLevel, CellValueType, ColorUtils, FieldType } from '@teable/core';
                      import { useTheme } from '@teable/next-themes';
                      import { keyBy } from 'lodash';
                      import { LRUCache } from 'lru-cache';

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

                        export const parseClipboardText = (content: string) => {
                          const _newline = content.includes(windowsNewline) ? windowsNewline : newline;
                          if (!content.includes('"')) {
                            return content.split(_newline).map((row) => row.split(delimiter));
                          }
                        Severity: Minor
                        Found in packages/core/src/utils/clipboard.ts - 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 useSelectionOperation has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const useSelectionOperation = (props?: {
                          collapsedGroupIds?: string[];
                          copyReq?: UseMutateAsyncFunction<AxiosResponse<ICopyVo>, unknown, IRangesRo, unknown>;
                        }) => {
                          const { collapsedGroupIds, copyReq } = props || {};

                        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