EscolaLMS/Front

View on GitHub

Showing 572 of 572 total issues

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

const MyData = () => {
  const { t } = useTranslation();
  return (
    <ProfileLayout title={t("MyProfilePage.EditData")}>
      <StyledWrapper>
Severity: Major
Found in src/pages/user/my-data.tsx and 1 other location - About 1 hr to fix
src/pages/user/my-certificates.tsx on lines 10..19

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

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

          {course.duration && (
            <IconText
              text={
                <IconTextWrapper>
                  <span>{t("CoursePage.Duration")}</span>
src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/index.tsx on lines 145..154
src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/index.tsx on lines 155..164

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

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

          {course.level && (
            <IconText
              text={
                <IconTextWrapper>
                  <span>{t("CoursePage.Level")}</span>
src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/index.tsx on lines 125..134
src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/index.tsx on lines 145..154

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

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

          {course.language && (
            <IconText
              text={
                <IconTextWrapper>
                  <span>{t("CoursePage.Language")}</span>
src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/index.tsx on lines 125..134
src/components/Courses/SingleCoursesTwo/CoursesDetailsSidebar/index.tsx on lines 155..164

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

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 MyProfile has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MyProfile = () => {
  const { t } = useTranslation();
  const { isTutor } = useRoles();
  const { query, setQueryParam } = useSearchParams();

Severity: Minor
Found in src/pages/user/MyProfile/index.tsx - About 1 hr to fix

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

    export const IconWin = () => {
      return (
        <svg
          width="22"
          height="23"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 483..498
    src/icons/index.tsx on lines 714..729

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

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

    export const IconDownload = () => {
      return (
        <svg
          width="18"
          height="21"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 483..498
    src/icons/index.tsx on lines 714..729

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

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

    export const IconTag = () => {
      return (
        <svg
          width="62"
          height="61"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 483..498
    src/icons/index.tsx on lines 714..729

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

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

    export const ProgressTropy = () => {
      return (
        <svg
          width="22"
          height="22"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 483..498

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

    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

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

          <CoursesFilters
            prevCategories={prevCategories}
            onClearCategories={onClearCategories}
            handleCategoryChange={handleCategoryChange}
            categories={categoryTree.list || []}
    Severity: Major
    Found in src/components/Courses/CoursesCollection/index.tsx and 1 other location - About 1 hr to fix
    src/components/Consultations/List/ConsultationsContainer/index.tsx on lines 35..44

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

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

    export const IconBadge = () => {
      return (
        <svg
          width="18"
          height="18"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 483..498
    src/icons/index.tsx on lines 714..729

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

    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

    export const StarIcon = () => (
      <svg
        xmlns="http://www.w3.org/2000/svg"
        width="11"
        height="11"
    Severity: Major
    Found in src/icons/index.tsx and 1 other location - About 1 hr to fix
    src/icons/index.tsx on lines 133..147

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

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

    export const IconCamera = () => {
      return (
        <svg
          width="20"
          height="15"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 483..498
    src/icons/index.tsx on lines 714..729

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

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

    export const UserIcon = () => {
      return (
        <svg
          width="22"
          height="22"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 363..378
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 714..729

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

    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

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

          <CoursesFilters
            prevCategories={prevCategories}
            onClearCategories={onClearCategories}
            handleCategoryChange={handleCategoryChange}
            categories={categoryTree.list || []}
    src/components/Courses/CoursesCollection/index.tsx on lines 42..51

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

    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

    export const ArrowUp = () => (
      <svg
        xmlns="http://www.w3.org/2000/svg"
        width="16.631"
        height="6.376"
    Severity: Major
    Found in src/icons/index.tsx and 1 other location - About 1 hr to fix
    src/icons/index.tsx on lines 168..182

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

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

    export const IconThumbsUp = () => {
      return (
        <svg
          width="15"
          height="13"
    Severity: Major
    Found in src/icons/index.tsx and 7 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 184..199
    src/icons/index.tsx on lines 239..254
    src/icons/index.tsx on lines 328..343
    src/icons/index.tsx on lines 380..395
    src/icons/index.tsx on lines 397..412
    src/icons/index.tsx on lines 483..498
    src/icons/index.tsx on lines 714..729

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

    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 PackageSidebar has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const PackageSidebar = () => {
      const { product } = useContext(EscolaLMSContext);
      const { t } = useTranslation();
      const productValue = product.value;
    
    
    Severity: Minor
    Found in src/components/Packages/Package/PackageSidebar/index.tsx - About 1 hr to fix

      Function ConsultationsHeaderFilters has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ConsultationsHeaderFilters = () => {
        const {
          setPathname,
          setQueryParam,
          setQueryArrayParam,

        Function ThemeCustomizer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const ThemeCustomizer = (theme: Record<string, DefaultTheme>) => {
          const [, setTheme] = useLocalTheme({
            ...defaultTheme,
            theme: "contrastTheme",
          });
        Severity: Minor
        Found in src/components/_App/ThemeCustomizer/ThemeCustomizer.tsx - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language