Showing 208 of 322 total issues
File PackageSelect.js
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Composite,
CompositeItem,
FloatingArrow,
FloatingFocusManager,
- Create a ticketCreate a ticket
Function commonOnKeyDown
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
const commonOnKeyDown = useEffectEvent((event: React.KeyboardEvent) => {
isPointerModalityRef.current = false;
forceSyncFocus.current = true;
// If the floating element is animating out, ignore navigation. Otherwise,
- Create a ticketCreate a ticket
Function useFocus
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export function useFocus(
context: FloatingRootContext,
props: UseFocusProps = {},
): ElementProps {
const {open, onOpenChange, events, dataRef, 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 useTypeahead
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export function useTypeahead(
context: FloatingRootContext,
props: UseTypeaheadProps,
): ElementProps {
const {open, dataRef} = 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 getPolygon
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPolygon([x, y]: Point): Array<Point> {
switch (side) {
case 'top': {
const cursorPointOne: Point = [
isFloatingWider
- Create a ticketCreate a ticket
Function useFloating
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useFloating<RT extends ReferenceType = ReferenceType>(
options: UseFloatingOptions = {},
): UseFloatingReturn<RT> {
const {
placement = 'bottom',
- Create a ticketCreate a ticket
Function flip
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
export const flip = (
options: FlipOptions | Derivable<FlipOptions> = {},
): Middleware => ({
name: 'flip',
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 useFloating
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useFloating(
options: UseFloatingOptions = {},
): UseFloatingReturn {
const {
placement = 'bottom',
- Create a ticketCreate a ticket
Function ComboboxDemo
has 145 lines of code (exceeds 25 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);
- Create a ticketCreate a ticket
Function Placement
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Placement() {
const [placement, setPlacement] = useState('top');
return (
<GridItem
- Create a ticketCreate a ticket
Function SelectDemo
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function SelectDemo() {
const [isOpen, setIsOpen] = useState(false);
const [activeIndex, setActiveIndex] = useState(null);
const [selectedIndex, setSelectedIndex] = useState(null);
- Create a ticketCreate a ticket
Function useTypeahead
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useTypeahead(
context: FloatingRootContext,
props: UseTypeaheadProps,
): ElementProps {
const {open, dataRef} = context;
- Create a ticketCreate a ticket
File tailwind.config.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
const colors = require('tailwindcss/colors');
const {fontFamily} = require('tailwindcss/defaultTheme');
const GRAY = {
...colors.gray,
- Create a ticketCreate a ticket
Function size
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const size = (
options: SizeOptions | Derivable<SizeOptions> = {},
): Middleware => ({
name: 'size',
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 deepEqual
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function deepEqual(a: any, b: any) {
if (a === b) {
return true;
}
- 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 deepEqual
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function deepEqual(a: any, b: any) {
if (a === b) {
return true;
}
- 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 reference
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reference: ElementProps['reference'] = React.useMemo(() => {
function checkVirtualMouse(event: React.PointerEvent) {
if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {
focusItemOnOpenRef.current = true;
}
- Create a ticketCreate a ticket
File useHover.ts
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
contains,
getDocument,
isMouseLikePointerType,
} from '@floating-ui/react/utils';
- Create a ticketCreate a ticket
Function Canvas
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Canvas() {
const canvasRef = useRef(null);
const [width, setWidth] = useState(null);
const [height, setHeight] = useState(null);
- Create a ticketCreate a ticket
Function handleKeyDown
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleKeyDown(event: React.KeyboardEvent<HTMLElement>) {
if (!allKeys.includes(event.key)) return;
let nextIndex = activeIndex;
const minIndex = getMinIndex(elementsRef, disabledIndices);
- Create a ticketCreate a ticket