teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function updateForeignCellForManyOne has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  private updateForeignCellForManyOne(params: {
    fkItem: IFkRecordItem;
    recordId: string;
    symmetricFieldId: string;
    sourceLookedFieldId: string;
Severity: Minor
Found in apps/nestjs-backend/src/features/calculation/link.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 convertUser has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const convertUser = (input: unknown): string | undefined => {
  if (typeof input === 'string') return input;

  if (Array.isArray(input)) {
    if (input.every((item) => typeof item === 'string')) {
Severity: Minor
Found in apps/nestjs-backend/src/features/record/typecast.validate.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 getDeletedFilterByFieldId has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  getDeletedFilterByFieldId(filter: IFilterSet, fieldId: string) {
    const removeItemsByFieldId = (filter: IFilterSet, fieldId: string) => {
      if (Array.isArray(filter.filterSet)) {
        filter.filterSet = filter.filterSet.filter((item) => {
          if ('fieldId' in item && item.fieldId === fieldId) {
Severity: Minor
Found in apps/nestjs-backend/src/features/view/view.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 getRecordHistory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  async getRecordHistory(
    tableId: string,
    recordId: string | undefined,
    query: IGetRecordHistoryQuery
  ): Promise<IRecordHistoryVo> {

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

export const AccessSelect = (props: IFormAccess) => {
  const { onChange, value } = props;
  const { t } = useTranslation('token');
  const [bases, setBases] = useState<string[]>(value?.baseIds || []);
  const [spaces, setSpaces] = useState<string[]>(value?.spaceIds || []);

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

export const ChangePasswordDialog = (props: IChangePasswordDialogProps) => {
  const { children } = props;
  const { t } = useTranslation('common');
  const router = useRouter();
  const { user } = useSession();

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

Consider simplifying this complex logical expression.
Open

                  if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
                    const { prefix, decimal, suffix } = config.measure ?? {};
                    const totalDisplay = `${prefix ?? ''}${decimal ? total.toFixed(decimal) : total}${suffix ?? ''}`;
                    return (
                      <text
Severity: Critical
Found in plugins/src/app/chart/components/chart/chart-show/pie/Pie.tsx - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        if (
          oldField.type !== FieldType.LongText &&
          newField.type !== FieldType.Rating &&
          newField.cellValueType === oldField.cellValueType &&
          newField.isMultipleCellValue !== true &&

      Function getColumnStatisticData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      export const getColumnStatisticData = (
        props: Pick<
          IRenderLayerProps,
          'height' | 'scrollState' | 'coordInstance' | 'columnStatistics' | 'getLinearRow'
        > & {
      Severity: Minor
      Found in packages/sdk/src/components/grid/utils/region.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 UserEditorBaseRef has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      const UserEditorBaseRef: ForwardRefRenderFunction<IUserEditorRef, IUserEditorBaseProps> = (
        props,
        ref
      ) => {
        const {
      Severity: Minor
      Found in packages/sdk/src/components/editor/user/EditorBase.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 ChartCombo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      export const ChartCombo = (props: { config: IComboConfig; defaultType?: IComboType }) => {
        const { config, defaultType = 'bar' } = props;
      
        const queryData = useBaseQueryData();
        const chartConfig = useComboConfig(config, queryData?.columns);
      Severity: Minor
      Found in plugins/src/app/chart/components/chart/chart-show/combo/Combo.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 draw has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        draw: (cell: ISelectCell, props: ICellRenderProps) => {
          const { ctx, rect, theme, isActive, spriteManager } = props;
          const { displayData, choiceMap, readonly } = cell;
          const { x: _x, y: _y, width, height } = rect;
          const clipEnable = !isActive && displayData.length;

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

      > = (props, ref) => {
        const { field, record, rect, style, isEditing, setEditing } = props;
        const tableId = useTableId();
        const defaultFocusRef = useRef<HTMLInputElement | null>(null);
        const editorRef = useRef<IEditorRef<string | string[] | undefined>>(null);

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

      export const GroupPointProvider: FC<GroupPointProviderProps> = ({ children }) => {
        const isHydrated = useIsHydrated();
        const { tableId, viewId } = useContext(AnchorContext);
        const queryClient = useQueryClient();
        const view = useView(viewId);
      Severity: Minor
      Found in packages/sdk/src/context/aggregation/GroupPointProvider.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 replaceMeTagInValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        private replaceMeTagInValue(
          filterItem: IFilterItem,
          field: IFieldInstance,
          replaceUserId?: string
        ): 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 visitBinaryOp has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        visitBinaryOp(ctx: BinaryOpContext) {
          const leftNode = ctx.expr(0);
          const rightNode = ctx.expr(1);
          const left = this.visit(leftNode)!;
          const right = this.visit(rightNode)!;
      Severity: Minor
      Found in packages/core/src/formula/visitor.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 handleFieldProperty has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        private async handleFieldProperty(fieldId: string, opContext: IOpContext) {
          const { key, newValue } = opContext as ISetFieldPropertyOpContext;
      
          if (key === 'options') {
            if (!newValue) {
      Severity: Minor
      Found in apps/nestjs-backend/src/features/field/field.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 alterTableModifyFieldValidation has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        private async alterTableModifyFieldValidation(
          fieldId: string,
          key: 'unique' | 'notNull',
          newValue?: boolean
        ) {
      Severity: Minor
      Found in apps/nestjs-backend/src/features/field/field.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 publishOpsMap has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        @Timing()
        publishOpsMap(rawOpMaps: IRawOpMap[] | undefined) {
          if (!rawOpMaps?.length) {
            return;
          }
      Severity: Minor
      Found in apps/nestjs-backend/src/share-db/share-db.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 performAggregation has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        async performAggregation(params: {
          tableId: string;
          withFieldIds?: string[];
          withView?: IWithView;
          search?: [string, string] | [string];
      Severity: Minor
      Found in apps/nestjs-backend/src/features/aggregation/aggregation.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

      Severity
      Category
      Status
      Source
      Language