Showing 173 of 585 total issues
Function ConsultationsCollection
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsultationsCollection = () => {
const { consultations, loading } = useContext(ConsultationsContext);
const { t } = useTranslation();
const consultationsCategories = consultations?.data?.map((item) =>
Function ChatIcon
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ChatIcon = () => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="31.296"
Function TutorsPage
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TutorsPage = () => {
const { tutors, fetchTutors } = useContext(EscolaLMSContext);
const { t } = useTranslation();
const theme = useTheme();
Function useSubscriptions
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useSubscriptions = () => {
const {
fetchProducts,
fetchMyProducts,
products,
Function CoursePanelFinishPage
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CoursePanelFinishPage = () => {
const [state, setState] = useState<State>({
showModal: false,
isAnyQuestionnaire: null,
showCertificate: false,
Function StaticPage
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const StaticPage = () => {
const { slug } = useParams<{ slug: string }>();
const { fetchPage, page, fetchPages, pages } = useContext(EscolaLMSContext);
const prevSlug = usePrevious(slug);
Function ConsultationsSlider
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsultationsSlider: React.FC<ConsultationsSliderProps> = (props) => {
const {
category,
title = category,
consultations,
Function useCamera
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useCamera = () => {
const [hasCameraAccess, setHasCameraAccess] = useState(false);
const streamRef = useRef<MediaStream | null>(null);
const videoRef = useRef<HTMLVideoElement | null>(null);
Function EventRelatedEvents
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventRelatedEvents = () => {
const { stationaryEvents } = useContext(EscolaLMSContext);
const { t } = useTranslation();
const data = stationaryEvents.list?.data;
Function MyConsultationsPage
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MyConsultationsPage = () => {
const { t } = useTranslation();
const { isTutor } = useRoles();
const myConsultationsTabs = useMemo(
Function Tags
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Tags = (props: TagsProps) => {
const { tags, onTagClick } = props;
const theme = useTheme();
const [open, setOpen] = useState(false);
const firstTags = tags ? [...tags].splice(0, 2) : [];
Function CategoriesBreadCrumbs
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CategoriesBreadCrumbs = (props: CategoriesProps) => {
const { categories, onCategoryClick } = props;
// const [open, setOpen] = useState(false);
const parentRef = useRef<HTMLDivElement | null>(null);
const firstCategories = categories || [];
Function ProfileCertificates
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ProfileCertificates: React.FC = () => {
const { certificates, fetchCertificates } = useContext(EscolaLMSContext);
const { t } = useTranslation();
const { downloadCertificate, loadingId } = useCertificateDownload();
Function usePayment
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const usePayment = () => {
const {
user,
cart,
fetchCart,
- 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 CourseMainInfo
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const CourseMainInfo: FC<CourseMainInfoProps> = ({ courseData }) => {
const { fetchQuestionnaireStarsByModel } = useContext(EscolaLMSContext);
const [state, setState] = useState<State>({ type: StateTypes.INIT });
const history = useHistory();
- 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 VerifyEmail
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VerifyEmail: React.FC = () => {
const { push } = useHistory();
const { search } = useLocation();
const id = search && search?.split("&")[0]?.split("=")[1];
const hash = search && search?.split("&")[1]?.split("=")[1];
Function EventsHeaderFilters
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventsHeaderFilters = () => {
const { params, setParams } = useContext(EventsContext);
const location = useLocation();
const parsedParams = qs.parse(location.search, {
arrayFormat: "bracket",
Function PackagesHeaderFilters
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PackagesHeaderFilters = () => {
const { params, setParams } = useContext(PackagesContext);
const location = useLocation();
const parsedParams = qs.parse(location.search, {
arrayFormat: "bracket",
Function WebinarsHeaderFilters
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WebinarsHeaderFilters = () => {
const { params, setParams } = useContext(WebinarsContext);
const location = useLocation();
const parsedParams = qs.parse(location.search, {
arrayFormat: "bracket",
Function CoursesDetailsSidebar
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const CoursesDetailsSidebar: React.FC<Props> = ({
course,
onRequestAccess,
}) => {
const { user, courseAccess } = 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"