Showing 173 of 585 total issues
Function Tasks
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Tasks = () => {
const { t } = useTranslation();
const [currentPage, setCurrentPage] = useState(1);
const [lastPage, setLastPage] = useState(2);
const previousDisabled = currentPage <= 1;
Function useProfileCourses
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useProfileCourses = (filter = CourseStatus.ALL) => {
const {
fetchMyAuthoredCourses,
myAuthoredCourses,
fetchPaginatedProgress,
Function Orders
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Orders = () => {
const { orders, fetchOrders, fetchOrderInvoice } =
useContext(EscolaLMSContext);
const { t } = useTranslation();
Function useLessonProgram
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useLessonProgram(
program: API.CourseProgram,
courseRouteName: string = "/course/"
) {
const {
Function CoursePanelProvider
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const CoursePanelProvider: React.FC<React.PropsWithChildren> = ({
children,
}) => {
const {
sendProgress,
- 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 Routes
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Routes: React.FC = (): ReactElement => {
const {
home,
// authentication,
page,
Function Index
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Index = () => {
const { categoryTree, settings, fetchCategories, user } =
useContext(EscolaLMSContext);
const history = useHistory();
Function Consultation
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Consultation = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
const { consultation, fetchConsultation, consultations } =
useContext(EscolaLMSContext);
Function PromotedCoursesSection
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PromotedCoursesSection: React.FC = () => {
const { courses, loading } = useFetchCourses({
per_page: 8,
});
Function WebinarInfo
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WebinarInfo = () => {
const { webinar } = useContext(EscolaLMSContext);
const { t } = useTranslation();
if (!webinar.value) {
Function ProfileCourses
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const ProfileCourses = ({
filter = CourseStatus.ALL,
}: {
filter: CourseStatus;
}) => {
- 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 ConsultationSidebar
has a Cognitive Complexity of 24 (exceeds 5 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();
- 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 Onboarding
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const Onboarding = () => {
const { settings, fetchSettings, updateProfile, fetchProfile, user } =
useContext(EscolaLMSContext);
const { t, i18n } = useTranslation();
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 ConsultationsContainer
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsultationsContainer = () => {
const [mobileDrawerState, setMobileDrawerState] = React.useState<{
showDrawer: boolean;
type: keyof typeof MobileDrawerTypes;
}>({
Function EventInfo
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventInfo = () => {
const { stationaryEvent } = useContext(EscolaLMSContext);
const { t } = useTranslation();
if (!stationaryEvent.value) {
Function Footer
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const Footer = () => {
const { settings, fetchPages, pages, user } = useContext(EscolaLMSContext);
const { t, i18n } = useTranslation();
useEffect(() => {
fetchPages();
- 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 CoursesCollection
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CoursesCollection: React.FC = () => {
const [mobileDrawerState, setMobileDrawerState] = React.useState<{
showDrawer: boolean;
type: keyof typeof MobileDrawerTypes;
}>({
Function useSearchParams
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSearchParams = () => {
const { search, pathname } = useLocation();
const history = useHistory();
const query = useMemo(() => new URLSearchParams(search), [search]);
File index.tsx
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useCallback,
useContext,
useEffect,
useMemo,
Function PackageInfo
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PackageInfo = () => {
const { product } = useContext(EscolaLMSContext);
const { t } = useTranslation();
if (!product.value) {