Showing 208 of 322 total issues
Function createVirtualElement
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function createVirtualElement(
domElement: Element | null | undefined,
data: {
axis: 'x' | 'y' | 'both';
dataRef: React.MutableRefObject<ContextData>;
- 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 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fn(state) {
const {
placement,
middlewareData,
rects,
- Create a ticketCreate a ticket
File safePolygon.ts
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {contains, getTarget} from '@floating-ui/react/utils';
import {isElement} from '@floating-ui/utils/dom';
import type {Rect, Side} from './types';
import type {HandleCloseFn} from './hooks/useHover';
import {getChildren} from './utils/getChildren';
- Create a ticketCreate a ticket
Function useClick
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useClick(
context: FloatingRootContext,
props: UseClickProps = {},
): ElementProps {
const {
- Create a ticketCreate a ticket
Function FloatingArrow
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FloatingArrow = React.forwardRef(function FloatingArrow(
props: FloatingArrowProps,
ref: React.ForwardedRef<SVGSVGElement>,
): React.JSX.Element | null {
const {
- Create a ticketCreate a ticket
Function inline
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const inline = (
options: InlineOptions | Derivable<InlineOptions> = {},
): Middleware => ({
name: 'inline',
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 useClientPoint
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useClientPoint(
context: FloatingRootContext,
props: UseClientPointProps = {},
): ElementProps {
const {
- Create a ticketCreate a ticket
Function useFloating
has 109 lines of code (exceeds 25 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 {
- Create a ticketCreate a ticket
File Tutorial.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
arrow,
flip,
offset,
shift,
- Create a ticketCreate a ticket
File useDismiss.ts
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
contains,
getDocument,
getTarget,
isEventTargetWithin,
- Create a ticketCreate a ticket
Function useFocus
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useFocus(
context: FloatingRootContext,
props: UseFocusProps = {},
): ElementProps {
const {open, onOpenChange, events, dataRef, elements} = context;
- Create a ticketCreate a ticket
Function useFloating
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useFloating<RT extends ReferenceType = ReferenceType>(
options: UseFloatingOptions = {},
): UseFloatingReturn<RT> {
const {nodeId} = options;
- Create a ticketCreate a ticket
Function FloatingArrow
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const FloatingArrow = React.forwardRef(function FloatingArrow(
props: FloatingArrowProps,
ref: React.ForwardedRef<SVGSVGElement>,
): React.JSX.Element | null {
const {
- 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 Virtual
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Virtual() {
const [open, setOpen] = useState(false);
const boundaryRef = useRef();
const pointerTypeRef = useRef();
const {x, y, refs, update} = useFloating({
- Create a ticketCreate a ticket
Function onKeyDown
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
onKeyDown(event) {
isPointerModalityRef.current = false;
const isArrowKey = event.key.indexOf('Arrow') === 0;
const isCrossOpenKey = isCrossOrientationOpenKey(
- Create a ticketCreate a ticket
Function FloatingPortal
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FloatingPortal(props: FloatingPortalProps): React.JSX.Element {
const {children, id, root = null, preserveTabOrder = true} = props;
const portalNode = useFloatingPortalNode({id, root});
const [focusManagerState, setFocusManagerState] =
- Create a ticketCreate a ticket
Function FloatingUIMiddleware
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FloatingUIMiddleware = React.memo(function FloatingUIMiddleware() {
const devtools = useDevtools();
const serializedData = useSerializedData('FloatingUIMiddleware');
const [index, setIndex] = React.useState(serializedData.length - 1);
const handleIndexChange = React.useCallback(
- Create a ticketCreate a ticket
File Combobox.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
autoUpdate,
flip,
FloatingFocusManager,
FloatingPortal,
- Create a ticketCreate a ticket
Function fn
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fn(state) {
const {placement, elements, rects, platform, strategy} = state;
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
// ClientRect's bounds, despite the event listener being triggered. A
// padding of 2 seems to handle this issue.
- Create a ticketCreate a ticket
Function FluentUIMiddleware
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FluentUIMiddleware = React.memo(() => {
const serializedData = useSerializedData('FluentUIMiddleware');
const devtools = useDevtools();
const styles = useStyles();
const [index, setIndex] = React.useState(serializedData.length - 1);
- Create a ticketCreate a ticket