Showing 173 of 585 total issues
Function ConsultationsProvider
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsultationsProvider: React.FC<PropsWithChildren> = (props) => {
const { children } = props;
const [params, setParams] = useState<API.CourseParams>({
page: 1,
per_page: COURSES_ON_PAGE,
Function renderProperOptions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
(option: OnboardingOption) => {
switch (step.type) {
case OnboardingStepType.radio:
return (
<Radio
Function ResetPassword
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResetPassword: React.FC = () => {
const { push } = useHistory();
const { search } = useLocation();
const email = search && search.split("&")[0].split("=")[1];
const token = search && search.split("&")[1].split("=")[1];
Function CoursePageContentSkeleton
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CoursePageContentSkeleton = () => {
return (
<SkeletonWrapper>
<Skeleton width={"20px"} style={{ marginBottom: "5px" }} />
<Skeleton width={"40%"} height={37} style={{ marginBottom: "10px" }} />
Function handleFetchQuestionnairesAnswers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
(page: number) => {
if (questionId && courseId) {
setLoading(true);
fetchQuestionnairesAnswers(
QuestionnaireModelType.COURSE,
Function getFormattedDifferenceRelativeToNow
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getFormattedDifferenceRelativeToNow = (time: Date) => {
const daysDifference = time
? differenceInDays(time.getTime(), new Date().getTime())
: null;
const hoursDifference = time
Function ConsultationHero
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsultationHero: React.FC<ConsultationHeroProps> = (props) => {
const { consultation } = props;
const history = useHistory();
return (
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 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 useCamera
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const useCamera = () => {
const [hasCameraAccess, setHasCameraAccess] = useState(false);
const streamRef = useRef<MediaStream | null>(null);
const videoRef = useRef<HTMLVideoElement | null>(null);
- 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 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, setConsultationsData] = useState<
- 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 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 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 questionnairesWithCombinedQuestions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
response.data.map(async (data) => {
const questions = await getQuestionnaire(data.id);
const combinedQuestions = data.questions.reduce(
(result, element) => {
Function WebinarContent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WebinarContent = () => {
const { webinar } = useContext(EscolaLMSContext);
const { t } = useTranslation();
return (
Function onClick
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onClick = useCallback(async () => {
if (consultation.consultation_term_id && selectedDate) {
setLoading(true);
try {
Consider simplifying this complex logical expression. Open
if (isMobile) {
return (
<StyledHeader>
<Navigation
mobile