EscolaLMS/Front

View on GitHub

Showing 585 of 585 total issues

Function getFormattedDifferenceRelativeToNow has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getFormattedDifferenceRelativeToNow = (time: Date) => {
  const daysDifference = time
    ? differenceInDays(time.getTime(), new Date().getTime())
    : null;
  const hoursDifference = time
Severity: Minor
Found in src/utils/index.ts - About 1 hr to fix

    Function ConsultationHero has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ConsultationHero: React.FC<ConsultationHeroProps> = (props) => {
      const { consultation } = props;
      const history = useHistory();
    
      return (
    Severity: Minor
    Found in src/components/Consultations/Consultation/ConsultationHero.tsx - About 1 hr to fix

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

      export const StyledRelatedConsultations = styled.section`
        background-color: ${({ theme }) =>
          theme.mode === "dark" ? theme.gray1 : theme.gray5};
        padding: 20px 0;
        margin-top: 60px;
      Severity: Major
      Found in src/components/Consultations/Consultation/style.tsx and 4 other locations - About 1 hr to fix
      src/components/Events/Event/EventContainer/EventContainerStyles.ts on lines 3..21
      src/components/Events/Event/EventRelatedEvents/EventRelatedEvents.ts on lines 3..44
      src/components/Packages/Package/PackageContainer/styles.tsx on lines 3..21
      src/components/Webinars/Webinar/WebinarContentStyles.tsx on lines 3..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 59.

      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 5 locations. Consider refactoring.
      Open

      export const EventContainerStyles = styled.div`
        section {
          margin-bottom: 45px;
          &.with-border {
            padding-bottom: 45px;
      src/components/Consultations/Consultation/style.tsx on lines 22..27
      src/components/Events/Event/EventRelatedEvents/EventRelatedEvents.ts on lines 3..44
      src/components/Packages/Package/PackageContainer/styles.tsx on lines 3..21
      src/components/Webinars/Webinar/WebinarContentStyles.tsx on lines 3..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 59.

      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 5 locations. Consider refactoring.
      Open

      export const EventRelatedStyles = styled.div`
        .event-related-events {
          background-color: ${({ theme }) =>
            theme.mode === "dark" ? theme.gray1 : theme.gray5};
          padding: 60px 0 90px;
      src/components/Consultations/Consultation/style.tsx on lines 22..27
      src/components/Events/Event/EventContainer/EventContainerStyles.ts on lines 3..21
      src/components/Packages/Package/PackageContainer/styles.tsx on lines 3..21
      src/components/Webinars/Webinar/WebinarContentStyles.tsx on lines 3..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 59.

      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 5 locations. Consider refactoring.
      Open

      export const PackageContainerStyles = styled.div`
        section {
          margin-bottom: 45px;
          &.with-border {
            padding-bottom: 45px;
      src/components/Consultations/Consultation/style.tsx on lines 22..27
      src/components/Events/Event/EventContainer/EventContainerStyles.ts on lines 3..21
      src/components/Events/Event/EventRelatedEvents/EventRelatedEvents.ts on lines 3..44
      src/components/Webinars/Webinar/WebinarContentStyles.tsx on lines 3..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 59.

      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

          <Modal
            onClose={onClose}
            visible={visible}
            animation="zoom"
            maskAnimation="fade"
      Severity: Major
      Found in src/components/Webinars/Webinar/WebinarMeetModal/index.tsx and 1 other location - About 1 hr to fix
      src/components/Consultations/ConsultationCard/MeetModal/index.tsx on lines 53..81

      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 59.

      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 5 locations. Consider refactoring.
      Open

      export const WebinarContentStyles = styled.div`
        section {
          margin-bottom: 45px;
          &.with-border {
            padding-bottom: 45px;
      Severity: Major
      Found in src/components/Webinars/Webinar/WebinarContentStyles.tsx and 4 other locations - About 1 hr to fix
      src/components/Consultations/Consultation/style.tsx on lines 22..27
      src/components/Events/Event/EventContainer/EventContainerStyles.ts on lines 3..21
      src/components/Events/Event/EventRelatedEvents/EventRelatedEvents.ts on lines 3..44
      src/components/Packages/Package/PackageContainer/styles.tsx on lines 3..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 59.

      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

                        <IconText
                          icon={<IconCircleError />}
                          text={t("Cancel")}
                          onClick={() =>
                            rejectConsultationTerm(
      src/components/Consultations/ConsultationTutorCard/Content/UserInfo/index.tsx on lines 103..113

      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 59.

      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

                        <IconText
                          icon={<IconSuccess />}
                          text={t("Confirm")}
                          onClick={() =>
                            approveConsultationTerm(
      src/components/Consultations/ConsultationTutorCard/Content/UserInfo/index.tsx on lines 114..124

      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 59.

      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

          <Modal
            onClose={onClose}
            visible={visible}
            animation="zoom"
            maskAnimation="fade"
      src/components/Webinars/Webinar/WebinarMeetModal/index.tsx on lines 45..66

      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 59.

      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

            <div style={{ marginBottom: "27px" }}>
              <Skeleton count={5} style={{ marginBottom: "11px", height: "20px" }} />
            </div>
      Severity: Major
      Found in src/components/Skeletons/StaticPage/index.tsx and 2 other locations - About 1 hr to fix
      src/components/Skeletons/StaticPage/index.tsx on lines 9..11
      src/components/Skeletons/StaticPage/index.tsx on lines 12..14

      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 58.

      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

            <div style={{ marginBottom: "27px" }}>
              <Skeleton count={12} style={{ marginBottom: "11px", height: "20px" }} />
            </div>
      Severity: Major
      Found in src/components/Skeletons/StaticPage/index.tsx and 2 other locations - About 1 hr to fix
      src/components/Skeletons/StaticPage/index.tsx on lines 6..8
      src/components/Skeletons/StaticPage/index.tsx on lines 12..14

      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 58.

      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

        if (userIsCourseAuthor(Number(user.value?.id), course)) {
          return (
            <Button onClick={() => push(`/course/${course.id}`)} mode="secondary">
              {t("Go to the course")}
            </Button>
      src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/Buttons/index.tsx on lines 171..177
      src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/Buttons/index.tsx on lines 231..237

      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 58.

      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

        if (userOwnThisCourse && isPast(new Date(course.active_from || ""))) {
          return (
            <Button onClick={() => push(`/course/${course.id}`)} mode="secondary">
              {t("Go to the course")}
            </Button>
      src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/Buttons/index.tsx on lines 171..177
      src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/Buttons/index.tsx on lines 211..217

      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 58.

      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

        if (currentCourseAccess.status === "approved") {
          return (
            <Button onClick={() => push(`/course/${course.id}`)} mode="secondary">
              {t("Go to the course")}
            </Button>
      src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/Buttons/index.tsx on lines 211..217
      src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/Buttons/index.tsx on lines 231..237

      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 58.

      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

        return (
          <ProfileLayout title={t("MyProfilePage.MyWebinars")} withTabs>
            <Tabs tabs={myTabs.tabs} defaultActiveKey={myTabs.defaultActiveKey} />
          </ProfileLayout>
        );
      Severity: Major
      Found in src/pages/user/MyWebinars/index.tsx and 1 other location - About 1 hr to fix
      src/pages/user/MyStationaryEvents/index.tsx on lines 43..50

      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 58.

      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

            <div style={{ marginBottom: "27px" }}>
              <Skeleton count={6} style={{ marginBottom: "11px", height: "20px" }} />
            </div>
      Severity: Major
      Found in src/components/Skeletons/StaticPage/index.tsx and 2 other locations - About 1 hr to fix
      src/components/Skeletons/StaticPage/index.tsx on lines 6..8
      src/components/Skeletons/StaticPage/index.tsx on lines 9..11

      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 58.

      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

        return (
          <ProfileLayout title={t("MyProfilePage.MyStationaryEvents")} withTabs>
            <Tabs
              tabs={eventsTabs.tabs}
              defaultActiveKey={eventsTabs.defaultActiveKey}
      Severity: Major
      Found in src/pages/user/MyStationaryEvents/index.tsx and 1 other location - About 1 hr to fix
      src/pages/user/MyWebinars/index.tsx on lines 70..74

      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 58.

      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

                      progress={
                        item.progress &&
                        item.progress !== 100 &&
                        !isNaN(item.progress)
                          ? {
      Severity: Major
      Found in src/components/Courses/CoursesUserSlider/index.tsx and 1 other location - About 1 hr to fix
      src/components/Profile/ProfileCourses/components/CourseCardItem/index.tsx on lines 72..79

      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 58.

      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

      Severity
      Category
      Status
      Source
      Language