Showing 205 of 319 total issues
Function PopoverDemo
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function PopoverDemo() {
const [isOpen, setIsOpen] = useState(false);
const [name, setName] = useState('Balloon name');
const [editName, setEditName] = useState(name);
- Create a ticketCreate a ticket
Function mergeProps
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mergeProps<Key extends keyof ElementProps>(
userProps: (React.HTMLProps<Element> & ExtendedUserProps) | undefined,
propsList: Array<ElementProps | void>,
elementKey: Key,
): Record<string, unknown> {
- Create a ticketCreate a ticket
Function Flip
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Flip() {
const [boundary, setBoundary] = useState();
useEffect(() => {
if (boundary) {
- Create a ticketCreate a ticket
Function getBoundingClientRect
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
getBoundingClientRect() {
const domRect = domElement?.getBoundingClientRect() || {
width: 0,
height: 0,
x: 0,
- Create a ticketCreate a ticket
Function useFloatingPortalNode
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useFloatingPortalNode(props: UseFloatingPortalNodeProps = {}) {
const {id, root} = props;
const uniqueId = useId();
const portalContext = usePortalContext();
- Create a ticketCreate a ticket
Function Arrow
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Arrow() {
const [boundary, setBoundary] = useState();
return (
<GridItem
- Create a ticketCreate a ticket
Function deepEqual
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function deepEqual(a: any, b: any) {
if (a === b) {
return true;
}
- Create a ticketCreate a ticket
Function deepEqual
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function deepEqual(a: any, b: any) {
if (a === b) {
return true;
}
- Create a ticketCreate a ticket
Function refresh
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function refresh(skip = false, threshold = 1) {
cleanup();
const {left, top, width, height} = element.getBoundingClientRect();
- Create a ticketCreate a ticket
Function createController
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createController = (defaultView: Window): Controller => {
let selectedElement: HTMLElementWithMetadata | null = null;
const observer = new MutationObserver((mutations) => {
if (!selectedElement) {
return;
- Create a ticketCreate a ticket
Function FloatingDelayGroup
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FloatingDelayGroup(
props: FloatingDelayGroupProps,
): JSX.Element {
const {children, delay, timeoutMs = 0} = props;
- Create a ticketCreate a ticket
Function useListItem
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useListItem(props: UseListItemProps = {}): {
ref: (node: HTMLElement | null) => void;
index: number;
} {
const {label} = props;
- Create a ticketCreate a ticket
Function PopoverContent
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PopoverContent(props, propRef) {
const {context: floatingContext, ...context} =
usePopoverContext();
const ref = useMergeRefs([
context.refs.setFloating,
- Create a ticketCreate a ticket
Function focusItem
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
(
listRef: React.MutableRefObject<Array<HTMLElement | null>>,
indexRef: React.MutableRefObject<number>,
forceScrollIntoView = false,
) => {
- Create a ticketCreate a ticket
Function useFloating
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function useFloating(
options: UseFloatingOptions = {},
): UseFloatingReturn {
const {
placement = 'bottom',
- 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 ComboboxDemo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function ComboboxDemo() {
const [open, setOpen] = useState(false);
const [inputValue, setInputValue] = useState('');
const [activeIndex, setActiveIndex] = useState(null);
const [padding, setPadding] = useState(25);
- 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 getClippingElementAncestors
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function getClippingElementAncestors(
element: Element,
cache: PlatformWithCache['_c'],
): Array<Element> {
const cachedResult = cache.get(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 autoUpdate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function autoUpdate(
reference: ReferenceElement,
floating: FloatingElement,
update: () => void,
options: AutoUpdateOptions = {},
- 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 useDelayGroup
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useDelayGroup(
context: FloatingRootContext,
options: UseGroupOptions = {},
): GroupContext {
const {open, onOpenChange, floatingId} = context;
- Create a ticketCreate a ticket
Function getClippingElementAncestors
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getClippingElementAncestors(
element: Element,
cache: PlatformWithCache['_c'],
): Array<Element> {
const cachedResult = cache.get(element);
- Create a ticketCreate a ticket