RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/room/hooks/useDateScroll.ts

Summary

Maintainability
C
1 day
Test Coverage

Function useDateScroll has 116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useDateScroll = (margin = 8): useDateScrollReturn => {
    const [bubbleDate, setBubbleDate] = useSafely(
        useState<{
            date: string;
            show: boolean;
Severity: Major
Found in apps/meteor/client/views/room/hooks/useDateScroll.ts - About 4 hrs to fix

    Function callbackRef has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            (node: HTMLElement | null) => {
                if (!node) {
                    return;
                }
                const bubbleOffset = bubbleRef.current?.getBoundingClientRect().bottom || 0;
    Severity: Major
    Found in apps/meteor/client/views/room/hooks/useDateScroll.ts - About 3 hrs to fix

      Function onScroll has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  const onScroll = (() => {
                      let timeout: ReturnType<typeof setTimeout>;
                      return (elements: Set<HTMLElement>) => {
                          clearTimeout(timeout);
      
      
      Severity: Major
      Found in apps/meteor/client/views/room/hooks/useDateScroll.ts - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status