teableio/teable

View on GitHub

Showing 671 of 671 total issues

RecordService has 50 functions (exceeds 20 allowed). Consider refactoring.
Open

@Injectable()
export class RecordService {
  private logger = new Logger(RecordService.name);

  constructor(
Severity: Minor
Found in apps/nestjs-backend/src/features/record/record.service.ts - About 7 hrs to fix

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

    import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
    import type {
      IFieldVo,
      IGetFieldsQuery,
      ISnapshotBase,
    Severity: Major
    Found in apps/nestjs-backend/src/features/field/field.service.ts - About 7 hrs to fix

      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

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

        import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
        import type { IAttachmentCellValue, IAttachmentItem, IMakeOptional } from '@teable/core';
        import { FieldKeyType, FieldType } from '@teable/core';
        import { PrismaService } from '@teable/db-main-prisma';
        import { UploadType } from '@teable/openapi';

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

          /* eslint-disable sonarjs/no-duplicate-string */
          import { CellValueType } from '../../models/field/constant';
          import { TypedValue } from '../typed-value';
          import {
            Abs,
          Severity: Major
          Found in packages/core/src/formula/functions/numeric.spec.ts - About 6 hrs to fix

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

            import {
              Injectable,
              Logger,
              ForbiddenException,
              BadGatewayException,
            Severity: Major
            Found in apps/nestjs-backend/src/features/comment/comment-open-api.service.ts - About 6 hrs to fix

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

              import type { INestApplication } from '@nestjs/common';
              import type { IGroup } from '@teable/core';
              import { is, SortFunc, StatisticsFunc } from '@teable/core';
              import type { IGroupHeaderPoint, ITableFullVo } from '@teable/openapi';
              import { getAggregation, getGroupPoints, getRowCount, GroupPointType } from '@teable/openapi';
              Severity: Major
              Found in apps/nestjs-backend/test/aggregation.e2e-spec.ts - About 6 hrs to fix

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

                import { Injectable, Logger } from '@nestjs/common';
                import type { IGridColumnMeta, IFilter, IGroup } from '@teable/core';
                import { mergeWithDefaultFilter, nullsToUndefined, StatisticsFunc, ViewType } from '@teable/core';
                import type { Prisma } from '@teable/db-main-prisma';
                import { PrismaService } from '@teable/db-main-prisma';
                Severity: Minor
                Found in apps/nestjs-backend/src/features/aggregation/aggregation.service.ts - About 6 hrs to fix

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

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

                    File rollup.e2e-spec.ts has 472 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 { IFieldRo, IFieldVo, ILookupOptionsRo, IRecord, LinkFieldCore } from '@teable/core';
                    Severity: Minor
                    Found in apps/nestjs-backend/test/rollup.e2e-spec.ts - About 6 hrs to fix

                      File openapi-to-har.js has 470 lines of code (exceeds 300 allowed). Consider refactoring.
                      Open

                      /* eslint-disable */
                      /**
                       * Translates given OpenAPI document to an array of HTTP Archive (HAR) 1.2 Request Object.
                       * See more:
                       *  - http://swagger.io/specification/
                      Severity: Minor
                      Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 6 hrs to fix

                        FieldConvertingService has 43 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        @Injectable()
                        export class FieldConvertingService {
                          private readonly logger = new Logger(FieldConvertingService.name);
                        
                          constructor(

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

                          import dayjs from 'dayjs';
                          import timezone from 'dayjs/plugin/timezone';
                          import utc from 'dayjs/plugin/utc';
                          import { z } from '../../../zod';
                          dayjs.extend(utc);
                          Severity: Minor
                          Found in packages/core/src/models/field/formatting/time-zone.ts - About 5 hrs to fix

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

                            /* eslint-disable sonarjs/no-duplicate-string */
                            import { CellValueType } from '../../models/field/constant';
                            import { TypedValue } from '../typed-value';
                            import {
                              Concatenate,
                            Severity: Minor
                            Found in packages/core/src/formula/functions/text.spec.ts - About 5 hrs to fix

                              Function PreviewPanel has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const PreviewPanel = (props: IPreviewPanel) => {
                                const { shareId, baseId, workBookData, ...restProps } = props;
                                const isHydrated = useIsHydrated();
                                const view = useView();
                                const { t } = useTranslation();
                              Severity: Minor
                              Found in plugins/src/app/sheet-form-view/components/sheet/PreviewPanel.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 drawColumnStatistics has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const drawColumnStatistics = (
                                ctx: CanvasRenderingContext2D,
                                props: ILayoutDrawerProps,
                                renderRegion: RenderRegion
                                // eslint-disable-next-line sonarjs/cognitive-complexity

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

                              export const RecordHistory = (props: IRecordHistoryProps) => {
                                const { recordId, onRecordClick } = props;
                                const tableId = useTableId() as string;
                                const { t } = useTranslation();
                                const isHydrated = useIsHydrated();
                              Severity: Minor
                              Found in packages/sdk/src/components/expand-record/RecordHistory.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

                              File createTablePrompt.bak.ts has 441 lines of code (exceeds 300 allowed). Consider refactoring.
                              Open

                              export const CREATE_TABLE_PROMPT = `
                              openapi: 3.0.0
                              info:
                                title: Teable App
                                description: Manage Data as easy as drink a cup of tea
                                Severity
                                Category
                                Status
                                Source
                                Language