Showing 671 of 671 total issues
Function useGraph
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useGraph = (ref: RefObject<HTMLDivElement>) => {
const graphRef = useRef<IGraph>();
const { resolvedTheme } = useTheme();
useEffect(() => {
- 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 SpaceInnerPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const SpaceInnerPage: React.FC = () => {
const router = useRouter();
const queryClient = useQueryClient();
const isCloud = useIsCloud();
const ref = 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
Consider simplifying this complex logical expression. Open
if (options && chunkCb) {
return new Promise((resolve, reject) => {
let isFirst = true;
let recordBuffer: unknown[][] = [];
let isAbort = false;
Consider simplifying this complex logical expression. Open
if (relationship === Relationship.ManyMany || relationship === Relationship.OneMany) {
const newCellValue = cellContext.newValue as ILinkCellValue[] | undefined;
const oldKey = foreignKeys?.map((key) => key.foreignId) ?? null;
const newKey = newCellValue?.map((item) => item.id) ?? null;
Consider simplifying this complex logical expression. Open
if (
enableGlobalErrorLogging ||
!(
exception instanceof BadRequestException ||
exception instanceof UnauthorizedException ||
Consider simplifying this complex logical expression. Open
if (typeof input === 'object' && input !== null) {
const obj = input as IObjectType;
return obj.id ?? obj.email ?? obj.title ?? obj.name ?? undefined;
}
Consider simplifying this complex logical expression. Open
if (!selection || !cell || !isCell || !tableId || !viewId || !baseId) {
return;
}
Function getParameterCollectionIn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const getParameterCollectionIn = function (openApi, path, method, location, values) {
Function getEndpointSnippets
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const getEndpointSnippets = function (openApi, path, method, targets, values) {
Function getViewAggregations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
tableId: string,
viewId: string,
funcs: StatisticsFunc,
fieldId: string[],
groupBy?: IGroup
Function getBaseUrl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getBaseUrl = function (openApi, path, method) {
if (openApi.paths[path][method].servers) return openApi.paths[path][method].servers[0].url;
if (openApi.paths[path].servers) return openApi.paths[path].servers[0].url;
if (openApi.servers) return openApi.servers[0].url;
- 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 drawGrid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const drawGrid = (
mainCanvas: HTMLCanvasElement,
cacheCanvas: HTMLCanvasElement,
props: ILayoutDrawerProps,
lastProps?: ILayoutDrawerProps
- 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 LinkEditorMainBase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const LinkEditorMainBase: ForwardRefRenderFunction<ILinkEditorMainRef, ILinkEditorMainProps> = (
props,
forwardRef
) => {
const { options, cellValue } = 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 ImagePreview
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const ImagePreview = () => {
const state = useImagePreviewState({ scrollSpeed: SCROLL_SPEED });
const {
closeProps,
- 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 HideFieldsBase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const HideFieldsBase = (props: IHideFieldsBaseProps) => {
const { fields, hidden, footer, children, onChange, onOrderChange } = props;
const { t } = useTranslation();
const fieldStaticGetter = useFieldStaticGetter();
- 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 CellValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const CellValue = (props: ICellValueContainer) => {
const { field, value, maxWidth, maxLine, className, itemClassName, formatImageUrl } = props;
const { type, options, cellValueType } = field;
switch (type) {
- 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 computeTextPositions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const computeTextPositions = ({
ctx,
data,
rect,
theme,
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
checkRegion: (cell: ILinkCell, props: ICellClickProps, _shouldCalculate?: boolean) => {
const { hoverCellPosition, width, height, isActive, theme, activeCellBound } = props;
const [hoverX, originHoverY] = hoverCellPosition;
const { fontSizeSM } = theme;
const { data } = cell;
- 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 getEslintFixCmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getEslintFixCmd = ({
cwd,
files,
rules,
fix,
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
draw: (cell: IImageCell, props: ICellRenderProps) => {
const { rect, columnIndex, rowIndex, theme, ctx, imageManager, isActive, spriteManager } =
props;
const { iconSizeSM, cellLineColor } = theme;
const { data, readonly } = cell;
- 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"