Showing 671 of 671 total issues
Avoid too many return
statements within this function. Open
return {
...res,
props: {
...(await res.props),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Avoid too many return
statements within this function. Open
return {
notFound: true,
};
Avoid too many return
statements within this function. Open
return a.pos - b.pos;
Function VirtualizedInfiniteTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const VirtualizedInfiniteTable = <T extends { [key: string]: unknown }>(
props: IVirtualizedInfiniteTableProps<T>
) => {
const { rows, columns, className, fetchNextPage } = props;
const { t } = useTranslation();
- 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 OverflowTooltip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const OverflowTooltip = (props: IOverflowTooltipProps) => {
const { text = '', maxLine = 1, className, tooltipClassName, onClick } = props;
const [isOverflow, setOverflow] = useState(false);
const contentRef = useRef<HTMLDivElement>(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 checkRegion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
checkRegion: (cell: IImageCell, props: ICellClickProps, _shouldCalculate?: boolean) => {
const { data, readonly } = cell;
const { width, height, theme, isActive, hoverCellPosition } = props;
const editable = !readonly && isActive;
- 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 getSnippetsForTargets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getSnippetsForTargets = function (targets, snippet, mimeType) {
const snippets = [];
for (let j in targets) {
const target = formatTarget(targets[j]);
if (!target) throw new Error('Invalid target: ' + targets[j]);
- 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 TextEditorBase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TextEditorBase: ForwardRefRenderFunction<IEditorRef<string>, ITextEditor> = (props, ref) => {
const { value, options, onChange, className, readonly, style, saveOnBlur = true } = props;
const [text, setText] = useState<string>(value || '');
const inputRef = useRef<HTMLInputElement | null>(null);
const showAs = options.showAs;
- 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 InfiniteTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const InfiniteTable = <T extends { [key: string]: unknown }>(
props: IInfiniteTableProps<T>
) => {
const { rows, columns, className, fetchNextPage } = 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 loadImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private loadImage(url: string, col: number, row: number, key: string) {
let loaded = false;
const img = imgPool.pop() ?? new Image();
let canceled = 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 expand
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public expand(range: IRange): CombinedSelection {
switch (this.type) {
case SelectionRegionType.Rows:
case SelectionRegionType.Columns: {
let hasOverlap = 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 CodeEditorBase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CodeEditorBase: ForwardRefRenderFunction<ICodeEditorRef, ICodeEditorProps> = (props, ref) => {
const { value = '', extensions = emptyExtensions, onChange, onSelectionChange } = props;
const editorRef = useRef<HTMLDivElement | null>(null);
const editorViewRef = useRef<EditorView | null>(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 binarySearchIndexPoint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const binarySearchIndexPoint = (
indexPoints: IGroupIndexCollection[],
targetIndex: number
): IGroupIndexCollection | null => {
let low = 0;
- 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 useCommentCountMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useCommentCountMap = (query?: IGetRecordsRo) => {
const tableId = useTableId();
const viewId = useViewId();
- 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 getParamsIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getParamsIndex() {
const pathSize = this.pathNodes.length;
const nearestFuncIndex = this.getNearestFunctionNodeIndex();
if (nearestFuncIndex > -1 && pathSize) {
const funcNode = this.pathNodes[nearestFuncIndex] as FunctionCallContext;
- 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 drawGridHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const drawGridHeader = (ctx: CanvasRenderingContext2D, props: IGridHeaderDrawerProps) => {
const { x, y, width, height, theme, rowControls, isChecked, isMultiSelectionEnable } = props;
const {
iconSizeXS,
staticWhite,
- 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 UniverSheet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const UniverSheet = forwardRef<IUniverSheetRef, IUniverSheetProps>((props, ref) => {
const {
toolbarVisible = true,
footerVisible = false,
validate = 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 findNearestCellIndexBinary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private findNearestCellIndexBinary(
offset: number,
low: number,
high: number,
itemType: ItemType
- 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 checkRegion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
checkRegion: (cell: IRatingCell, props: ICellClickProps, shouldCalculate?: boolean) => {
const { data, max, readonly } = cell;
if (readonly) return { type: CellRegionType.Blank };
const { hoverCellPosition, height, theme } = props;
const [x, y] = hoverCellPosition;
- 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 SearchProvider
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const SearchProvider: React.FC<ISearchProviderProps> = ({ children }) => {
const [fieldId, setFieldId] = useState<string | undefined>();
const [value, setValue] = useState<string | undefined>();
const reset = 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"