Showing 205 of 319 total issues
Function useClientPoint
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function useClientPoint(
context: FloatingRootContext,
props: UseClientPointProps = {},
): ElementProps {
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 Floating
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function Floating({
children,
content,
strategy: strategyOption,
tooltipStyle = {},
- 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 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const computePosition: ComputePosition = async (
reference,
floating,
config,
) => {
- Create a ticketCreate a ticket
Function getBoundingClientRect
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getBoundingClientRect() {
// There are two rects and they are disjoined.
if (
clientRects.length === 2 &&
clientRects[0].left > clientRects[1].right &&
- Create a ticketCreate a ticket
Function detectOverflow
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function detectOverflow(
state: MiddlewareState,
options: DetectOverflowOptions | Derivable<DetectOverflowOptions> = {},
): Promise<SideObject> {
const {x, y, platform, rects, elements, strategy} = state;
- Create a ticketCreate a ticket
Function fn
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fn(state) {
const {x, y, placement, rects, platform, elements, middlewareData} = state;
// Since `element` is required, we don't Partial<> the type.
const {element, padding = 0} = evaluate(options, state) || {};
- Create a ticketCreate a ticket
Function observeMove
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function observeMove(element: Element, onMove: () => void) {
let io: IntersectionObserver | null = null;
let timeoutId: NodeJS.Timeout;
const root = getDocumentElement(element);
- Create a ticketCreate a ticket
File Popover.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
arrow,
autoUpdate,
flip,
FloatingArrow,
- Create a ticketCreate a ticket
Function createVirtualElement
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createVirtualElement(
domElement: Element | null | undefined,
data: {
axis: 'x' | 'y' | 'both';
dataRef: React.MutableRefObject<ContextData>;
- Create a ticketCreate a ticket
Function useFloatingRootContext
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useFloatingRootContext(
options: UseFloatingRootContextOptions,
): FloatingRootContext {
const {
open = false,
- Create a ticketCreate a ticket
Function SomethingWentWrong
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SomethingWentWrong = (props: SomethingWentWrongProps) => {
const [currentSerializedData] = useSerializedData();
const {inspectDocument: resetInspection} = useDevtools();
const handleReload = React.useCallback(
- Create a ticketCreate a ticket
Function getBoundingClientRect
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getBoundingClientRect(
element: Element | VirtualElement,
includeScale = false,
isFixedStrategy = false,
offsetParent?: Element | Window,
- Create a ticketCreate a ticket
Function useFloating
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function useFloating<RT extends ReferenceType = ReferenceType>(
options: UseFloatingOptions = {},
): UseFloatingReturn<RT> {
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 createController
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const createController = (defaultView: Window): Controller => {
let selectedElement: HTMLElementWithMetadata | null = null;
const observer = new MutationObserver((mutations) => {
if (!selectedElement) {
return;
- 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 FloatingFocusManager
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function FloatingFocusManager(
props: FloatingFocusManagerProps,
): JSX.Element {
const {
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 Shift
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Shift() {
const [boundary, setBoundary] = useState();
useEffect(() => {
if (boundary) {
- Create a ticketCreate a ticket
Function Result12
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Result12 = () => {
const [arrowEl, setArrowEl] = useState(null);
const {
refs,
- Create a ticketCreate a ticket
Function DialogContent
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DialogContent(props, propRef) {
const {context: floatingContext, ...context} =
useDialogContext();
const ref = useMergeRefs([
context.refs.setFloating,
- Create a ticketCreate a ticket
Function handleFocusOutside
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleFocusOutside(event: FocusEvent) {
const relatedTarget = event.relatedTarget as Element | null;
queueMicrotask(() => {
const movedToUnrelatedNode = !(
- Create a ticketCreate a ticket
Function getBoundingClientRect
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function getBoundingClientRect(
element: Element | VirtualElement,
includeScale = false,
isFixedStrategy = false,
offsetParent?: Element | Window,
- 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"