Showing 205 of 319 total issues
Function serialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const serialize = <Data extends object>(
data: Data,
references: References,
): Serialized<Data> => {
const serializedData: Serialized<Data> = JSON.parse(
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if (runs < 2) {
const scheduler = runs ? requestAnimationFrame : queueMicrotask;
scheduler(waitForListPopulated);
}
- Create a ticketCreate a ticket
Function Chrome
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const Chrome = ({
children,
center,
scrollable = 'none',
relative = true,
- Read upRead up
- Create a ticketCreate a ticket
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 computeCoordsFromPlacement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function computeCoordsFromPlacement(
{reference, floating}: ElementRects,
placement: Placement,
rtl?: boolean,
): Coords {
- Read upRead up
- Create a ticketCreate a ticket
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 detectOverflow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export async function detectOverflow(
state: MiddlewareState,
options: DetectOverflowOptions | Derivable<DetectOverflowOptions> = {},
): Promise<SideObject> {
const {x, y, platform, rects, elements, strategy} = state;
- Read upRead up
- Create a ticketCreate a ticket
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 (
path.includes('react') ||
path.includes('use') ||
path.includes('floating') ||
path.includes('composite') ||
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
listContent == null ||
ignoreKeysRef.current.includes(event.key) ||
// Character key.
event.key.length !== 1 ||
- Create a ticketCreate a ticket
Function getCellIndexOfCorner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
index: number,
sizes: Dimensions[],
cellMap: (number | undefined)[],
cols: number,
corner: 'tl' | 'tr' | 'bl' | 'br',
- Create a ticketCreate a ticket
Function useFloatingRootContext
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function useFloatingRootContext(
options: UseFloatingRootContextOptions,
): FloatingRootContext {
const {
open = false,
- Read upRead up
- Create a ticketCreate a ticket
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 getScale
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getScale(element: Element | VirtualElement): Coords {
const domElement = unwrapElement(element);
if (!isHTMLElement(domElement)) {
return createCoords(1);
- Read upRead up
- Create a ticketCreate a ticket
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 NavbarItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function NavbarItem({
url,
title,
icon: Icon,
hide,
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid too many return
statements within this function. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return close();
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return a !== a && b !== b;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return false;
- Create a ticketCreate a ticket