Showing 162 of 559 total issues
File index.tsx
has 1897 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { SVGProps } from "react";
export const HamburguerIcon = () => {
return (
<svg
File i18n.ts
has 1454 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import { resources as ComponentTranslations } from "@escolalms/components/lib/styleguide/i18n";
// the translations
Function Navbar
has 438 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Navbar = () => {
const { t } = useTranslation();
const {
showModal,
closeModal,
File index.tsx
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
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";
Function getNotificationTranslationObject
has 270 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getNotificationTranslationObject = (
notification: Notification
): {
translation: string;
object?: { name?: string; amount?: number; date?: string; user?: string };
Function Przelewy24Content
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Przelewy24Content = () => {
const {
user,
processing,
discountStatus,
Function CoursePage
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CoursePage = () => {
const [questionnaires, setQuestionnaires] = useState<API.Questionnaire[]>([]);
const [courseAccessModalVisible, setCourseAccessModalVisible] =
useState(false);
Function TutorPage
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TutorPage = () => {
const { id } = useParams<{ id: string }>();
const { t } = useTranslation();
const { tutor, fetchTutor, courses, fetchCourses } =
useContext(EscolaLMSContext);
Function Onboarding
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Onboarding = () => {
const { settings, fetchSettings, updateProfile, fetchProfile, user } =
useContext(EscolaLMSContext);
const { t, i18n } = useTranslation();
const history = useHistory();
Function ConsultationSidebar
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ConsultationSidebar: React.FC<ConsultationSidebarProps> = (props) => {
const { consultation } = props;
const { cart, addToCart, user } = useContext(EscolaLMSContext);
const { t } = useTranslation();
const { push } = useHistory();
Function RegisterPage
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const RegisterPage = () => {
const { search } = useLocation();
const { user, socialAuthorize } = useContext(EscolaLMSContext);
const [view, setView] = useState<"" | "success" | "register">("");
const [modalVisible, setModalVisible] = useState(false);
Function Footer
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Footer = () => {
const { settings, fetchPages, pages, user } = useContext(EscolaLMSContext);
const { t, i18n } = useTranslation();
useEffect(() => {
fetchPages();
File index.ts
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
BulkNotificationSection,
EventTypes,
Notification,
Order,
Function WebinarSidebarButtons
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const WebinarSidebarButtons = () => {
const [buttonStatus, setButtonStatus] = useState<ButtonStatus>(
ButtonStatus.DEFAULT
);
const [showMeetModal, setShowMeetModal] = useState(false);
Function usePayment
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const usePayment = () => {
const {
user,
cart,
fetchCart,
Function useChatLogic
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
Function Tasks
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Tasks = () => {
const { t } = useTranslation();
const [currentPage, setCurrentPage] = useState(1);
const [lastPage, setLastPage] = useState(2);
const previousDisabled = currentPage <= 1;
Function useProfileCourses
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useProfileCourses = (filter = CourseStatus.ALL) => {
const {
fetchMyAuthoredCourses,
myAuthoredCourses,
fetchPaginatedProgress,
Function Orders
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Orders = () => {
const { orders, fetchOrders, fetchOrderInvoice } =
useContext(EscolaLMSContext);
const { t } = useTranslation();
Function useLessonProgram
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useLessonProgram(
program: API.CourseProgram,
courseRouteName: string = "/course/"
) {
const {