EscolaLMS/Front

View on GitHub

Showing 559 of 559 total issues

Function RegisterPage has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RegisterPage = () => {
  const { search } = useLocation();
  const { user, socialAuthorize } = useContext(EscolaLMSContext);
  const [view, setView] = useState<"" | "success" | "register">("");
  const [modalVisible, setModalVisible] = useState(false);
Severity: Major
Found in src/pages/register/index.tsx - About 5 hrs to fix

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

      const taskCreateBy = [
        {
          id: 0,
          content: (
            <IconText
    Severity: Major
    Found in src/pages/user/MyTasks/index.tsx and 1 other location - About 5 hrs to fix
    src/pages/user/MyTasks/index.tsx on lines 51..76

    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 146.

    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 2 locations. Consider refactoring.
    Open

      const sortType = [
        {
          id: 0,
          content: (
            <IconText
    Severity: Major
    Found in src/pages/user/MyTasks/index.tsx and 1 other location - About 5 hrs to fix
    src/pages/user/MyTasks/index.tsx on lines 78..103

    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 146.

    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

    Function Footer has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Footer = () => {
      const { settings, fetchPages, pages, user } = useContext(EscolaLMSContext);
      const { t, i18n } = useTranslation();
      useEffect(() => {
        fetchPages();
    Severity: Major
    Found in src/components/_App/Footer/index.tsx - About 5 hrs to fix

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

        return (
          <Modal
            onClose={onClose}
            visible={visible}
            animation="zoom"
      Severity: Major
      Found in src/components/Webinars/Webinar/WebinarMeetModal/index.tsx and 1 other location - About 5 hrs to fix
      src/components/Consultations/ConsultationCard/MeetModal/index.tsx on lines 37..57

      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 141.

      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 2 locations. Consider refactoring.
      Open

        return (
          <Modal
            onClose={onClose}
            visible={visible}
            animation="zoom"
      src/components/Webinars/Webinar/WebinarMeetModal/index.tsx on lines 44..67

      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 141.

      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 2 locations. Consider refactoring.
      Open

            ConsultationPage: {
              Book: "Book your consultation",
              SidebarHeader: "Online consultation with your expert",
              IsFinished: "The consultation is over",
              GoToCheckout: "Go to checkout",
      Severity: Major
      Found in src/i18n.ts and 1 other location - About 4 hrs to fix
      src/i18n.ts on lines 983..1010

      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 131.

      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 2 locations. Consider refactoring.
      Open

            ConsultationPage: {
              Book: "Umów spotkanie",
              SidebarHeader: "Konsultacja online z ekspertem",
              IsFinished: "Konsultacja się zakończyła",
              GoToCheckout: "Do kasy",
      Severity: Major
      Found in src/i18n.ts and 1 other location - About 4 hrs to fix
      src/i18n.ts on lines 219..246

      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 131.

      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

      File index.ts has 365 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        BulkNotificationSection,
        EventTypes,
        Notification,
        Order,
      Severity: Minor
      Found in src/utils/index.ts - About 4 hrs to fix

        Function WebinarSidebarButtons has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const WebinarSidebarButtons = () => {
          const [buttonStatus, setButtonStatus] = useState<ButtonStatus>(
            ButtonStatus.DEFAULT
          );
          const [showMeetModal, setShowMeetModal] = useState(false);
        Severity: Major
        Found in src/components/Webinars/Webinar/WebinarSidebar/Buttons/index.tsx - About 4 hrs to fix

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

            useEffect(() => {
              filter !== CourseStatus.AUTHORED
                ? setCoursesToMap(remapNormalCourses(paginatedProgress.list?.data || []))
                : filter === CourseStatus.AUTHORED
                ? setCoursesToMap(myAuthoredCourses.list?.data || [])
          Severity: Major
          Found in src/hooks/courses/useProfileCourses.ts and 1 other location - About 4 hrs to fix
          src/components/Profile/ProfileCourses/index.tsx on lines 165..174

          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 128.

          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 2 locations. Consider refactoring.
          Open

            useEffect(() => {
              filter !== CourseStatus.AUTHORED
                ? setCoursesToMap(remapNormalCourses(paginatedProgress.list?.data || []))
                : filter === CourseStatus.AUTHORED
                ? setCoursesToMap(myAuthoredCourses.list?.data || [])
          Severity: Major
          Found in src/components/Profile/ProfileCourses/index.tsx and 1 other location - About 4 hrs to fix
          src/hooks/courses/useProfileCourses.ts on lines 109..118

          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 128.

          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

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

          const usePayment = () => {
            const {
              user,
              cart,
              fetchCart,
          Severity: Major
          Found in src/hooks/usePayment.ts - About 4 hrs to fix

            Function useChatLogic has 110 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const useChatLogic = (lessonID: number, token: string | null | undefined) => {
              if (!token) throw new Error("Token is required");
            
              const [chatState, setChatState] = useState<State>(INITIAL_STATE);
              const { t } = useTranslation();
            Severity: Major
            Found in src/hooks/chat/useChatLogic.ts - About 4 hrs to fix

              Function Tasks has 108 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const Tasks = () => {
                const { t } = useTranslation();
                const [currentPage, setCurrentPage] = useState(1);
                const [lastPage, setLastPage] = useState(2);
                const previousDisabled = currentPage <= 1;
              Severity: Major
              Found in src/pages/user/MyTasks/index.tsx - About 4 hrs to fix

                Function Orders has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Orders = () => {
                  const { orders, fetchOrders, fetchOrderInvoice } =
                    useContext(EscolaLMSContext);
                
                  const { t } = useTranslation();
                Severity: Major
                Found in src/pages/user/my-orders.tsx - About 4 hrs to fix

                  Function useProfileCourses has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const useProfileCourses = (filter = CourseStatus.ALL) => {
                    const {
                      fetchMyAuthoredCourses,
                      myAuthoredCourses,
                      fetchPaginatedProgress,
                  Severity: Major
                  Found in src/hooks/courses/useProfileCourses.ts - About 4 hrs to fix

                    Function useLessonProgram has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function useLessonProgram(
                      program: API.CourseProgram,
                      courseRouteName: string = "/course/"
                    ) {
                      const {
                    Severity: Major
                    Found in src/hooks/useLessonProgram.ts - About 4 hrs to fix

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

                        const remapNormalCourses = useCallback(
                          (courses: API.CourseProgressItem[]) => {
                            return courses.map((course: API.CourseProgressItem) => {
                              return {
                                ...course.course,
                      Severity: Major
                      Found in src/components/Profile/ProfileCourses/index.tsx and 1 other location - About 4 hrs to fix
                      src/hooks/courses/useProfileCourses.ts on lines 91..107

                      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 116.

                      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 2 locations. Consider refactoring.
                      Open

                        const remapNormalCourses = useCallback(
                          (courses: API.CourseProgressItem[]) => {
                            return courses.map((course: API.CourseProgressItem) => {
                              return {
                                ...course.course,
                      Severity: Major
                      Found in src/hooks/courses/useProfileCourses.ts and 1 other location - About 4 hrs to fix
                      src/components/Profile/ProfileCourses/index.tsx on lines 147..163

                      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 116.

                      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