EscolaLMS/Front

View on GitHub

Showing 585 of 585 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          {!(cart.value?.items.length === 0) ? (
            <Row>
              <Col lg={9}>
                <Breadcrumbs
                  items={[
Severity: Major
Found in src/components/Cart/CartContent/stripe.tsx and 1 other location - About 1 day to fix
src/components/Cart/CartContent/p24.tsx on lines 77..210

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 212.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            {!(cart.value?.items.length === 0) ? (
              <Row>
                <Col lg={9}>
                  <div className="module-wrapper">
                    <Title style={{ marginBottom: 20 }} level={2} as="h3">
Severity: Major
Found in src/components/Cart/CartContent/p24.tsx and 1 other location - About 1 day to fix
src/components/Cart/CartContent/stripe.tsx on lines 105..236

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 212.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <section className="event-companies">
        <Text>
          <strong>{t("CoursePage.CompaniesTitle")}</strong>
        </Text>
        <div className="companies-row">
Severity: Major
Found in src/components/Events/Event/EventCompanies/index.tsx and 1 other location - About 7 hrs to fix
src/pages/courses/course/Components/CourseCompanies/index.tsx on lines 16..32

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 194.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    <section className="course-companies">
      <Text>
        <strong>{t("CoursePage.CompaniesTitle")}</strong>
      </Text>
      <div className="companies-row">
src/components/Events/Event/EventCompanies/index.tsx on lines 14..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 194.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function Przelewy24Content has 181 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Przelewy24Content = () => {
  const {
    user,
    processing,
    discountStatus,
Severity: Major
Found in src/components/Cart/CartContent/p24.tsx - About 7 hrs to fix

    Function CoursePage has 180 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const CoursePage = () => {
      const [questionnaires, setQuestionnaires] = useState<API.Questionnaire[]>([]);
      const [courseAccessModalVisible, setCourseAccessModalVisible] =
        useState(false);
    
    
    Severity: Major
    Found in src/pages/courses/course/index.tsx - About 7 hrs to fix

      Function TutorPage has 169 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const TutorPage = () => {
        const { id } = useParams<{ id: string }>();
        const { t } = useTranslation();
        const { tutor, fetchTutor, courses, fetchCourses } =
          useContext(EscolaLMSContext);
      Severity: Major
      Found in src/pages/tutors/tutor/index.tsx - About 6 hrs to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        const WebinarBreadcrumbs = () => {
          const { webinar } = useContext(EscolaLMSContext);
          const { t } = useTranslation();
        
          if (!webinar.value) {
        src/components/Events/Event/EventBreadcrumbs/index.tsx on lines 9..25
        src/components/Packages/Package/PackageBreadcrumbs/index.tsx on lines 9..25

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 163.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        const EventBreadcrumbs = () => {
          const { stationaryEvent } = useContext(EscolaLMSContext);
          const { t } = useTranslation();
        
          if (!stationaryEvent.value) {
        Severity: Major
        Found in src/components/Events/Event/EventBreadcrumbs/index.tsx and 2 other locations - About 6 hrs to fix
        src/components/Packages/Package/PackageBreadcrumbs/index.tsx on lines 9..25
        src/components/Webinars/Webinar/WebinarBreadcrumbs/index.tsx on lines 9..25

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 163.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        export const PackageBreadcrumbs = () => {
          const { product } = useContext(EscolaLMSContext);
          const { t } = useTranslation();
        
          if (!product.value) {
        src/components/Events/Event/EventBreadcrumbs/index.tsx on lines 9..25
        src/components/Webinars/Webinar/WebinarBreadcrumbs/index.tsx on lines 9..25

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 163.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                <SliderLMS
                  settings={{
                    ...sliderSettings,
                    dots,
                    onSwipe: () => {
        Severity: Major
        Found in src/components/Slider/index.tsx and 1 other location - About 6 hrs to fix
        src/components/Consultations/ConsultationsSlider/index.tsx on lines 71..106

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 162.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                <Slider
                  settings={{
                    ...sliderSettings,
                    dots,
                    onSwipe: () => {
        Severity: Major
        Found in src/components/Consultations/ConsultationsSlider/index.tsx and 1 other location - About 6 hrs to fix
        src/components/Slider/index.tsx on lines 89..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 162.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        <SwiperSlide key={item.id}>
                          <CategoryCard
                            icon={<img src={item.icon} alt={item.name} />}
                            title={item.name}
                            buttonText={t("Homepage.CategoryBtnText")}
        Severity: Major
        Found in src/components/Categories/CategoriesSection/index.tsx and 1 other location - About 6 hrs to fix
        src/components/Categories/CategoriesSection/index.tsx on lines 130..148

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 160.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                      <div className="category-item" key={item.id}>
                        <CategoryCard
                          icon={<img src={item.icon} alt={item.name} />}
                          title={item.name}
                          buttonText={t("Homepage.CategoryBtnText")}
        Severity: Major
        Found in src/components/Categories/CategoriesSection/index.tsx and 1 other location - About 6 hrs to fix
        src/components/Categories/CategoriesSection/index.tsx on lines 105..123

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 160.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        const EventProvider: React.FC<{
          children: React.ReactNode;
        }> = ({ children }) => {
          const { id } = useParams<{ id: string }>();
          const { fetchStationaryEvent } = useContext(EscolaLMSContext);
        Severity: Major
        Found in src/components/Events/Event/EventProvider.tsx and 1 other location - About 6 hrs to fix
        src/components/Packages/Package/PackageProvider/index.tsx on lines 8..23

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        const PackageProvider: React.FC<{
          children: React.ReactNode;
        }> = ({ children }) => {
          const { id } = useParams<{ id: string }>();
          const { fetchProduct } = useContext(EscolaLMSContext);
        Severity: Major
        Found in src/components/Packages/Package/PackageProvider/index.tsx and 1 other location - About 6 hrs to fix
        src/components/Events/Event/EventProvider.tsx on lines 8..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              <MobileDrawer
                isOpen={mobileDrawerState.showDrawer}
                onClose={() =>
                  setMobileDrawerState({
                    showDrawer: false,
        src/components/Courses/CoursesCollection/index.tsx on lines 61..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              <MobileDrawer
                isOpen={mobileDrawerState.showDrawer}
                onClose={() =>
                  setMobileDrawerState({
                    showDrawer: false,
        Severity: Major
        Found in src/components/Courses/CoursesCollection/index.tsx and 1 other location - About 6 hrs to fix
        src/components/Consultations/List/ConsultationsContainer/index.tsx on lines 71..95

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function Onboarding has 151 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const Onboarding = () => {
          const { settings, fetchSettings, updateProfile, fetchProfile, user } =
            useContext(EscolaLMSContext);
          const { t, i18n } = useTranslation();
          const history = useHistory();
        Severity: Major
        Found in src/components/Onboarding/index.tsx - About 6 hrs to fix

          Function ConsultationSidebar has 146 lines of code (exceeds 25 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();
          Severity: Major
          Found in src/components/Consultations/Consultation/ConsultationSidebar.tsx - About 5 hrs to fix
            Severity
            Category
            Status
            Source
            Language