teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function PinList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const PinList = () => {
  const [pinList, setPinList] = useState<GetPinListVo>([]);
  const queryClient = useQueryClient();
  const { t } = useTranslation(spaceConfig.i18nNamespaces);

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

export const UserOptions = (props: {
  options: Partial<IUserFieldOptions> | undefined;
  isLookup?: boolean;
  cellValueType?: CellValueType;
  onChange?: (options: Partial<IUserFieldOptions>) => 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 OAuthScope has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const OAuthScope = (props: {
  scopes?: string[];
  description?: string | ReactNode;
  className?: string;
}) => {
Severity: Minor
Found in apps/nextjs-app/src/features/app/components/oauth/OAuthScope.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

Consider simplifying this complex logical expression.
Open

        if (linearRowType === LinearRowType.Group) {
          const { id, depth } = linearRow;
          const text = columnStatistics[columnId ?? name]?.[id];

          const labelWidth = isFirstColumn

    Consider simplifying this complex logical expression.
    Open

        if (
          isLink(newField) &&
          isLink(oldField) &&
          !isEqual(newField.options, oldField.options) &&
          newField.options.foreignTableId === oldField.options.foreignTableId &&

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

        draw: (cell: IRatingCell, props: ICellRenderProps) => {
          const { data, icon, color, max, readonly } = cell;
          const { ctx, theme, rect, hoverCellPosition, spriteManager } = props;
          const { x, y, width, height } = rect;
          const [hoverX, hoverY] = hoverCellPosition ?? [0, 0];

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

      export const UserEditor = (props: IUserEditorProps) => {
        const { value, options, onChange, className, style, readonly, ...reset } = props;
        const [open, setOpen] = useState(false);
        const selectRef = useRef<HTMLButtonElement>(null);
      
      
      Severity: Minor
      Found in packages/sdk/src/components/editor/user/Editor.tsx - 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 Container has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const Container = (props: IPageProps & { uiConfig?: IUIConfig }) => {
        const { baseId, pluginInstallId, uiConfig } = props;
        const [isIframeMode, setIsIframeMode] = useState(true);
        const pluginBridge = usePluginBridge();
        const { i18n, t } = useTranslation();
      Severity: Minor
      Found in plugins/src/app/sheet-form-view/components/Pages.tsx - 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 SheetView has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const SheetView = () => {
        const fields = useFields({ withHidden: true, withDenied: true });
        const view = useView();
        const viewId = view?.id;
        const tableId = useTableId();
      Severity: Minor
      Found in plugins/src/app/sheet-form-view/components/SheetView.tsx - 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 DateEditorBase has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const DateEditorBase: ForwardRefRenderFunction<IEditorRef<string>, IDateEditorMain> = (
        props,
        ref
      ) => {
        const { value, onChange, className, readonly, options, disableTimePicker = false } = props;
      Severity: Minor
      Found in packages/sdk/src/components/editor/date/Editor.tsx - 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 getVisibleCollaborators has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const getVisibleCollaborators = (
        collaborators: ICollaborator,
        visibleRegion: IVisibleRegion,
        freezeColumnCount: number,
        getCellContent: (cell: ICellItem) => ICell

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

      export const insertSingle = (
        insertAt: number,
        totalSize: number,
        getOrder: (index: number) => number,
        isInsertAfter: boolean = true
      Severity: Minor
      Found in packages/sdk/src/utils/order.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 CommentEditor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const CommentEditor = (props: ICommentEditorProps) => {
        const { tableId, recordId } = props;
        const editorRef = useRef({
          focus: noop,
          blur: noop,
      Severity: Minor
      Found in packages/sdk/src/components/comment/comment-editor/CommentEditor.tsx - 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 useGridViewStore has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const useGridViewStore = create<IGridViewState>((set) => ({
        openHeaderMenu: (props) => {
          set((state) => {
            return {
              ...state,
      Severity: Minor
      Found in packages/sdk/src/components/grid-enhancements/store/useGridViewStore.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 refineOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const refineOptions = (
        data: {
          type: FieldType;
          isLookup?: boolean;
          lookupOptions?: ILookupOptionsRo;
      Severity: Minor
      Found in packages/core/src/models/field/field.schema.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 formatNumberToString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const formatNumberToString = (value: number | undefined, formatting: INumberFormatting) => {
        if (value == null) {
          return '';
        }
      
      
      Severity: Minor
      Found in packages/core/src/models/field/formatting/number.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 stringLiteral has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        public stringLiteral(): StringLiteralContext {
          const _localctx: StringLiteralContext = new StringLiteralContext(this._ctx, this.state);
          this.enterRule(_localctx, 24, Query.RULE_stringLiteral);
          let _la: number;
          try {
      Severity: Minor
      Found in packages/core/src/query/parser/Query.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 getFileIcon has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const getFileIcon = (mimetype: string) => {
        if (isImage(mimetype)) {
          return FileImage;
        }
        if (isPdf(mimetype)) {
      Severity: Minor
      Found in packages/ui-lib/src/base/file/preview/getFileIcon.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 isOp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        public isOp(): IsOpContext {
          const _localctx: IsOpContext = new IsOpContext(this._ctx, this.state);
          this.enterRule(_localctx, 12, Query.RULE_isOp);
          let _la: number;
          try {
      Severity: Minor
      Found in packages/core/src/query/parser/Query.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 FilePreviewContent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const FilePreviewContent = (props: { container?: HTMLElement | null }) => {
        const { container } = props;
        const { files, currentFile, openPreview, closePreview, onPrev, onNext } =
          useContext(FilePreviewContext);
        const { name, fileId, src } = currentFile || {};
      Severity: Minor
      Found in packages/ui-lib/src/base/file/preview/FilePreviewContent.tsx - 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

      Severity
      Category
      Status
      Source
      Language