teableio/teable

View on GitHub

Showing 500 of 500 total issues

File field-converting.e2e-spec.ts has 2676 lines of code (exceeds 300 allowed). Consider refactoring.
Open

/* eslint-disable sonarjs/no-duplicate-string */
import type { INestApplication } from '@nestjs/common';
import type {
  IFieldRo,
  IFieldVo,
Severity: Major
Found in apps/nestjs-backend/test/field-converting.e2e-spec.ts - About 1 wk to fix

    File link-api.e2e-spec.ts has 2226 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    /* eslint-disable sonarjs/cognitive-complexity */
    /* eslint-disable @typescript-eslint/no-non-null-assertion */
    /* eslint-disable @typescript-eslint/naming-convention */
    /* eslint-disable @typescript-eslint/no-explicit-any */
    /* eslint-disable sonarjs/no-duplicate-string */
    Severity: Major
    Found in apps/nestjs-backend/test/link-api.e2e-spec.ts - About 6 days to fix

      File Query.ts has 1466 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

      // Generated from src/query/parser/Query.g4 by ANTLR 4.9.0-SNAPSHOT
      
      import { ATN } from 'antlr4ts/atn/ATN';
      import { ATNDeserializer } from 'antlr4ts/atn/ATNDeserializer';
      import { ParserATNSimulator } from 'antlr4ts/atn/ParserATNSimulator';
      Severity: Major
      Found in packages/core/src/query/parser/Query.ts - About 3 days to fix

        File layoutRenderer.ts has 1453 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        import { contractColorForTheme } from '@teable/core';
        import { isEqual, groupBy, cloneDeep } from 'lodash';
        import { GRID_DEFAULT, ROW_RELATED_REGIONS } from '../../configs';
        import type { IVisibleRegion } from '../../hooks';
        import { getDropTargetIndex } from '../../hooks';

          File field-supplement.service.ts has 1063 lines of code (exceeds 300 allowed). Consider refactoring.
          Open

          /* eslint-disable sonarjs/no-duplicate-string */
          import { BadRequestException, Injectable } from '@nestjs/common';
          import type {
            IFieldRo,
            IFieldVo,

            File Formula.ts has 1043 lines of code (exceeds 300 allowed). Consider refactoring.
            Open

            // Generated from src/formula/parser/Formula.g4 by ANTLR 4.9.0-SNAPSHOT
            
            
            import { ATN } from "antlr4ts/atn/ATN";
            import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer";
            Severity: Major
            Found in packages/core/src/formula/parser/Formula.ts - About 2 days to fix

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

              import { BadRequestException, Injectable } from '@nestjs/common';
              import type { ILinkCellValue, ILinkFieldOptions } from '@teable/core';
              import { FieldType, Relationship } from '@teable/core';
              import type { Field } from '@teable/db-main-prisma';
              import { PrismaService } from '@teable/db-main-prisma';
              Severity: Major
              Found in apps/nestjs-backend/src/features/calculation/link.service.ts - About 2 days to fix

                Function InteractionLayerBase has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
                Open

                > = (props, ref) => {
                  const {
                    theme,
                    width,
                    height,
                Severity: Minor
                Found in packages/sdk/src/components/grid/InteractionLayer.tsx - About 2 days 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 expr has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
                Open

                    public expr(_p?: number): ExprContext {
                        if (_p === undefined) {
                            _p = 0;
                        }
                
                
                Severity: Minor
                Found in packages/core/src/formula/parser/Formula.ts - About 2 days 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 reference.service.ts has 969 lines of code (exceeds 300 allowed). Consider refactoring.
                Open

                import { BadRequestException, Injectable, Logger } from '@nestjs/common';
                import type {
                  IFieldVo,
                  ILinkCellValue,
                  ILinkFieldOptions,
                Severity: Major
                Found in apps/nestjs-backend/src/features/calculation/reference.service.ts - About 2 days to fix

                  File constants.ts has 966 lines of code (exceeds 300 allowed). Consider refactoring.
                  Open

                  /* eslint-disable sonarjs/no-duplicate-string, @typescript-eslint/naming-convention */
                  import { FormulaFuncType, FunctionName, FUNCTIONS, FormulaLexer } from '@teable/core';
                  import { Hash, A, CheckSquare, Calendar } from '@teable/icons';
                  import type { IFunctionMap, IFunctionSchema } from './interface';
                  
                  
                  Severity: Major
                  Found in packages/sdk/src/components/editor/formula/constants.ts - About 2 days to fix

                    Function GridViewBase has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const GridViewBase: React.FC<IGridViewProps> = (props: IGridViewProps) => {
                      const { onRowExpand } = props;
                      const { t } = useTranslation(tableConfig.i18nNamespaces);
                      const router = useRouter();
                      const gridRef = useRef<IGridRef>(null);
                    Severity: Minor
                    Found in apps/nextjs-app/src/features/app/blocks/view/grid/GridViewBase.tsx - About 2 days 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 selection.service.spec.ts has 909 lines of code (exceeds 300 allowed). Consider refactoring.
                    Open

                    /* eslint-disable @typescript-eslint/no-explicit-any */
                    import { faker } from '@faker-js/faker';
                    import type { TestingModule } from '@nestjs/testing';
                    import { Test } from '@nestjs/testing';
                    import type { IFieldOptionsVo, IFieldVo, IRecord } from '@teable/core';
                    Severity: Major
                    Found in apps/nestjs-backend/src/features/selection/selection.service.spec.ts - About 2 days to fix

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

                      import {
                        BadRequestException,
                        Injectable,
                        InternalServerErrorException,
                        Logger,
                      Severity: Major
                      Found in apps/nestjs-backend/src/features/record/record.service.ts - About 1 day to fix

                        File field-converting.service.ts has 865 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        import {
                          BadRequestException,
                          Injectable,
                          InternalServerErrorException,
                          Logger,

                          Function createCellValue2GridDisplay has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
                          Open

                            (fields: IFieldInstance[], editable: (field: IFieldInstance) => boolean) =>
                            // eslint-disable-next-line sonarjs/cognitive-complexity
                            (record: Record, col: number): ICell => {
                              const field = fields[col];
                          
                          

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

                            (fields: IFieldInstance[]) =>
                            // eslint-disable-next-line sonarjs/cognitive-complexity
                            (cellValue: unknown, depth: number): ICell => {
                              const field = fields[depth];
                          
                          

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

                          > = (props, ref) => {
                            const {
                              theme,
                              width,
                              height,
                          Severity: Major
                          Found in packages/sdk/src/components/grid/InteractionLayer.tsx - About 1 day to fix

                            File InteractionLayer.tsx has 712 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

                              Function GridViewBase has 563 lines of code (exceeds 300 allowed). Consider refactoring.
                              Open

                              export const GridViewBase: React.FC<IGridViewProps> = (props: IGridViewProps) => {
                                const { onRowExpand } = props;
                                const { t } = useTranslation(tableConfig.i18nNamespaces);
                                const router = useRouter();
                                const gridRef = useRef<IGridRef>(null);
                              Severity: Major
                              Found in apps/nextjs-app/src/features/app/blocks/view/grid/GridViewBase.tsx - About 1 day to fix
                                Severity
                                Category
                                Status
                                Source
                                Language