Showing 671 of 671 total issues
Function updateForeignCellForManyOne
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private updateForeignCellForManyOne(params: {
fkItem: IFkRecordItem;
recordId: string;
symmetricFieldId: string;
sourceLookedFieldId: 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 convertUser
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const convertUser = (input: unknown): string | undefined => {
if (typeof input === 'string') return input;
if (Array.isArray(input)) {
if (input.every((item) => typeof item === '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 getDeletedFilterByFieldId
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getDeletedFilterByFieldId(filter: IFilterSet, fieldId: string) {
const removeItemsByFieldId = (filter: IFilterSet, fieldId: string) => {
if (Array.isArray(filter.filterSet)) {
filter.filterSet = filter.filterSet.filter((item) => {
if ('fieldId' in item && item.fieldId === fieldId) {
- 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 getRecordHistory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async getRecordHistory(
tableId: string,
recordId: string | undefined,
query: IGetRecordHistoryQuery
): Promise<IRecordHistoryVo> {
- 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 AccessSelect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const AccessSelect = (props: IFormAccess) => {
const { onChange, value } = props;
const { t } = useTranslation('token');
const [bases, setBases] = useState<string[]>(value?.baseIds || []);
const [spaces, setSpaces] = useState<string[]>(value?.spaceIds || []);
- 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 ChangePasswordDialog
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const ChangePasswordDialog = (props: IChangePasswordDialogProps) => {
const { children } = props;
const { t } = useTranslation('common');
const router = useRouter();
const { user } = useSession();
- 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
Consider simplifying this complex logical expression. Open
if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
const { prefix, decimal, suffix } = config.measure ?? {};
const totalDisplay = `${prefix ?? ''}${decimal ? total.toFixed(decimal) : total}${suffix ?? ''}`;
return (
<text
Consider simplifying this complex logical expression. Open
if (
oldField.type !== FieldType.LongText &&
newField.type !== FieldType.Rating &&
newField.cellValueType === oldField.cellValueType &&
newField.isMultipleCellValue !== true &&
Function getColumnStatisticData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const getColumnStatisticData = (
props: Pick<
IRenderLayerProps,
'height' | 'scrollState' | 'coordInstance' | 'columnStatistics' | 'getLinearRow'
> & {
- 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 UserEditorBaseRef
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const UserEditorBaseRef: ForwardRefRenderFunction<IUserEditorRef, IUserEditorBaseProps> = (
props,
ref
) => {
const {
- 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 ChartCombo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const ChartCombo = (props: { config: IComboConfig; defaultType?: IComboType }) => {
const { config, defaultType = 'bar' } = props;
const queryData = useBaseQueryData();
const chartConfig = useComboConfig(config, queryData?.columns);
- 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 draw
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
draw: (cell: ISelectCell, props: ICellRenderProps) => {
const { ctx, rect, theme, isActive, spriteManager } = props;
const { displayData, choiceMap, readonly } = cell;
const { x: _x, y: _y, width, height } = rect;
const clipEnable = !isActive && displayData.length;
- 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 GridSelectEditorBase
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const { field, record, rect, style, isEditing, setEditing } = props;
const tableId = useTableId();
const defaultFocusRef = useRef<HTMLInputElement | null>(null);
const editorRef = useRef<IEditorRef<string | string[] | undefined>>(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 GroupPointProvider
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const GroupPointProvider: FC<GroupPointProviderProps> = ({ children }) => {
const isHydrated = useIsHydrated();
const { tableId, viewId } = useContext(AnchorContext);
const queryClient = useQueryClient();
const view = useView(viewId);
- 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 replaceMeTagInValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private replaceMeTagInValue(
filterItem: IFilterItem,
field: IFieldInstance,
replaceUserId?: 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 visitBinaryOp
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
visitBinaryOp(ctx: BinaryOpContext) {
const leftNode = ctx.expr(0);
const rightNode = ctx.expr(1);
const left = this.visit(leftNode)!;
const right = this.visit(rightNode)!;
- 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 handleFieldProperty
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private async handleFieldProperty(fieldId: string, opContext: IOpContext) {
const { key, newValue } = opContext as ISetFieldPropertyOpContext;
if (key === 'options') {
if (!newValue) {
- 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 alterTableModifyFieldValidation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private async alterTableModifyFieldValidation(
fieldId: string,
key: 'unique' | 'notNull',
newValue?: boolean
) {
- 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 publishOpsMap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@Timing()
publishOpsMap(rawOpMaps: IRawOpMap[] | undefined) {
if (!rawOpMaps?.length) {
return;
}
- 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 performAggregation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async performAggregation(params: {
tableId: string;
withFieldIds?: string[];
withView?: IWithView;
search?: [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"