Showing 162 of 559 total issues
Function useSubscriptions
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useSubscriptions = () => {
const {
fetchProducts,
fetchMyProducts,
products,
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 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 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 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 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 MyConsultationsPage
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MyConsultationsPage = () => {
const { t } = useTranslation();
const { isTutor } = useRoles();
const myConsultationsTabs = useMemo(
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",
File index.tsx
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useCallback,
useContext,
useEffect,
useMemo,
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"
Further reading
Function Przelewy24Content
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const Przelewy24Content = () => {
const {
user,
processing,
discountStatus,
- 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
File index.tsx
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { EscolaLMSContext } from "@escolalms/sdk/lib/react";
import {
useCallback,
useContext,
useEffect,
Function CourseSidebar
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ course, topicId, onCompleteTopic, onCourseFinish }) => {
const { progress } = useLessonProgram(course);
const {
courseProgressDetails,
user,
- 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 StripeContent
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const StripeContent = ({ stripeKey }: { stripeKey: string }) => {
const {
processing,
setProcessing,
discountStatus,
- 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"