Showing 95 of 332 total issues
Function useFieldValidation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
useLeaf: (key: ErrorsKey) => [ErrorsData, (updater: Updater<ErrorsData>) => void],
useCheck: (validator: Validator) => UseValidationResult<ValidationError[], ValidationResult>,
key: ErrorsKey,
value: unknown,
validator?: Validator
Function useForm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
useRecord: (val: Record<K, unknown>, onChange: (val: RecordData<K>) => void) => RootProviderDesc,
useValidation: (
v: Record<K, unknown>,
validator?: RecordValidator
) => { errorsRoot: RootProviderDesc; recursiveValidate: RecordValidator },
Function toPages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function toPages<T>(base: AsyncIterable<T>, itemsPerPage: number): AsyncIterable<T[]> {
return {
async *[Symbol.asyncIterator]() {
let page: T[] = []
// eslint-disable-next-line no-restricted-syntax
- 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 AllDayDateTimeRangeAction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const AllDayDateTimeRangeAction = (props: DateTimeRangeActionProps): JSX.Element => {
const { startDate, endDate, itemIndex, setDateRanges, dateRanges, targetPayload, targetUrl, submitChange, name } =
props
const handleButtonClick = (): 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 mountComponents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const mountComponents = ({
setInitialValue,
submitChange,
resourceName,
mainDetailObject,
- 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 withSortingInHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function withSortingInHeader(OrderHandler: ComponentType<SortHandlerProps>): TablePlugin<SortingProps> {
return {
after: (normalizedProps) => {
const { orderedColumnNames, ordering, onOrderChange, ...restTableProps } = normalizedProps.table
const result = {
- 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 Button
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const Button = (props: ButtonProps): JSX.Element => {
const { onClick, isDisabled: initialDisabled } = props
const [isDisabled, setIsDisabled] = usePropState<boolean>(initialDisabled || false)
const isMountedRef = useIsMounted()
- 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 get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
get(cacheKey: string, cacheTime: number = this.cacheTime): any {
if (cacheTime > 0) {
const cached = this.keySpace[cacheKey] || undefined
if (cached !== undefined) {
if (cached.cachedTime + cacheTime * 1000 > Date.now()) {
- 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 Pagination
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Pagination = makeWithLayout(({ value: page, onChange, totalCount }: PaginationProps) => {
const isFirst = page === 1
const isLast = page === totalCount
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 getPathRule
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getPathRule = (rules: TPathRules, pathElement: string, leftPathElement: string | undefined): TPathRule => {
let pathRule: TPathRule = { link: '#', text: 'error' }
const pathRulesArray = Object.values(rules)
for (let i = 0; i < pathRulesArray.length; i += 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 useForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function useForm<K extends FieldKey>(
useRecord: (val: Record<K, unknown>, onChange: (val: RecordData<K>) => void) => RootProviderDesc,
useValidation: (
v: Record<K, unknown>,
validator?: RecordValidator
- 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 UploadButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function UploadButton({
onSelect,
onUpload,
label = 'Прикрепить ещё один файл',
buttonProps,
- 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 modifyStyles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const modifyStyles = <OptionType extends OptionTypeBase, IsMulti extends boolean>(
externalStyles?: StylesConfig<OptionType, IsMulti>
): StylesConfig<OptionType, IsMulti> => ({
...externalStyles,
valueContainer(prevStyles, 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 getBreadcrumbs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getBreadcrumbs = (rules: TPathRules, pathname: string): TBreadcrumbElement[] => {
let pathElements = pathname.split('/')
if (pathElements[pathElements.length - 1] === '') {
pathElements = pathElements.slice(0, pathElements.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 ReadOnlyWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ReadOnlyWidget = (props: ReadOnlyWidgetProps): JSX.Element => {
const {
containerStore,
style,
helpText,
- 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"