Showing 671 of 671 total issues
Function buildCompressedAdjacencyMap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function buildCompressedAdjacencyMap(
graph: IGraphItem[],
linkIdSet: Set<string>
): IAdjacencyMap {
const adjMap = buildAdjacencyMap(graph);
- 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 getLinkOrderFromTopoOrders
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getLinkOrderFromTopoOrders(params: {
topoOrders: ITopoItem[];
fieldMap: IFieldMap;
}): ITopoLinkOrder[] {
const newOrder: ITopoLinkOrder[] = [];
- 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 buildFilterSortQuery
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async buildFilterSortQuery(
tableId: string,
query: Pick<
IGetRecordsRo,
| '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 LogoEditor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const LogoEditor = (props: {
value?: string;
onChange: (value?: string | null) => void;
}) => {
const { value, onChange } = 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 MoreLinkOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const MoreLinkOptions = (props: IMoreOptionsProps) => {
const {
foreignTableId = '',
fieldId,
filterByViewId,
- 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 KanbanViewOperators
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const KanbanViewOperators: React.FC<{ disabled?: boolean }> = (props) => {
const { disabled } = props;
const tableId = useTableId();
const view = useView() as KanbanView | undefined;
const allFields = useFields({ withHidden: true, withDenied: true });
- 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 ViewListItem
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const ViewListItem: React.FC<IProps> = ({ view, removable, isActive }) => {
const [isEditing, setIsEditing] = useState(false);
const tableId = useTableId();
const router = useRouter();
const baseId = router.query.baseId as 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 GeneralPage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const GeneralPage = () => {
const router = useRouter();
const queryClient = useQueryClient();
const { t } = useTranslation(spaceConfig.i18nNamespaces);
const spaceId = router.query.spaceId as 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 getDropTargetIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const getDropTargetIndex = (
coordInstance: CoordinateManager,
mouseState: IMouseState,
scrollState: IScrollState,
dragType: DragRegionType
- 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 FileZone
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const FileZone = (props: IFileZoneProps) => {
const { t } = useTranslation();
const {
className,
- 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 CellNumber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const CellNumber = (props: ICellNumber) => {
const { value, formatting, maxLine, className, style } = props;
const displayValue = useMemo(() => {
if (value == null) 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 checkIsRowHeader
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const checkIsRowHeader = (props: ICheckRegionProps): IRegionData | null => {
const { position, theme, rowControls, scrollState, coordInstance } = props;
const { x, y, rowIndex, columnIndex } = position;
if (rowIndex <= -1 || columnIndex !== -1) return 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 draw
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
draw: (cell: IChartCell, props: ICellRenderProps) => {
const { ctx, rect, theme, hoverCellPosition } = props;
const { rowHeaderTextColor: lineColor, fontFamily } = theme;
const { x, y, width, height } = rect;
const { data, displayData, chartType = ChartType.Line, color = lineColor } = 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 drawStatisticCell
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const drawStatisticCell = (
ctx: CanvasRenderingContext2D,
props: IGroupStatisticDrawerProps
) => {
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 SelectEditorBase
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const { value, options = [], isMultiple, onChange, className, style, readonly } = props;
const [open, setOpen] = useState(false);
const selectRef = useRef<HTMLButtonElement>(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 getParameterValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const getParameterValues = function (openApi, param, location, values) {
let value = 'SOME_' + (param.type || param.schema.type || param.schema.anyOf[0].type).toUpperCase() + '_VALUE';
if (location === 'path') {
// then default to the original place holder value (e.b. '{id}')
value = `{${param.name}}`;
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
draw: (cell: IUserCell, props: ICellRenderProps) => {
const { ctx, rect, theme, imageManager, columnIndex, rowIndex } = props;
const { data: userSets } = cell;
const { x: _x, y: _y, width, height } = rect;
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 drawColumnHeaders
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const drawColumnHeaders = (
ctx: CanvasRenderingContext2D,
props: ILayoutDrawerProps,
renderRegion: RenderRegion
// eslint-disable-next-line sonarjs/cognitive-complexity
- 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 drawCollaborators
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const drawCollaborators = (ctx: CanvasRenderingContext2D, props: ILayoutDrawerProps) => {
const {
collaborators,
scrollState,
coordInstance,
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
draw: (cell: IBooleanCell, props: ICellRenderProps) => {
const { data, isMultiple, contentAlign = 'center' } = cell;
const { ctx, rect, theme } = props;
const { x, y, width, height } = rect;
const { iconSizeSM, staticWhite, iconBgSelected, rowHeaderTextColor } = 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"