asenka0301/frontend-bootcamp-project-12

View on GitHub

Showing 12 of 21 total issues

Function SignUpPage has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SignUpPage = () => {
  const auth = useAuth();
  const inputRef = useRef();
  const navigate = useNavigate();
  const { t } = useTranslation();
Severity: Major
Found in frontend/src/components/pages/SignUpPage.jsx - About 4 hrs to fix

    Function LoginPage has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const LoginPage = () => {
      const auth = useAuth();
      const inputRef = useRef();
      const navigate = useNavigate();
      const { t } = useTranslation();
    Severity: Major
    Found in frontend/src/components/pages/LoginPage.jsx - About 3 hrs to fix

      Function ChannelModal has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ChannelModal = (props) => {
        const { handleClose } = props;
        const socket = useSocket();
        const { t } = useTranslation();
        const inputRef = useRef();
      Severity: Major
      Found in frontend/src/components/modals/ChannelModal.jsx - About 2 hrs to fix

        Function SignUpPage has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        const SignUpPage = () => {
          const auth = useAuth();
          const inputRef = useRef();
          const navigate = useNavigate();
          const { t } = useTranslation();
        Severity: Minor
        Found in frontend/src/components/pages/SignUpPage.jsx - About 2 hrs to fix

        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 ModalRenameChannel has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ModalRenameChannel = (props) => {
          const { handleClose } = props;
          const socket = useSocket();
          const inputRef = useRef();
          const { t } = useTranslation();
        Severity: Major
        Found in frontend/src/components/modals/ModalRenameChannel.jsx - About 2 hrs to fix

          Function MessageForm has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const MessageForm = () => {
            const inputRef = useRef();
            const { t } = useTranslation();
            const socket = useSocket();
            const activeChannelId = useSelector((state) => {

            Function ChatPage has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ChatPage = () => {
              const auth = useAuth();
              const dispatch = useDispatch();
              const { t } = useTranslation();
            
            
            Severity: Major
            Found in frontend/src/components/pages/ChatPage/ChatPage.jsx - About 2 hrs to fix

              Function App has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const App = () => {
                const ruDictionary = leoProfanity.getDictionary('ru');
                leoProfanity.loadDictionary(ruDictionary);
                const socket = io();
                const dispatch = useDispatch();
              Severity: Minor
              Found in frontend/src/App.jsx - About 2 hrs to fix

                Function Channels has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Channels = () => {
                  const dispatch = useDispatch();
                  const channels = useSelector(channelsSelectors.selectAll);
                  const activeChannelId = useSelector((state) => {
                    const { currentChannelId } = state.channels;

                  Function ModalDeleteChannel has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ModalDeleteChannel = (props) => {
                    const { handleClose } = props;
                    const socket = useSocket();
                    const dispatch = useDispatch();
                    const { t } = useTranslation();
                  Severity: Minor
                  Found in frontend/src/components/modals/ModalDeleteChannel.jsx - About 1 hr to fix

                    Function DropdownChannel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const DropdownChannel = (props) => {
                      const { item, activeChannelId, handleClick } = props;
                    
                      const { t } = useTranslation();
                      const dispatch = useDispatch();

                      Function LoginPage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const LoginPage = () => {
                        const auth = useAuth();
                        const inputRef = useRef();
                        const navigate = useNavigate();
                        const { t } = useTranslation();
                      Severity: Minor
                      Found in frontend/src/components/pages/LoginPage.jsx - About 1 hr to fix

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language