RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx

Summary

Maintainability
A
2 hrs
Test Coverage

Function useMessageBody has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useMessageBody = (message: IMessage | undefined, rid: string): string | Root => {
    const subscription = useUserSubscription(rid);
    const autoTranslateOptions = useAutoTranslate(subscription);
    const customDomains = useAutoLinkDomains();

Severity: Minor
Found in apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

                    return attachment.title;
    Severity: Major
    Found in apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return '';
      Severity: Major
      Found in apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status