Showing 671 of 671 total issues
Function AggregationProvider
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const AggregationProvider: FC<IAggregationProviderProps> = ({ children }) => {
const { tableId, viewId } = useContext(AnchorContext);
const view = useView(viewId);
const queryClient = useQueryClient();
const { searchQuery } = useSearch();
- 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 randomColor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
randomColor(exists?: string[], num = 1) {
const allColors = Object.values(Colors);
let availableColors = [...allColors];
if (exists) {
- 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 useGridColumnResize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function useGridColumnResize<T extends { id: string }>(_columns: T[]) {
const fields = useFields();
const view = useView();
const viewId = useViewId();
const [newSize, setNewSize] = useState<number>();
- 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 GridNumberEditorBase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const { field, record, rect, style, theme, cell, isEditing } = props;
const { cellLineColorActived } = theme;
const editorRef = useRef<IEditorRef<number>>(null);
const { width, height } = rect;
- 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 SortBase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const SortBase = forwardRef<ISortBaseRef, ISortBaseProps>((props, sortBaseRef) => {
const { children, manualSortLoading, sorts, hiddenManual, manualSortOnClick, onChange } = props;
const { t } = useTranslation();
const [isOpen, setIsOpen] = useState(false);
const { sortObjs, manualSort } = sorts || {};
- 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 build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
build(params: { fieldId: string; newCellValue: unknown; oldCellValue: unknown }): IOtOperation {
const { fieldId } = params;
let { newCellValue, oldCellValue } = params;
newCellValue = newCellValue ?? null;
oldCellValue = oldCellValue ?? null;
- 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 OrderSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function OrderSelect(props: IOrderProps) {
const { value, onSelect, fieldId } = props;
const { t } = useTranslation();
const fields = useFields({ withHidden: true, withDenied: true });
- 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 RecordEditorItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const RecordEditorItem = (props: {
field: Field;
record: Record | undefined;
vertical?: boolean;
onChange?: (newValue: unknown, fieldId: string) => 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 CellEditorMain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const CellEditorMain = (props: Omit<ICellValueEditor, 'wrapClassName' | 'wrapStyle'>) => {
const { field, recordId, cellValue, onChange, readonly, className, context } = props;
const tableId = useTableId();
const { id: fieldId, type, options } = field;
const editorRef = useRef<IEditorRef<unknown>>(null);
- 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 authenticate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
authenticate(req: any, options?: { pauseStream?: boolean }): void {
if (!req.session) {
return this.error(new Error('No session'));
}
options = options || {};
- 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 convertCellValue2DBValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
convertCellValue2DBValue(value: unknown): unknown {
if (this.isMultipleCellValue) {
return value == null ? value : JSON.stringify(value);
}
if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) {
- 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 buildAndApplyOp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private buildAndApplyOp(
otOperation: IOtOperation,
acc: object,
propertyCategory: string,
nodeId: 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 createCommentReaction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async createCommentReaction(
tableId: string,
recordId: string,
commentId: string,
reactionRo: { reaction: 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 prepareLookupOptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async prepareLookupOptions(field: IFieldRo, batchFieldVos?: IFieldVo[]) {
const { lookupOptions } = field;
if (!lookupOptions) {
throw new BadRequestException('lookupOptions is required');
}
- 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 mergeFilter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const mergeFilter = (filter1?: IFilter, filter2?: IFilter) => {
const parsedFilter1 = filterSchema.safeParse(filter1);
const finalFilter1 = parsedFilter1.success ? parsedFilter1.data : undefined;
const parsedFilter2 = filterSchema.safeParse(filter2);
const finalFilter2 = parsedFilter2.success ? parsedFilter2.data : undefined;
- 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 visitFunctionCall
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
visitFunctionCall(ctx: FunctionCallContext) {
const fnName = ctx.func_name().text.toUpperCase() as FunctionName;
const func = FUNCTIONS[fnName];
if (!func) {
throw new TypeError(`Function name ${func} is not found`);
- 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 shouldUpdateReference
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private shouldUpdateReference(newField: IFieldInstance, oldField: IFieldInstance) {
const keys = this.getOriginFieldKeys(newField, oldField);
// lookup options change
if (newField.isLookup && oldField.isLookup) {
- 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 prepareUserField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private prepareUserField(field: IFieldRo) {
const { name } = field;
const options: IUserFieldOptions = field.options || UserFieldCore.defaultOptions();
const { isMultiple } = options;
const defaultValue = options.defaultValue ? [options.defaultValue].flat() : undefined;
- 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 prepareCreateField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async prepareCreateField(tableId: string, fieldRo: IFieldRo, batchFieldVos?: IFieldVo[]) {
const field = (await this.prepareCreateFieldInner(tableId, fieldRo, batchFieldVos)) as IFieldVo;
const fieldId = field.id || generateFieldId();
const fieldName = await this.uniqFieldName(tableId, field.name);
- 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 getUserMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async getUserMap(userIds: string[]) {
const users = await this.prismaService.txClient().user.findMany({
where: { id: { in: userIds }, deletedTime: null },
select: {
id: true,
- 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"