Showing 162 of 559 total issues
Function useCoursesFilter
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useCoursesFilter = () => {
const { courses, params, setParams, loading } = useContext(CoursesContext);
const { fetchCategories, categoryTree } = useContext(EscolaLMSContext);
const [prevCategories, setPrevCategories] = useState<Category[]>([]);
const history = useHistory();
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 Navbar
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const Navbar = () => {
const { t } = useTranslation();
const {
showModal,
closeModal,
- 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 PromotedCoursesSection
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PromotedCoursesSection: React.FC = () => {
const { courses, loading } = useFetchCourses({
per_page: 8,
});
Function Routes
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Routes: React.FC = (): ReactElement => {
const {
home,
// authentication,
page,
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 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 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 CoursePanelProvider
has a Cognitive Complexity of 24 (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 CoursesCollection
has 82 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 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 CoursePanelFinishPage
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CoursePanelFinishPage = () => {
const [state, setState] = useState<State>({
showModal: false,
isAnyQuestionnaire: null,
showCertificate: false,
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 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]);
Function ConsultationsCollection
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsultationsCollection = () => {
const { consultations } = useContext(ConsultationsContext);
const { t } = useTranslation();
const consultationsCategories = consultations?.list?.data?.map((item) =>
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) {
Function Consultation
has 75 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 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();