teableio/teable

View on GitHub

Showing 671 of 671 total issues

File link-api.e2e-spec.ts has 2609 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 1 wk to fix

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

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

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

        /* eslint-disable @typescript-eslint/naming-convention */
        import {
          BadRequestException,
          Injectable,
          InternalServerErrorException,
        Severity: Major
        Found in apps/nestjs-backend/src/features/record/record.service.ts - About 3 days to fix

          File undo-redo.e2e-spec.ts has 1202 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, ILinkFieldOptions, IRollupFieldOptions } from '@teable/core';
          import {
            CellValueType,
          Severity: Major
          Found in apps/nestjs-backend/test/undo-redo.e2e-spec.ts - About 2 days to fix

            File field-supplement.service.ts has 1154 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,

              Function GridViewBaseInner has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
              Open

              export const GridViewBaseInner: React.FC<IGridViewBaseInnerProps> = (
                props: IGridViewBaseInnerProps
              ) => {
                const { groupPointsServerData, onRowExpand } = props;
                const { t } = useTranslation(tableConfig.i18nNamespaces);

              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 date-time.spec.ts has 1090 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

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

                File Formula.ts has 1072 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 reference.service.ts has 1042 lines of code (exceeds 300 allowed). Consider refactoring.
                  Open

                  import {
                    BadRequestException,
                    Injectable,
                    InternalServerErrorException,
                    Logger,
                  Severity: Major
                  Found in apps/nestjs-backend/src/features/calculation/reference.service.ts - About 2 days to fix

                    Function expr has a Cognitive Complexity of 117 (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 link.service.ts has 993 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

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

                      import {
                        BadRequestException,
                        Injectable,
                        InternalServerErrorException,
                        Logger,

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

                        export const GridViewBaseInner: React.FC<IGridViewBaseInnerProps> = (
                          props: IGridViewBaseInnerProps
                        ) => {
                          const { groupPointsServerData, onRowExpand } = props;
                          const { t } = useTranslation(tableConfig.i18nNamespaces);

                          File selection.service.spec.ts has 908 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 } from '@teable/core';
                          Severity: Major
                          Found in apps/nestjs-backend/src/features/selection/selection.service.spec.ts - About 2 days to fix

                            Function InteractionLayerBase has 649 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 GridViewBaseInner.tsx has 818 lines of code (exceeds 300 allowed). Consider refactoring.
                              Open

                              import { useMutation } from '@tanstack/react-query';
                              import type { IFieldVo } from '@teable/core';
                              import {
                                FieldKeyType,
                                RowHeightLevel,

                                File constants.ts has 796 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 { useMemo } from 'react';
                                import { useTranslation } from '../../../context/app/i18n';
                                Severity: Major
                                Found in packages/sdk/src/components/editor/formula/constants.ts - About 1 day to fix

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

                                  import {
                                    BadRequestException,
                                    Injectable,
                                    Logger,
                                    NotFoundException,
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language