Showing 205 of 319 total issues
Function FloatingPortal
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FloatingPortal(props: FloatingPortalProps): JSX.Element {
const {children, id, root = null, preserveTabOrder = true} = props;
const portalNode = useFloatingPortalNode({id, root});
const [focusManagerState, setFocusManagerState] =
- Create a ticketCreate a ticket
Function closeOnPressOutside
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
const closeOnPressOutside = useEffectEvent((event: MouseEvent) => {
// Given developers can stop the propagation of the synthetic event,
// we can only be confident with a positive value.
const insideReactTree = insideReactTreeRef.current;
insideReactTreeRef.current = false;
- Create a ticketCreate a ticket
Function useRole
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export function useRole(
context: FloatingRootContext,
props: UseRoleProps = {},
): ElementProps {
const {open, floatingId} = context;
- 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 fn
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fn(state) {
const {placement, rects, platform, elements} = state;
const {apply = () => {}, ...detectOverflowOptions} = evaluate(
options,
- Create a ticketCreate a ticket
Function arrow
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const arrow = (
options: ArrowOptions | Derivable<ArrowOptions>,
): Middleware => ({
name: 'arrow',
options,
- 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 computePosition
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const computePosition: ComputePosition = async (
reference,
floating,
config,
) => {
- 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 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyAttributeToOthers(
uncorrectedAvoidElements: Element[],
body: HTMLElement,
ariaHidden: boolean,
inert: boolean,
- Create a ticketCreate a ticket
File DropdownMenu.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
autoUpdate,
flip,
FloatingFocusManager,
FloatingNode,
- Create a ticketCreate a ticket
Function useTransitionStyles
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useTransitionStyles<RT extends ReferenceType = ReferenceType>(
context: FloatingContext<RT>,
props: UseTransitionStylesProps = {},
): {
isMounted: boolean;
- Create a ticketCreate a ticket
File composite.ts
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {stopEvent} from '@floating-ui/react/utils';
import {floor} from '@floating-ui/utils';
import type {Dimensions} from '../types';
- Create a ticketCreate a ticket
Function useHover
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function useHover(
context: FloatingRootContext,
props: UseHoverProps = {},
): ElementProps {
const {open, onOpenChange, dataRef, events, elements} = context;
- 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 autoUpdate
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function autoUpdate(
reference: ReferenceElement,
floating: FloatingElement,
update: () => void,
options: AutoUpdateOptions = {},
- Create a ticketCreate a ticket
Function TooltipContent
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TooltipContent(props, propRef) {
const {context: floatingContext, ...context} =
useTooltipContext();
const ref = useMergeRefs([
context.refs.setFloating,
- Create a ticketCreate a ticket
Function onKeyDown
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onKeyDown = useEffectEvent((event: React.KeyboardEvent) => {
function getMatchingIndex(
list: Array<string | null>,
orderedList: Array<string | null>,
string: string,
- Create a ticketCreate a ticket
Function useFloating
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function useFloating<T extends ReferenceElement = ReferenceElement>(
reference: Readonly<Ref<MaybeElement<T>>>,
floating: Readonly<Ref<MaybeElement<FloatingElement>>>,
options: UseFloatingOptions<T> = {},
): UseFloatingReturn {
- 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 observeMove
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function observeMove(element: Element, onMove: () => void) {
let io: IntersectionObserver | null = null;
let timeoutId: NodeJS.Timeout;
const root = getDocumentElement(element);
- 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 autoPlacement
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const autoPlacement = (
options: AutoPlacementOptions | Derivable<AutoPlacementOptions> = {},
): Middleware => ({
name: 'autoPlacement',
options,
- 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 useRole
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useRole(
context: FloatingRootContext,
props: UseRoleProps = {},
): ElementProps {
const {open, floatingId} = context;
- Create a ticketCreate a ticket
Function FloatingOverlay
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FloatingOverlay = React.forwardRef(function FloatingOverlay(
props: React.ComponentPropsWithoutRef<'div'> & FloatingOverlayProps,
ref: React.ForwardedRef<HTMLDivElement>,
) {
const {lockScroll = false, ...rest} = props;
- Create a ticketCreate a ticket
Function Result13
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Result13 = () => {
const [show, setShow] = useState(false);
const [arrowEl, setArrowEl] = useState(null);
const {
- Create a ticketCreate a ticket