teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function TextEditorBase has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

> = (props, ref) => {
  const { cell, rect, style, theme, isEditing, onChange } = props;
  const { cellLineColorActived } = theme;
  const { width, height } = rect;
  const { displayData, type } = cell;
Severity: Minor
Found in packages/sdk/src/components/grid/components/editor/TextEditor.tsx - About 2 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 getViewProjection has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  private async getViewProjection(
    tableId: string,
    query: IGetRecordsRo
  ): Promise<Record<string, boolean> | undefined> {
    const viewId = query.viewId;
Severity: Minor
Found in apps/nestjs-backend/src/features/record/record.service.ts - About 2 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 processMultilineSyntax has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  async processMultilineSyntax(
    input: string,
    callBack: (result: unknown) => void = () => {}
  ): Promise<void> {
    if (this.processing) {

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

import { Injectable, Logger } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import type { ICreateOpBuilder, IOpBuilder, IOpContextBase, IOtOperation } from '@teable/core';
import {
  FieldOpBuilder,
Severity: Minor
Found in apps/nestjs-backend/src/event-emitter/event-emitter.service.ts - About 2 hrs to fix

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

    import https from 'https';
    import { join } from 'path';
    import { BadRequestException, Injectable } from '@nestjs/common';
    import {
      generateAccountId,
    Severity: Minor
    Found in apps/nestjs-backend/src/features/user/user.service.ts - About 2 hrs to fix

      Function expr has 346 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

          public expr(_p?: number): ExprContext {
              if (_p === undefined) {
                  _p = 0;
              }
      
      
      Severity: Major
      Found in packages/core/src/formula/parser/Formula.ts - About 2 hrs to fix

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

        import { BadRequestException, Injectable, Logger, NotFoundException } from '@nestjs/common';
        import type { IOtOperation, ISnapshotBase } from '@teable/core';
        import {
          generateTableId,
          getRandomString,
        Severity: Minor
        Found in apps/nestjs-backend/src/features/table/table.service.ts - About 2 hrs to fix

          Query has 25 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class Query extends Parser {
            public static readonly COMMA = 1;
            public static readonly OPEN_PAREN = 2;
            public static readonly CLOSE_PAREN = 3;
            public static readonly OPEN_BRACKET = 4;
          Severity: Minor
          Found in packages/core/src/query/parser/Query.ts - About 2 hrs to fix

            ViewOpenApiController has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            @Controller('api/table/:tableId/view')
            export class ViewOpenApiController {
              constructor(
                private readonly viewService: ViewService,
                private readonly viewOpenApiService: ViewOpenApiService

              BaseController has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              @Controller('api/base/')
              export class BaseController {
                constructor(
                  private readonly baseService: BaseService,
                  private readonly dbConnectionService: DbConnectionService,
              Severity: Minor
              Found in apps/nestjs-backend/src/features/base/base.controller.ts - About 2 hrs to fix

                File formula.field.spec.ts has 332 lines of code (exceeds 300 allowed). Consider refactoring.
                Open

                import { plainToInstance } from 'class-transformer';
                import { Colors } from '../colors';
                import { DbFieldType, FieldType, CellValueType } from '../constant';
                import { DateFormattingPreset, NumberFormattingType, TimeFormatting } from '../formatting';
                import {
                Severity: Minor
                Found in packages/core/src/models/field/derivate/formula.field.spec.ts - About 2 hrs to fix

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

                  import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
                  import type { IMakeOptional, IUserFieldOptions } from '@teable/core';
                  import { FieldKeyType, generateRecordId, FieldType } from '@teable/core';
                  import { PrismaService } from '@teable/db-main-prisma';
                  import type { ICreateRecordsRo, ICreateRecordsVo, IRecord } from '@teable/openapi';

                    Function useAutoScroll has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const useAutoScroll = (props: IUseAutoScroll) => {
                      const { coordInstance, isSelecting, dragType, isDragging, scrollBy } = props;
                      const speedScalar = useRef(0);
                      const { containerWidth, containerHeight, freezeRegionWidth, rowInitSize } = coordInstance;
                      const [scrollDirection, setScrollDirection] = useState<
                    Severity: Minor
                    Found in packages/sdk/src/components/grid/hooks/useAutoScroll.ts - About 2 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 CommentQuote has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const CommentQuote = (props: ICommentQuoteProps) => {
                      const { className, quoteId, onClose } = props;
                      const tableId = useTableId();
                      const recordId = useRecordId();
                      const { t } = useTranslation();
                    Severity: Minor
                    Found in packages/sdk/src/components/comment/comment-editor/CommentQuote.tsx - About 2 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 formatTarget has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const formatTarget = function (targetStr) {
                      const language = targetStr.split('_')[0];
                      const title = capitalizeFirstLetter(language);
                      let library = targetStr.split('_')[1];
                      if (!library) {
                    Severity: Minor
                    Found in packages/openapi/src/openapi-snippet/index.js - About 2 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 FilePreviewProvider has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const FilePreviewProvider = (props: IFilePreviewProvider) => {
                      const { children, container, i18nMap } = props;
                      const [current, setCurrent] = useState<number | string>();
                      const [files, setFiles] = useState<IFileItemInner[]>([]);
                    
                    
                    Severity: Minor
                    Found in packages/ui-lib/src/base/file/preview/FilePreviewProvider.tsx - About 2 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 SelectEditorBase has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    > = (props, ref) => {
                      const { cell, isEditing, style, onChange, setEditing, theme } = props;
                      const { data, isMultiple, choiceSorted = [], choiceMap = {} } = cell;
                      const [values, setValues] = useState(data);
                      const inputRef = useRef<HTMLInputElement | null>(null);
                    Severity: Minor
                    Found in packages/sdk/src/components/grid/components/editor/SelectEditor.tsx - About 2 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 useGridPrefillingRow has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const useGridPrefillingRow = (columns: (IGridColumn & { id: string })[]) => {
                      const fields = useFields();
                      const fieldEditable = useFieldCellEditable();
                    
                      const [prefillingRowOrder, setPrefillingRowOrder] = useState<IUpdateOrderRo>();

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

                      getFilterBySelectTypeChanges(
                        originData: IFilterSet,
                        fieldId: string,
                        updateNameOptions: { id?: string; oldName: string; newName: string }[],
                        deleteOptions: ISelectFieldOptions['choices']

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

                    export function createAISyntaxParser() {
                      let baseId: string | undefined;
                      let tableId: string | undefined;
                      let viewId: string | undefined;
                    
                    

                    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