Showing 671 of 671 total issues
Function getPayloadConfigFromPayload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
if (typeof payload !== 'object' || payload === null) {
return 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 FormMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
>(({ className, children, ...props }, ref) => {
const { error, formMessageId } = useFormField();
// fix the array error message, origin formMessage only support string error
let finalError = error;
if (!finalError?.message) {
- 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 RowCountProvider
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const RowCountProvider: FC<RowCountProviderProps> = ({ children }) => {
const isHydrated = useIsHydrated();
const { tableId, viewId } = useContext(AnchorContext);
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 instanceReducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function instanceReducer<T, R extends { id: string }>(
state: IInstanceState<R>,
action: IInstanceAction<T>,
factory: (data: T, doc?: Doc<T>) => R
): IInstanceState<R> {
- 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 QueryFromTableValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const QueryFromTableValue = ({
from,
onChange,
component,
}: {
- 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 useFilterNode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useFilterNode = (filters: IFilter | null | undefined, fields: IFieldInstance[]) => {
const { t } = useTranslation();
const generateFilterButtonText = useCallback(
(filterIds: Set<string>, fields: IFieldInstance[]): string => {
let text = filterIds.size ? t('filter.displayLabel') : '';
- 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 FilterMultipleSelect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const FilterMultipleSelect = (props: IMultipleSelect) => {
const { field, value, onSelect, className, popoverClassName } = props;
const values = useMemo(() => {
if (Array.isArray(value) && value.length) {
return 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 useGridAsyncRecords
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useGridAsyncRecords = (
initRecords?: IRecord[],
initQuery?: IGetRecordsRo,
outerQuery?: Pick<IGetRecordsRo, 'filter' | 'orderBy' | 'groupBy' | 'collapsedGroupIds'>,
initGroupPoints?: IGroupPointsVo
- 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 useGridColumnOrder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function useGridColumnOrder() {
const fields = useFields();
const view = useView();
const onColumnOrdered = useCallback(
- 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 title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
get title() {
if (!this.fieldMap) {
return undefined;
}
if (!this._title) {
- 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 BaseMultipleSelect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function BaseMultipleSelect<V extends string, O extends IOption<V> = IOption<V>>(
props: IBaseMultipleSelect<V, O>
) {
const { t } = useTranslation();
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 mergeWithDefaultFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function mergeWithDefaultFilter(
defaultViewFilter?: string | null,
queryFilter?: IFilter
): IFilter | undefined {
if (!defaultViewFilter && !queryFilter) {
- 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 minimizeFieldOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private minimizeFieldOptions(
value: unknown,
field: Pick<Field, 'type'> & {
options: Record<string, 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 transformUnaryNodeValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private transformUnaryNodeValue(typedValue: TypedValue) {
if (!typedValue.field) {
return typedValue;
}
- 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 visitFieldReferenceCurly
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
visitFieldReferenceCurly(ctx: FieldReferenceCurlyContext) {
const originalText = ctx.text;
let idOrName = originalText;
if (originalText[0] === '{' && originalText[originalText.length - 1] === '}') {
- 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 generateEventsFromRawOps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private generateEventsFromRawOps(rawOpMap: IRawOpMap, eventManager: Map<string, OpEvent>) {
for (const collection in rawOpMap) {
const [docType, docId] = collection.split('_') as [DocType, string];
const data = rawOpMap[collection];
- 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 updateOrder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function updateOrder<T>(params: {
query: T;
position: 'before' | 'after';
item: { id: string; order: number };
anchorItem: { id: string; order: 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 nullsToUndefinedShallow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function nullsToUndefinedShallow<T>(obj: T): IRecursivelyReplaceNullWithUndefined<T> {
if (obj == null) {
return undefined as any;
}
- 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 getDayjs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const getDayjs = (isoStr: string | null, timeZone: string, customFormat?: string) => {
if (isoStr == null) return null;
if (isDayjs(isoStr)) return isoStr;
if (!isString(isoStr)) throw new FormulaBaseError();
- 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 convertDBValue2CellValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
convertDBValue2CellValue(value: unknown): unknown {
if (this.isMultipleCellValue) {
return value == null || typeof value === 'object' ? value : JSON.parse(value as string);
}
if (value instanceof Date) {
- 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"