teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function calculateComputeField has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  private calculateComputeField(
    field: IFieldInstance,
    fieldMap: IFieldMap,
    recordItem: IRecordItem,
    userMap?: { [userId: string]: IUserInfoVo }
Severity: Minor
Found in apps/nestjs-backend/src/features/calculation/reference.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 LinkOptions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const LinkOptions = (props: {
  options: Partial<ILinkFieldOptionsRo> | undefined;
  fieldId?: string;
  isLookup?: boolean;
  onChange?: (options: Partial<ILinkFieldOptionsRo>) => void;

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

export const BaseTrashPage = () => {
  const baseId = useBaseId() as string;
  const isHydrated = useIsHydrated();
  const queryClient = useQueryClient();
  const permission = useBasePermission();
Severity: Minor
Found in apps/nextjs-app/src/features/app/blocks/trash/BaseTrashPage.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 FieldMenu has 326 lines of code (exceeds 300 allowed). Consider refactoring.
Open

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

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

    import { Injectable, InternalServerErrorException } from '@nestjs/common';
    import type { ILinkCellValue, ILinkFieldOptions, IOtOperation } from '@teable/core';
    import {
      Relationship,
      RelationshipRevert,

      Function TableForm has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const TableForm = (props: {
        config: ITableConfig;
        onChange: (config: ITableConfig) => void;
      }) => {
        const { config, onChange } = 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

      Function isPrintableKey has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const isPrintableKey = (event: KeyboardEvent) => {
        const { keyCode } = event;
        const { metaKey, ctrlKey } = event;
      
        if (metaKey || ctrlKey || keyCode === KeyCode.Space) return false;
      Severity: Minor
      Found in packages/sdk/src/components/grid/utils/hotkey.ts - About 1 hr 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 getPreviewSheetData has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const getPreviewSheetData = (sheetData?: IWorksheetData['cellData']) => {
        if (!sheetData) {
          return sheetData;
        }
      
      
      Severity: Minor
      Found in plugins/src/app/sheet-form-view/components/sheet/utils.ts - About 1 hr 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 BaseFilter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const BaseFilter = <T extends IConditionItemProperty>(props: IBaseFilterProps<T>) => {
        const { t } = useTranslation();
        const {
          onChange,
          maxDepth = 2,
      Severity: Minor
      Found in packages/sdk/src/components/filter/BaseFilter.tsx - About 1 hr 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 QuerySelect has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const QuerySelect = (props: IQueryEditorProps<IBaseQuerySelect[]>) => {
        const { value, onChange } = props;
        const context = useContext(QueryEditorContext);
        const [error, setError] = useState<string>();
        const { registerValidator } = useContext(QueryFormContext);
      Severity: Minor
      Found in packages/sdk/src/components/base-query/editors/QuerySelect.tsx - About 1 hr 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 calculateLookup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        private calculateLookup(
          field: IFieldInstance,
          lookedField: IFieldInstance,
          recordItem: IRecordItem
        ) {
      Severity: Minor
      Found in apps/nestjs-backend/src/features/calculation/reference.service.ts - About 1 hr 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 buildLinkCandidateQuery has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        async buildLinkCandidateQuery(
          queryBuilder: Knex.QueryBuilder,
          tableId: string,
          dbTableName: string,
          filterLinkCellCandidate: [string, string] | string
      Severity: Minor
      Found in apps/nestjs-backend/src/features/record/record.service.ts - About 1 hr 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 RecordMenu has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const RecordMenu = () => {
        const { recordMenu, closeRecordMenu, selection } = useGridViewStore();
        const { t } = useTranslation(tableConfig.i18nNamespaces);
        const tableId = useTableId();
        const view = useView();

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

        protected getCellMetaData(index: number, itemType: ItemType): ICellMetaData {
          let cellMetadataMap, itemSize, lastMeasuredIndex, offset;
          const isColumnType = itemType === ItemType.Column;
      
          if (isColumnType) {

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

      const LinkEditorInnerBase: ForwardRefRenderFunction<ILinkEditorMainRef, ILinkEditorMainProps> = (
        props,
        forwardRef
      ) => {
        const { recordId, fieldId, options, cellValue, isEditing, setEditing, onChange } = props;
      Severity: Minor
      Found in packages/sdk/src/components/editor/link/EditorMain.tsx - About 1 hr 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 drawChartLine has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export const drawChartLine = (ctx: CanvasRenderingContext2D, props: IChartLineProps) => {
        const {
          x,
          y,
          width,

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

      const parseParametersToQuery = function (openApi, parameters, location, values) {
        /** @type {Object.<string, HarParameterObject[]>} */
        const queryStrings = {};
      
        for (let i in parameters) {
      Severity: Minor
      Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 1 hr 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 useColumnResize has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export const useColumnResize = (coordInstance: CoordinateManager, scrollState: IScrollState) => {
        const [hoveredColumnResizeIndex, setHoveredColumnResizeIndex] = useState(-1);
        const [columnResizeState, setColumnResizeState] = useState<IColumnResizeState>(
          DEFAULT_COLUMN_RESIZE_STATE
        );
      Severity: Minor
      Found in packages/sdk/src/components/grid/hooks/useColumnResize.ts - About 1 hr 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 clearChangedTemplateValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export const clearChangedTemplateValue = (sheetData?: IWorksheetData['cellData']) => {
        if (!sheetData) {
          return {
            cellData: sheetData,
            deletedFields: [] as string[],
      Severity: Minor
      Found in plugins/src/app/sheet-form-view/components/sheet/utils.ts - About 1 hr 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 FilterLinkSelect has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export const FilterLinkSelect = (props: FilterLinkSelectProps) => {
        const { value, operator, onSelect, components, className } = props;
        const { Trigger, List } = components || {};
        const [open, setOpen] = useState(false);
      
      

      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