Showing 205 of 319 total issues
Function Size
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Size() {
return (
<GridItem
title="Size"
titleClass="text-green-500 dark:text-green-300"
- Create a ticketCreate a ticket
Function getElementRects
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
getElementRects({
reference,
floating,
}: {
reference: View | VirtualElement;
- Create a ticketCreate a ticket
Function fn
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fn(state) {
const {rects} = state;
const {strategy = 'referenceHidden', ...detectOverflowOptions} = evaluate(
options,
- Create a ticketCreate a ticket
Function convertOffsetParentRelativeRectToViewportRelativeRect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function convertOffsetParentRelativeRectToViewportRelativeRect({
elements,
rect,
offsetParent,
strategy,
- 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 buildCellMap
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function buildCellMap(
sizes: Dimensions[],
cols: number,
dense: boolean,
) {
- Create a ticketCreate a ticket
Function getRectRelativeToOffsetParent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getRectRelativeToOffsetParent(
element: Element | VirtualElement,
offsetParent: Element | Window,
strategy: Strategy,
): Rect {
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
(side === 'top' && y >= refRect.bottom - 1) ||
(side === 'bottom' && y <= refRect.top + 1) ||
(side === 'left' && x >= refRect.right - 1) ||
(side === 'right' && x <= refRect.left + 1)
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
clientRects.length === 2 &&
clientRects[0].left > clientRects[1].right &&
x != null &&
y != null
- Create a ticketCreate a ticket
Function onMouseLeave
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onMouseLeave(event: MouseEvent) {
if (isClickLikeOpenEvent()) return;
unbindMouseMoveRef.current();
- Create a ticketCreate a ticket
Function FloatingList
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FloatingList(props: FloatingListProps): JSX.Element {
const {children, elementsRef, labelsRef} = props;
const [map, setMap] = React.useState(() => new Map<Node, number | null>());
- Create a ticketCreate a ticket
Function useFloating
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function useFloating<RT extends ReferenceType = ReferenceType>(
options: UseFloatingOptions = {},
): UseFloatingReturn<RT> {
const {nodeId} = 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 Layout
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function Layout({children, className}) {
const {pathname, events, asPath} = useRouter();
const index = nav.findIndex(({url}) => url === pathname) ?? 0;
const [navOpen, setNavOpen] = useState(false);
const [anchors, setAnchors] = useState([]);
- 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 getOffsetParent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function getOffsetParent(
element: Element,
polyfill?: Polyfill,
): Element | Window {
const win = getWindow(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 contains
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function contains(parent?: Element | null, child?: Element | null) {
if (!parent || !child) {
return false;
}
- 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 getOffsetParent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getOffsetParent(
element: Element,
polyfill?: Polyfill,
): Element | Window {
const win = getWindow(element);
- Create a ticketCreate a ticket
Function Link
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Link = forwardRef(function Link(props, ref) {
const {setPageTransitionStatus, setArticleTransitionStatus} =
useAppContext();
const router = useRouter();
- Create a ticketCreate a ticket
Function position
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const position = useCallback(() => {
if (width === null || height === null) return;
computePosition(reference, floating, {
platform: {
- Create a ticketCreate a ticket
Function App
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function App() {
const arrowRef = React.useRef(null);
useFloating();
const {update, refs, elements} = useFloating({
placement: 'right',
- Create a ticketCreate a ticket
Function item
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const item = React.useMemo(() => {
function syncCurrentTarget(currentTarget: HTMLElement | null) {
if (!open) return;
const index = listRef.current.indexOf(currentTarget);
if (index !== -1) {
- Create a ticketCreate a ticket
Function onKeyDown
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onKeyDown(event: KeyboardEvent) {
if (event.key === 'Tab') {
// The focus guards have nothing to focus, so we need to stop the event.
if (
contains(
- Create a ticketCreate a ticket