Showing 671 of 671 total issues
Function calculateComputeField
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private calculateComputeField(
field: IFieldInstance,
fieldMap: IFieldMap,
recordItem: IRecordItem,
userMap?: { [userId: string]: IUserInfoVo }
- Read upRead up
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 LinkOptions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const LinkOptions = (props: {
options: Partial<ILinkFieldOptionsRo> | undefined;
fieldId?: string;
isLookup?: boolean;
onChange?: (options: Partial<ILinkFieldOptionsRo>) => void;
- Read upRead up
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 BaseTrashPage
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const BaseTrashPage = () => {
const baseId = useBaseId() as string;
const isHydrated = useIsHydrated();
const queryClient = useQueryClient();
const permission = useBasePermission();
- Read upRead up
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 FieldMenu
has 326 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const FieldMenu = () => {
const isTouchDevice = useIsTouchDevice();
const view = useView() as GridView | undefined;
const { filter, sort, group } = view || {};
const tableId = useTableId();
File field-converting-link.service.ts
has 301 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { Injectable, InternalServerErrorException } from '@nestjs/common';
import type { ILinkCellValue, ILinkFieldOptions, IOtOperation } from '@teable/core';
import {
Relationship,
RelationshipRevert,
Function TableForm
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const TableForm = (props: {
config: ITableConfig;
onChange: (config: ITableConfig) => void;
}) => {
const { config, onChange } = props;
- Read upRead up
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 isPrintableKey
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const isPrintableKey = (event: KeyboardEvent) => {
const { keyCode } = event;
const { metaKey, ctrlKey } = event;
if (metaKey || ctrlKey || keyCode === KeyCode.Space) return false;
- Read upRead up
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 getPreviewSheetData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const getPreviewSheetData = (sheetData?: IWorksheetData['cellData']) => {
if (!sheetData) {
return sheetData;
}
- Read upRead up
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 BaseFilter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const BaseFilter = <T extends IConditionItemProperty>(props: IBaseFilterProps<T>) => {
const { t } = useTranslation();
const {
onChange,
maxDepth = 2,
- Read upRead up
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 QuerySelect
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const QuerySelect = (props: IQueryEditorProps<IBaseQuerySelect[]>) => {
const { value, onChange } = props;
const context = useContext(QueryEditorContext);
const [error, setError] = useState<string>();
const { registerValidator } = useContext(QueryFormContext);
- Read upRead up
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 calculateLookup
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private calculateLookup(
field: IFieldInstance,
lookedField: IFieldInstance,
recordItem: IRecordItem
) {
- Read upRead up
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 buildLinkCandidateQuery
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
async buildLinkCandidateQuery(
queryBuilder: Knex.QueryBuilder,
tableId: string,
dbTableName: string,
filterLinkCellCandidate: [string, string] | string
- Read upRead up
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 RecordMenu
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const RecordMenu = () => {
const { recordMenu, closeRecordMenu, selection } = useGridViewStore();
const { t } = useTranslation(tableConfig.i18nNamespaces);
const tableId = useTableId();
const view = useView();
- Read upRead up
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 getCellMetaData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected getCellMetaData(index: number, itemType: ItemType): ICellMetaData {
let cellMetadataMap, itemSize, lastMeasuredIndex, offset;
const isColumnType = itemType === ItemType.Column;
if (isColumnType) {
- Read upRead up
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 LinkEditorInnerBase
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const LinkEditorInnerBase: ForwardRefRenderFunction<ILinkEditorMainRef, ILinkEditorMainProps> = (
props,
forwardRef
) => {
const { recordId, fieldId, options, cellValue, isEditing, setEditing, onChange } = props;
- Read upRead up
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 drawChartLine
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const drawChartLine = (ctx: CanvasRenderingContext2D, props: IChartLineProps) => {
const {
x,
y,
width,
- Read upRead up
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 parseParametersToQuery
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const parseParametersToQuery = function (openApi, parameters, location, values) {
/** @type {Object.<string, HarParameterObject[]>} */
const queryStrings = {};
for (let i in parameters) {
- Read upRead up
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 useColumnResize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const useColumnResize = (coordInstance: CoordinateManager, scrollState: IScrollState) => {
const [hoveredColumnResizeIndex, setHoveredColumnResizeIndex] = useState(-1);
const [columnResizeState, setColumnResizeState] = useState<IColumnResizeState>(
DEFAULT_COLUMN_RESIZE_STATE
);
- Read upRead up
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 clearChangedTemplateValue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const clearChangedTemplateValue = (sheetData?: IWorksheetData['cellData']) => {
if (!sheetData) {
return {
cellData: sheetData,
deletedFields: [] as string[],
- Read upRead up
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 FilterLinkSelect
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const FilterLinkSelect = (props: FilterLinkSelectProps) => {
const { value, operator, onSelect, components, className } = props;
const { Trigger, List } = components || {};
const [open, setOpen] = useState(false);
- Read upRead up
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"