teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function RatingEditorBase has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

> = (props, ref) => {
  const { cell, onChange } = props;
  const focusRef = useRef<HTMLInputElement>(null);
  const [value, setValue] = useState<number | null>(cell.data);
  const [lastTime, setLastTime] = useState(0);
Severity: Minor
Found in packages/sdk/src/components/grid/components/editor/RatingEditor.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 filterDirectedGraph has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function filterDirectedGraph(
  undirectedGraph: IGraphItem[],
  fieldIds: string[]
): IGraphItem[] {
  const result: IGraphItem[] = [];
Severity: Minor
Found in apps/nestjs-backend/src/features/calculation/utils/dfs.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 topoOrderWithStart has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function topoOrderWithStart(startNodeId: string, graph: IGraphItem[]): string[] {
  const visitedNodes = new Set<string>();
  const sortedNodes: string[] = [];

  // Build adjacency list and reverse adjacency list
Severity: Minor
Found in apps/nestjs-backend/src/features/calculation/utils/dfs.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 diffLinkCellChange has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  private diffLinkCellChange(
    fieldMapByTableId: { [tableId: string]: IFieldMap },
    originRecordMapByTableId: IRecordMapByTableId,
    updatedRecordMapByTableId: IRecordMapByTableId
  ): ICellChange[] {
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 getPreviewUrlTokenMap has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  private async getPreviewUrlTokenMap(
    records: ISnapshotBase<IRecord>[],
    fields: IFieldInstance[],
    fieldKeyType: FieldKeyType
  ) {
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 ContentCard has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

const ContentCard = () => {
  const baseId = useBaseId() as string;
  const queryClient = useQueryClient();
  const { t } = useTranslation(tableConfig.i18nNamespaces);
  const { data, isLoading } = useQuery({
Severity: Minor
Found in apps/nextjs-app/src/features/app/blocks/db-connection/Panel.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 undo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  async undo(operation: IPasteSelectionOperation) {
    const { params, result } = operation;
    const { tableId } = params;
    const { updateRecords, newRecords, newFields } = result;

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

export const TableImport = (props: ITableImportProps) => {
  const base = useBase();
  const router = useRouter();
  const { t } = useTranslation(['table']);
  const [step, setStep] = useState(Step.UPLOAD);

    Function onMixedTextClick has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    export const onMixedTextClick = (type: SingleLineTextDisplayType, text: string) => {
      let url = '';
    
      if (type === SingleLineTextDisplayType.Url) {
        try {
    Severity: Minor
    Found in packages/sdk/src/components/editor/text/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 HideFields has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    }> = ({ footer, children }) => {
      const activeViewId = useViewId();
      const fields = useFields({ withHidden: true, withDenied: true });
      const view = useView() as GridView | undefined;
      const { t } = useTranslation();
    Severity: Minor
    Found in packages/sdk/src/components/hide-fields/HideFields.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 mixRanges has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    export const mixRanges = (ranges: IRange[], newRange: IRange): IRange[] => {
      const result: IRange[] = [];
      let added = false;
    
      for (const range of ranges) {
    Severity: Minor
    Found in packages/sdk/src/components/grid/utils/range.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 drawSprite has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      public drawSprite(ctx: CanvasRenderingContext2D, props: ISpriteDrawerProps) {
        const { sprite, variant = 'normal', x, y, size, alpha = 1, theme, colors } = props;
        const [fgColor, bgColor] = colors ?? getColors(variant, theme);
        const rSize = size * Math.ceil(window.devicePixelRatio);
        const key = `${bgColor}_${fgColor}_${rSize}_${sprite}`;

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

    export const reducer = (state: State, action: Action): State => {
      switch (action.type) {
        case 'ADD_TOAST':
          return {
            ...state,
    Severity: Minor
    Found in packages/ui-lib/src/shadcn/ui/use-toast.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 ChartTooltipContent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      (
        {
          active,
          payload,
          className,
    Severity: Minor
    Found in packages/ui-lib/src/shadcn/ui/chart.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 eval has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      eval(params: TypedValue<string | number | null>[], context: IFormulaContext): string | null {
        const startDate = getDayjs(params[0].value as string, context.timeZone);
    
        if (startDate == null) return null;
    
    
    Severity: Minor
    Found in packages/core/src/formula/functions/date-time.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 getCommentList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      async getCommentList(
        tableId: string,
        recordId: string,
        getCommentListQuery: IGetCommentListQueryRo
      ) {

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

      async cleanForeignKey(options: ILinkFieldOptions) {
        const { fkHostTableName, relationship, selfKeyName, foreignKeyName, isOneWay } = options;
        const dropTable = async (tableName: string) => {
          const alterTableSchema = this.knex.schema.dropTable(tableName);
    
    

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

      protected getFilterDateTimeRange(
        dateFieldOptions: IDateFieldOptions,
        filterValue: IDateFilter
      ): [string, string] {
        const filterValueByDate = dateFilterSchema.parse(filterValue);

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

      async performGroupedAggregation(params: {
        aggregations: IRawAggregations;
        statisticFields: IAggregationField[] | undefined;
        filter?: IFilter;
        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

    Function recordsPresignedUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      @Timing()
      private async recordsPresignedUrl(
        records: ISnapshotBase<IRecord>[],
        fields: IFieldInstance[],
        fieldKeyType: FieldKeyType
    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

    Severity
    Category
    Status
    Source
    Language