redaktorscha/frontend-project-12

View on GitHub

Showing 11 of 31 total issues

Function SignupForm has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SignupForm = () => {
  const { t } = useTranslation();
  const navigate = useNavigate();
  const { logIn } = useAuth();
  const rollbar = useRollbar();
Severity: Major
Found in frontend/src/components/Signup.jsx - About 6 hrs to fix

    Function LoginForm has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const LoginForm = () => {
      const { t } = useTranslation();
      const navigate = useNavigate();
      const { logIn } = useAuth();
      const rollbar = useRollbar();
    Severity: Major
    Found in frontend/src/components/Login.jsx - About 4 hrs to fix

      Function RenameChannelModal has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const RenameChannelModal = () => {
        const { renameChannel } = useChatApi();
        const dispatch = useDispatch();
        const { t } = useTranslation();
        const { handleClose } = modalActions;
      Severity: Major
      Found in frontend/src/components/modals/RenameChannelModal.jsx - About 2 hrs to fix

        Function DeleteChannelModal has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DeleteChannelModal = () => {
          const { removeChannel } = useChatApi();
          const [isSubmitting, setIsSubmitting] = useState(false);
          const dispatch = useDispatch();
          const { t } = useTranslation();
        Severity: Major
        Found in frontend/src/components/modals/DeleteChannelModal.jsx - About 2 hrs to fix

          Function Chat has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Chat = () => {
            const [isLoading, setIsLoading] = useState(true);
            const { user, logOut } = useAuth();
            const { t } = useTranslation();
          
          
          Severity: Major
          Found in frontend/src/components/Chat.jsx - About 2 hrs to fix

            Function LoginForm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            const LoginForm = () => {
              const { t } = useTranslation();
              const navigate = useNavigate();
              const { logIn } = useAuth();
              const rollbar = useRollbar();
            Severity: Minor
            Found in frontend/src/components/Login.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

            Function SignupForm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            const SignupForm = () => {
              const { t } = useTranslation();
              const navigate = useNavigate();
              const { logIn } = useAuth();
              const rollbar = useRollbar();
            Severity: Minor
            Found in frontend/src/components/Signup.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

            Function Sidebar has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Sidebar = () => {
              const { t } = useTranslation();
              const dispatch = useDispatch();
              const [btnFocused, setBtnFocused] = useState(false);
              const { type } = useSelector((state) => state.modal);
            Severity: Minor
            Found in frontend/src/components/Sidebar.jsx - About 1 hr to fix

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

              const Login = () => {
                const { t } = useTranslation();
                return (
                  <Container fluid>
                    <Row className="justify-content-center align-items-center">
              Severity: Minor
              Found in frontend/src/components/Login.jsx - About 1 hr to fix

                Function Main has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Main = () => {
                  const { t } = useTranslation();
                  const currentChannelId = useSelector((state) => state.channels.currentChannelId) || null;
                  const currentChannel = useSelector((state) => channelSelectors
                    .selectById(state, currentChannelId)) || null;
                Severity: Minor
                Found in frontend/src/components/Main.jsx - About 1 hr to fix

                  Function RenameChannelModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const RenameChannelModal = () => {
                    const { renameChannel } = useChatApi();
                    const dispatch = useDispatch();
                    const { t } = useTranslation();
                    const { handleClose } = modalActions;
                  Severity: Minor
                  Found in frontend/src/components/modals/RenameChannelModal.jsx - About 25 mins 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