Showing 205 of 319 total issues
Function useTransitionStatus
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useTransitionStatus(
context: FloatingContext,
props: UseTransitionStatusProps = {},
): {
isMounted: boolean;
- Create a ticketCreate a ticket
Function closeOnEscapeKeyDown
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
(event: React.KeyboardEvent<Element> | KeyboardEvent) => {
if (!open || !enabled || !escapeKey || event.key !== 'Escape') {
return;
}
- Create a ticketCreate a ticket
Function onMeasure
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onMeasure = (offsetX = 0, offsetY = 0) => {
floating.measure(
(x: number, y: number, width: number, height: number) => {
const floatingRect = {width, height, ...ORIGIN};
const method = sameScrollView ? 'measure' : 'measureInWindow';
- Create a ticketCreate a ticket
Function deep
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deep(parent: Element | null) {
if (!parent || elementsToStop.has(parent)) {
return;
}
- Create a ticketCreate a ticket
Function arrow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const arrow = (
options: ArrowOptions | Derivable<ArrowOptions>,
): Middleware => {
function isRef(value: unknown): value is React.MutableRefObject<unknown> {
return {}.hasOwnProperty.call(value, 'current');
- 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 Link
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const Link = forwardRef(function Link(props, ref) {
const {setPageTransitionStatus, setArticleTransitionStatus} =
useAppContext();
const router = useRouter();
- 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 arrow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const arrow = (
options: ArrowOptions | Derivable<ArrowOptions>,
): Middleware => {
function isRef(value: unknown) {
return {}.hasOwnProperty.call(value, 'current');
- 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 _extends
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function _extends() {
const _extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
- 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 useListItem
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function useListItem(props: UseListItemProps = {}): {
ref: (node: HTMLElement | null) => void;
index: number;
} {
const {label} = props;
- 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 applyAttributeToOthers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function applyAttributeToOthers(
uncorrectedAvoidElements: Element[],
body: HTMLElement,
ariaHidden: boolean,
inert: boolean,
- 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 generateBase64Images
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function generateBase64Images() {
try {
const files = await fs.readdir(publicPath);
const imageFiles = files.filter((file) => {
const extension = path.extname(file).toLowerCase();
- Create a ticketCreate a ticket
Function reference
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reference: ElementProps['reference'] = React.useMemo(() => {
function setPointerRef(event: React.PointerEvent) {
pointerTypeRef.current = event.pointerType;
}
- Create a ticketCreate a ticket
Function onBlur
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
onBlur(event) {
blockFocusRef.current = false;
const relatedTarget = event.relatedTarget;
const nativeEvent = event.nativeEvent;
- Create a ticketCreate a ticket
Function a
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
a(props) {
const className =
'transition-colors inline-flex items-center border-none underline ' +
'underline-offset-4 text-rose-600 dark:text-rose-300 hover:text-gray-1000 dark:hover:text-gray-50 ' +
'decoration-rose-500/80 dark:decoration-rose-300/70 ' +
- Create a ticketCreate a ticket
Function getDocumentRect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getDocumentRect(element: HTMLElement): Rect {
const html = getDocumentElement(element);
const scroll = getNodeScroll(element);
const body = element.ownerDocument.body;
- Create a ticketCreate a ticket
Function fn
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
fn: (state: MiddlewareState) => {
const {[ELEMENT_METADATA]: metadata} = isHTMLElementWithMetadata(
state.elements.floating,
)
? state.elements.floating
- Create a ticketCreate a ticket
Function Menu
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const MenuComponent = forwardRef(function Menu(
{children, label, ...props},
forwardedRef,
) {
const [isOpen, setIsOpen] = useState(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 getRectRelativeToOffsetParent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function getRectRelativeToOffsetParent(
element: Element | VirtualElement,
offsetParent: Element | Window,
strategy: Strategy,
): Rect {
- 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 getOverflowAncestors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function getOverflowAncestors(
node: Node,
list: OverflowAncestors = [],
traverseIframes = true,
): OverflowAncestors {
- 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 isContainingBlock
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function isContainingBlock(element: Element): boolean {
const webkit = isWebKit();
const css = getComputedStyle(element);
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
- 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"