teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function getPayloadConfigFromPayload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
  if (typeof payload !== 'object' || payload === null) {
    return undefined;
  }

Severity: Minor
Found in packages/ui-lib/src/shadcn/ui/chart.tsx - About 35 mins 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 FormMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

>(({ className, children, ...props }, ref) => {
  const { error, formMessageId } = useFormField();
  // fix the array error message, origin formMessage only support string error
  let finalError = error;
  if (!finalError?.message) {
Severity: Minor
Found in packages/ui-lib/src/shadcn/ui/form.tsx - About 35 mins 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 RowCountProvider has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const RowCountProvider: FC<RowCountProviderProps> = ({ children }) => {
  const isHydrated = useIsHydrated();
  const { tableId, viewId } = useContext(AnchorContext);
  const queryClient = useQueryClient();
  const { searchQuery } = useSearch();
Severity: Minor
Found in packages/sdk/src/context/aggregation/RowCountProvider.tsx - About 35 mins 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 instanceReducer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function instanceReducer<T, R extends { id: string }>(
  state: IInstanceState<R>,
  action: IInstanceAction<T>,
  factory: (data: T, doc?: Doc<T>) => R
): IInstanceState<R> {
Severity: Minor
Found in packages/sdk/src/context/use-instances/reducer.ts - About 35 mins 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 QueryFromTableValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const QueryFromTableValue = ({
  from,
  onChange,
  component,
}: {
Severity: Minor
Found in packages/sdk/src/components/base-query/query-from/QueryFromValue.tsx - About 35 mins 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 useFilterNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const useFilterNode = (filters: IFilter | null | undefined, fields: IFieldInstance[]) => {
  const { t } = useTranslation();
  const generateFilterButtonText = useCallback(
    (filterIds: Set<string>, fields: IFieldInstance[]): string => {
      let text = filterIds.size ? t('filter.displayLabel') : '';
Severity: Minor
Found in packages/sdk/src/components/filter/view-filter/hooks/useFilterNode.ts - About 35 mins 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 FilterMultipleSelect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const FilterMultipleSelect = (props: IMultipleSelect) => {
  const { field, value, onSelect, className, popoverClassName } = props;
  const values = useMemo(() => {
    if (Array.isArray(value) && value.length) {
      return value;

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

export const useGridAsyncRecords = (
  initRecords?: IRecord[],
  initQuery?: IGetRecordsRo,
  outerQuery?: Pick<IGetRecordsRo, 'filter' | 'orderBy' | 'groupBy' | 'collapsedGroupIds'>,
  initGroupPoints?: IGroupPointsVo

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

export function useGridColumnOrder() {
  const fields = useFields();
  const view = useView();

  const onColumnOrdered = useCallback(

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

  get title() {
    if (!this.fieldMap) {
      return undefined;
    }
    if (!this._title) {
Severity: Minor
Found in packages/sdk/src/model/record/record.ts - About 35 mins 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 BaseMultipleSelect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function BaseMultipleSelect<V extends string, O extends IOption<V> = IOption<V>>(
  props: IBaseMultipleSelect<V, O>
) {
  const { t } = useTranslation();
  const {

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

export function mergeWithDefaultFilter(
  defaultViewFilter?: string | null,
  queryFilter?: IFilter
): IFilter | undefined {
  if (!defaultViewFilter && !queryFilter) {
Severity: Minor
Found in packages/core/src/models/view/filter/filter.ts - About 35 mins 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 minimizeFieldOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private minimizeFieldOptions(
    value: unknown,
    field: Pick<Field, 'type'> & {
      options: Record<string, unknown> | 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 transformUnaryNodeValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private transformUnaryNodeValue(typedValue: TypedValue) {
    if (!typedValue.field) {
      return typedValue;
    }

Severity: Minor
Found in packages/core/src/formula/visitor.ts - About 35 mins 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 visitFieldReferenceCurly has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  visitFieldReferenceCurly(ctx: FieldReferenceCurlyContext) {
    const originalText = ctx.text;
    let idOrName = originalText;

    if (originalText[0] === '{' && originalText[originalText.length - 1] === '}') {
Severity: Minor
Found in packages/core/src/formula/conversion.visitor.ts - About 35 mins 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 generateEventsFromRawOps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private generateEventsFromRawOps(rawOpMap: IRawOpMap, eventManager: Map<string, OpEvent>) {
    for (const collection in rawOpMap) {
      const [docType, docId] = collection.split('_') as [DocType, string];
      const data = rawOpMap[collection];

Severity: Minor
Found in apps/nestjs-backend/src/event-emitter/event-emitter.service.ts - About 35 mins 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 updateOrder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export async function updateOrder<T>(params: {
  query: T;
  position: 'before' | 'after';
  item: { id: string; order: number };
  anchorItem: { id: string; order: number };
Severity: Minor
Found in apps/nestjs-backend/src/utils/update-order.ts - About 35 mins 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 nullsToUndefinedShallow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function nullsToUndefinedShallow<T>(obj: T): IRecursivelyReplaceNullWithUndefined<T> {
  if (obj == null) {
    return undefined as any;
  }

Severity: Minor
Found in packages/core/src/convert/nulls-to-undefined.ts - About 35 mins 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 getDayjs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const getDayjs = (isoStr: string | null, timeZone: string, customFormat?: string) => {
  if (isoStr == null) return null;
  if (isDayjs(isoStr)) return isoStr;
  if (!isString(isoStr)) throw new FormulaBaseError();

Severity: Minor
Found in packages/core/src/formula/functions/date-time.ts - About 35 mins 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 convertDBValue2CellValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  convertDBValue2CellValue(value: unknown): unknown {
    if (this.isMultipleCellValue) {
      return value == null || typeof value === 'object' ? value : JSON.parse(value as string);
    }
    if (value instanceof Date) {
Severity: Minor
Found in apps/nestjs-backend/src/features/field/model/field-dto/date-field.dto.ts - About 35 mins 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