Showing 173 of 585 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
File i18n.ts
has 1464 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
Function Navbar
has 474 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Navbar = () => {
const { t } = useTranslation();
const {
showModal,
closeModal,
File index.tsx
has 712 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useContext, useEffect, useMemo, 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
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
const Przelewy24Content = () => {
const {
user,
processing,
discountStatus,
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);
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);
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();
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();
Function RegisterPage
has 141 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);
Function QuestionnairesModal
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const QuestionnairesModal = ({
entityId,
entityModel,
onSuccesGetQuestionnaires,
}: Props) => {
- Read upRead up
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 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();
File index.ts
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
BulkNotificationSection,
EventTypes,
Notification,
Order,
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);
Function usePayment
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
const usePayment = () => {
const {
user,
cart,
fetchCart,
Function useFilter
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useFilter = (entityType: EntityType = "courses") => {
const coursesContext = useContext(CoursesContext);
const consultationsContext = useContext(ConsultationsContext);
const { fetchCategories, categoryTree } = useContext(EscolaLMSContext);
Function Navbar
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const Navbar = () => {
const { t } = useTranslation();
const {
showModal,
closeModal,
- Read upRead up
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 JitsyMeeting
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const JitsyMeeting: React.FC<Props> = ({
jitsyData,
term,
consultationTermId,
consultationId,
- Read upRead up
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 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();