justsega/frontend-bootcamp-project-12

View on GitHub

Showing 10 of 16 total issues

Function AddModal has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AddModal = (props) => {
  const { closeModal, show } = props;
  const inputField = useRef();
  useEffect(() => {
    inputField.current.focus();
Severity: Major
Found in frontend/src/components/modals/add/AddModal.jsx - About 2 hrs to fix

    Function Messages has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Messages = () => {
      const { t } = useTranslation();
      const username = useAuth().getUserName();
      const { activeChannelId } = useSelector((state) => state.channels);
      const activeChannel = useSelector(
    Severity: Minor
    Found in frontend/src/components/messages/Messages.jsx - About 1 hr to fix

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

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

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

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

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

          const Channels = () => {
            const channels = useSelector(selectors.selectAll);
            const { activeChannelId } = useSelector((state) => state.channels);
            return (
              <Col className="col-4 col-md-2 border-end px-0 bg-light flex-column h-100 d-flex">
          Severity: Minor
          Found in frontend/src/components/channels/Channels.jsx - About 1 hr to fix

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

            const MainChatPage = () => {
              const { t } = useTranslation();
              const dispatch = useDispatch();
              const auth = useAuth();
            
            
            Severity: Minor
            Found in frontend/src/components/MainChatPage.jsx - About 1 hr to fix

              Function SignUp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const SignUp = () => {
                const { t } = useTranslation();
                const navigate = useNavigate();
                const auth = useAuth();
                const formik = useFormik({
              Severity: Minor
              Found in frontend/src/components/signUp/SignUp.jsx - About 1 hr to fix

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                      <Modal.Header closeButton>
                        <Modal.Title>{t('modals.removeModal.title')}</Modal.Title>
                      </Modal.Header>
                Severity: Major
                Found in frontend/src/components/modals/remove/RemoveModal.jsx and 2 other locations - About 45 mins to fix
                frontend/src/components/modals/add/AddModal.jsx on lines 51..53
                frontend/src/components/modals/rename/RenameModal.jsx on lines 48..50

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                      <Modal.Header closeButton>
                        <Modal.Title>{t('modals.renameModal.title')}</Modal.Title>
                      </Modal.Header>
                Severity: Major
                Found in frontend/src/components/modals/rename/RenameModal.jsx and 2 other locations - About 45 mins to fix
                frontend/src/components/modals/add/AddModal.jsx on lines 51..53
                frontend/src/components/modals/remove/RemoveModal.jsx on lines 38..40

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                      <Modal.Header closeButton>
                        <Modal.Title>{t('modals.addModal.title')}</Modal.Title>
                      </Modal.Header>
                Severity: Major
                Found in frontend/src/components/modals/add/AddModal.jsx and 2 other locations - About 45 mins to fix
                frontend/src/components/modals/remove/RemoveModal.jsx on lines 38..40
                frontend/src/components/modals/rename/RenameModal.jsx on lines 48..50

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language