teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function getDefaultValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private getDefaultValue(type: FieldType, options: unknown, defaultValue: unknown) {
    switch (type) {
      case FieldType.Date:
        return defaultValue === 'now' ? new Date().toISOString() : defaultValue;
      case FieldType.SingleSelect:

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

  private async createDBTable(baseId: string, tableRo: ICreateTableRo) {
    const userId = this.cls.get('user.id');
    const tableRaws = await this.prismaService.txClient().tableMeta.findMany({
      where: { baseId, deletedTime: null },
      select: { name: true, order: true },
Severity: Minor
Found in apps/nestjs-backend/src/features/table/table.service.ts - About 55 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 SelectOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const SelectOptions = (props: {
  isMultiple: boolean;
  options: Partial<ISelectFieldOptions> | undefined;
  isLookup?: boolean;
  onChange?: (options: Partial<ISelectFieldOptions>) => 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

Avoid deeply nested control flow statements.
Open

          switch (authScheme) {
            case 'bearer':
              oauthDef = secScheme;
              break;
            case 'basic':
Severity: Major
Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 45 mins to fix

    Function VisibleFields has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    }> = ({ footer, children }) => {
      const activeViewId = useViewId();
      const totalFields = useFields({ withHidden: true, withDenied: true });
      const view = useView() as KanbanView | undefined;
      const columnMeta = view?.columnMeta;
    Severity: Minor
    Found in packages/sdk/src/components/hide-fields/VisibleFields.tsx - About 45 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

    Avoid deeply nested control flow statements.
    Open

                    if (typeof sample[key] !== 'string') {
                      value = JSON.stringify(sample[key]);
                    }
    Severity: Major
    Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (sample === undefined) return null;
      Severity: Major
      Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 45 mins to fix

        Function Container has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const Container = (props: IPageParams & { uiConfig?: IUIConfig }) => {
          const { baseId, positionId: dashboardId, pluginInstallId, uiConfig } = props;
          const [isIframeMode, setIsIframeMode] = useState(true);
          const pluginBridge = usePluginBridge();
          const { t } = useTranslation();
        Severity: Minor
        Found in plugins/src/app/chart/components/Pages.tsx - About 45 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 drawCacheContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const drawCacheContent = (
          cacheCanvas: HTMLCanvasElement | undefined,
          props: ICacheDrawerProps
        ) => {
          if (!cacheCanvas) return;

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

        export const drawActiveCell = (ctx: CanvasRenderingContext2D, props: ILayoutDrawerProps) => {
          const {
            theme,
            mouseState,
            scrollState,

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

        export const drawColumnHeader = (ctx: CanvasRenderingContext2D, props: IFieldHeadDrawerProps) => {
          const { x, y, width, height, theme, fill, column, hasMenu, spriteManager } = props;
          const { name, icon, description, hasMenu: hasColumnMenu, isPrimary } = column;
          const {
            cellLineColor,

        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

        Avoid deeply nested control flow statements.
        Open

                  if (secDefinition.in === 'header') {
                    apiKeyAuthDef = secDefinition;
                  }
        Severity: Major
        Found in packages/openapi/src/openapi-snippet/openapi-to-har.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if (library === client.key) {
                      validLibrary = true;
                      break;
                    }
          Severity: Major
          Found in packages/openapi/src/openapi-snippet/index.js - About 45 mins to fix

            Function useColumnFreeze has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            export const useColumnFreeze = (coordInstance: CoordinateManager, scrollState: IScrollState) => {
              const [columnFreezeState, setColumnFreezeState] = useState<IColumnFreezeState>(
                DEFAULT_FREEZE_COLUMN_STATE
              );
            
            
            Severity: Minor
            Found in packages/sdk/src/components/grid/hooks/useColumnFreeze.ts - About 45 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 drawRect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            export const drawRect = (ctx: CanvasRenderingContext2D, props: IRectProps) => {
              const { x, y, width, height, fill, stroke, radius: _radius } = props;
            
              ctx.beginPath();
              if (fill) ctx.fillStyle = fill;
            Severity: Minor
            Found in packages/sdk/src/components/grid/renderers/base-renderer/baseRenderer.ts - About 45 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 measure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              measure: (cell: ISelectCell, props: ICellMeasureProps) => {
                const { displayData, readonly } = cell;
                const { ctx, theme, width, height } = props;
                const { cellTextColor, fontSizeXS, iconSizeSM, iconSizeXS } = theme;
            
            

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

              public likeOp(): LikeOpContext {
                const _localctx: LikeOpContext = new LikeOpContext(this._ctx, this.state);
                this.enterRule(_localctx, 14, Query.RULE_likeOp);
                let _la: number;
                try {
            Severity: Minor
            Found in packages/core/src/query/parser/Query.ts - About 45 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 numberLiteral has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              public numberLiteral(): NumberLiteralContext {
                const _localctx: NumberLiteralContext = new NumberLiteralContext(this._ctx, this.state);
                this.enterRule(_localctx, 26, Query.RULE_numberLiteral);
                let _la: number;
                try {
            Severity: Minor
            Found in packages/core/src/query/parser/Query.ts - About 45 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 booleanLiteral has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              public booleanLiteral(): BooleanLiteralContext {
                const _localctx: BooleanLiteralContext = new BooleanLiteralContext(this._ctx, this.state);
                this.enterRule(_localctx, 28, Query.RULE_booleanLiteral);
                let _la: number;
                try {
            Severity: Minor
            Found in packages/core/src/query/parser/Query.ts - About 45 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 valueList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              public valueList(): ValueListContext {
                const _localctx: ValueListContext = new ValueListContext(this._ctx, this.state);
                this.enterRule(_localctx, 20, Query.RULE_valueList);
                let _la: number;
                try {
            Severity: Minor
            Found in packages/core/src/query/parser/Query.ts - About 45 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