teableio/teable

View on GitHub

Showing 671 of 671 total issues

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

}> = ({ onClick, done, type, parsedResult }) => {
  const [ref, { width, height }] = useMeasure<HTMLDivElement>();
  const [taskDone, setTaskDone] = React.useState(false);
  const isGenerateChart = type === 'chart';

Severity: Minor
Found in apps/nextjs-app/src/features/app/components/ai-chat/ProcessBar.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 NotificationList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const NotificationList: React.FC<NotificationListProps> = (props) => {
  const { notifyStatus, data, className, hasNextPage, isFetchingNextPage, onShowMoreClick } = props;
  const { t } = useTranslation('common');
  const queryClient = useQueryClient();
  const dayjs = useLanDayjs();

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

const DraggableBaseGrid = (props: IDraggableBaseGridProps) => {
  const { bases } = props;
  const queryClient = useQueryClient();
  const isHydrated = useIsHydrated();
  const [innerBases, setInnerBases] = useState<IGetBaseAllVo>([]);
Severity: Minor
Found in apps/nextjs-app/src/features/app/blocks/space/DraggableBaseGrid.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 PinItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const PinItem = (props: IPinItemProps) => {
  const { className, pin, baseMap, spaceMap, right } = props;
  const router = useRouter();

  switch (pin.type) {
Severity: Minor
Found in apps/nextjs-app/src/features/app/blocks/space/space-side-bar/PinItem.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 UsageLimitModal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const UsageLimitModal = () => {
  const base = useBase();
  const router = useRouter();
  const { t } = useTranslation('common');
  const { modalType, modalOpen, toggleModal } = useUsageLimitModalStore();
Severity: Minor
Found in apps/nextjs-app/src/features/app/components/billing/UsageLimitModal.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 MessageInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const MessageInput: React.FC<Props> = ({ disabled, sendMessage, chat }) => {
  const [value, setValue] = useState<string>('');
  const [isInIME, setIsInIME] = useState(false);
  const textareaRef = useRef<HTMLTextAreaElement>(null);
  const messageStore = useMessageStore();
Severity: Minor
Found in apps/nextjs-app/src/features/app/components/ai-chat/MessageInput.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 MultiNumberShowAs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const MultiNumberShowAs: React.FC<IMultiNumberShowAsProps> = (props) => {
  const { showAs, onChange } = props;
  const { type, color } = (showAs || {}) as IMultiNumberShowAs;
  const selectedType = showAs == null ? numberFlag : type;
  const { t } = useTranslation(tableConfig.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

Avoid too many return statements within this function.
Open

    return 0;
Severity: Major
Found in packages/openapi/src/openapi-snippet/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return (
            <CellSelect
              value={value as ISingleSelectCellValue | IMultipleSelectCellValue}
              options={transformSelectOptions(options.choices)}
              className={className}
    Severity: Major
    Found in packages/sdk/src/components/cell-value/CellValue.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return <CellCheckbox value={value as boolean | boolean[]} className={className} />;
      Severity: Major
      Found in packages/sdk/src/components/cell-value/CellValue.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return { ...BLANK_REGION_DATA, type: RegionType.RowHeader };
        Severity: Major
        Found in packages/sdk/src/components/grid/utils/region.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return {
                success: true,
                data: { accessToken: token.data.accessToken },
              };
          Severity: Major
          Found in plugins/src/app/api/backend.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return <Spin />;
            Severity: Major
            Found in plugins/src/app/chart/components/Pages.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return <CellCheckbox value={value as boolean | boolean[]} className={className} />;
              Severity: Major
              Found in packages/sdk/src/components/cell-value/CellValue.tsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return (
                          <CellNumber
                            value={value as number}
                            formatting={options.formatting as INumberFormatting}
                            className={className}
                Severity: Major
                Found in packages/sdk/src/components/cell-value/CellValue.tsx - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return Response.json({ error: `getToken: ${res.error}` }, { status: 401 });
                  Severity: Major
                  Found in plugins/src/app/api/plugin/getToken/route.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return onChange?.(isMultiple && cv ? [...cv, ...newValues] : newValues);
                    Severity: Major
                    Found in packages/sdk/src/components/editor/link/LinkList.tsx - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return null;
                      Severity: Major
                      Found in packages/sdk/src/components/grid/utils/region.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return null;
                        Severity: Major
                        Found in packages/sdk/src/components/grid/utils/region.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return <CellText value={value as string} className={className} />;
                          Severity: Major
                          Found in packages/sdk/src/components/cell-value/CellValue.tsx - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language