Showing 162 of 559 total issues
Function ProfileConsultations
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ProfileConsultations = ({ type }: ProfileConsultationsProps) => {
const { userConsultations, fetchUserConsultations } =
useContext(EscolaLMSContext);
const { t } = useTranslation();
const consultationsData = useMemo(
- 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 CourseCardActions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const CourseCardActions: FC<Props> = ({
courseData,
courseProgress,
}) => {
const [courseId, setCourseId] = useState<number | undefined>(undefined);
- 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 ProfileTutorConsultations
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ProfileTutorConsultations = ({
type,
}: ProfileTutorConsultationsProps) => {
const { tutorConsultations, fetchTutorConsultations } =
useContext(EscolaLMSContext);
- 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 GetCertificate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const GetCertificate: React.FC<Props> = ({ courseId }) => {
const { fetchCertificates } = useContext(EscolaLMSContext);
const { downloadCertificate, loadingId } = useCertificateDownload();
const { t } = useTranslation();
const [noCertificates, setNoCertificates] = useState(false);
- 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 CoursePanelFinishPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const CoursePanelFinishPage = () => {
const [state, setState] = useState<State>({
showModal: false,
isAnyQuestionnaire: null,
showCertificate: false,
- 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 Pagination
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ currentPage, total, perPage, onPage, pageNeighbours = 2 }) => {
const lastPage = Math.ceil(total / perPage);
const fetchPageNumbers = () => {
/**
- 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 EventAgenda
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventAgenda = () => {
const { stationaryEvent } = useContext(EscolaLMSContext);
// TODO: fix this
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Function ArrowDown
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ArrowDown = () => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="10.918"
Function WebinarContent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WebinarContent = () => {
const { webinar } = useContext(EscolaLMSContext);
const { t } = useTranslation();
return (
Function Step
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const Step: React.FC<Props> = ({ step, onAnswer, answers }) => {
const { settings } = useContext(EscolaLMSContext);
const { i18n } = useTranslation();
const getImage = useCallback(() => {
- 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 UserSelectDatePicker
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const UserSelectDatePicker = ({ consultation, onClose }: Props) => {
const [selectedDate, setSelectedDay] = useState<Date | null>(null);
const { bookConsultationTerm } = useContext(EscolaLMSContext);
const [loading, setLoading] = useState(false);
const [step, setStep] = useState(1);
- 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 useCourseBreakPoint
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useCourseBreakPoint = ({ courseId, program, topic }: Props) => {
const { courseProgressDetails, progress } = useContext(EscolaLMSContext);
const location = useLocation();
const { push } = useHistory();
// if pathname contain 3 splited items we cannot fire topicbreakpoint effect otherwise we can
- 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 ButtonsNav
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const ButtonsNav = () => {
const {
completeCurrentTopic,
currentTopic,
finishedTopicsIds,
- 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 getFormattedDifferenceRelativeToNow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getFormattedDifferenceRelativeToNow = (time: Date) => {
const daysDifference = time
? differenceInDays(time.getTime(), new Date().getTime())
: null;
const hoursDifference = time
- 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 Orders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Orders = () => {
const { orders, fetchOrders, fetchOrderInvoice } =
useContext(EscolaLMSContext);
const { t } = useTranslation();
- 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 Login
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Login = () => {
const { search, state } = useLocation<{ referrer?: string }>();
const { user, socialAuthorize } = useContext(EscolaLMSContext);
const [view, setView] = useState<
"login" | "forgotPassword" | "register" | "success"
- 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
Consider simplifying this complex logical expression. Open
if (isMobile) {
return (
<StyledHeader>
<Navigation
mobile
Function useLessonProgram
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function useLessonProgram(
program: API.CourseProgram,
courseRouteName: string = "/course/"
) {
const {
- 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 ConsultationsProvider
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ConsultationsProvider: React.FC<PropsWithChildren> = (props) => {
const { fetchConsultations, consultations, fetchCategories } =
useContext(EscolaLMSContext);
const { children } = props;
const { query, getQueryValueByName, getAllQueryValueByName, setPathname } =
- 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 CourseProgramContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ topic, preview = false }) => {
const { courseId, nextTopic, setIsNextTopicButtonDisabled, showFinish } =
useCoursePanel();
const { topicPing, topicIsFinished, h5pProgress, fetchCourseProgress } =
- 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"