EscolaLMS/Front

View on GitHub

Showing 162 of 559 total issues

File index.tsx has 1897 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { SVGProps } from "react";

export const HamburguerIcon = () => {
  return (
    <svg
Severity: Major
Found in src/icons/index.tsx - About 5 days to fix

    File i18n.ts has 1454 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import i18n from "i18next";
    import { initReactI18next } from "react-i18next";
    import { resources as ComponentTranslations } from "@escolalms/components/lib/styleguide/i18n";
    
    // the translations
    Severity: Major
    Found in src/i18n.ts - About 3 days to fix

      Function Navbar has 438 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Navbar = () => {
        const { t } = useTranslation();
        const {
          showModal,
          closeModal,
      Severity: Major
      Found in src/components/_App/Navbar/index.tsx - About 2 days to fix

        File index.tsx has 676 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { useContext, useEffect, useState } from "react";
        
        import { EscolaLMSContext } from "@escolalms/sdk/lib/react/context";
        import { Navigation } from "@escolalms/components/lib/components/molecules/Navigation/Navigation";
        import { Avatar } from "@escolalms/components/lib/components/atoms/Avatar/Avatar";
        Severity: Major
        Found in src/components/_App/Navbar/index.tsx - About 1 day to fix

          Function getNotificationTranslationObject has 270 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const getNotificationTranslationObject = (
            notification: Notification
          ): {
            translation: string;
            object?: { name?: string; amount?: number; date?: string; user?: string };
          Severity: Major
          Found in src/utils/index.ts - About 1 day to fix

            Function Przelewy24Content has 181 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Przelewy24Content = () => {
              const {
                user,
                processing,
                discountStatus,
            Severity: Major
            Found in src/components/Cart/CartContent/p24.tsx - About 7 hrs to fix

              Function CoursePage has 180 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const CoursePage = () => {
                const [questionnaires, setQuestionnaires] = useState<API.Questionnaire[]>([]);
                const [courseAccessModalVisible, setCourseAccessModalVisible] =
                  useState(false);
              
              
              Severity: Major
              Found in src/pages/courses/course/index.tsx - About 7 hrs to fix

                Function TutorPage has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const TutorPage = () => {
                  const { id } = useParams<{ id: string }>();
                  const { t } = useTranslation();
                  const { tutor, fetchTutor, courses, fetchCourses } =
                    useContext(EscolaLMSContext);
                Severity: Major
                Found in src/pages/tutors/tutor/index.tsx - About 6 hrs to fix

                  Function Onboarding has 151 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const Onboarding = () => {
                    const { settings, fetchSettings, updateProfile, fetchProfile, user } =
                      useContext(EscolaLMSContext);
                    const { t, i18n } = useTranslation();
                    const history = useHistory();
                  Severity: Major
                  Found in src/components/Onboarding/index.tsx - About 6 hrs to fix

                    Function ConsultationSidebar has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ConsultationSidebar: React.FC<ConsultationSidebarProps> = (props) => {
                      const { consultation } = props;
                      const { cart, addToCart, user } = useContext(EscolaLMSContext);
                      const { t } = useTranslation();
                      const { push } = useHistory();
                    Severity: Major
                    Found in src/components/Consultations/Consultation/ConsultationSidebar.tsx - About 5 hrs to fix

                      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

                        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

                          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

                              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 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 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 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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language