EscolaLMS/Front

View on GitHub

Showing 559 of 559 total issues

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

      EmailActivation: {
        Title: "Please check your email to complete the registration process",
        Title2: "Your account is awaiting activation",
        Text: `We sent a message to the address **{{email}}** z
        link to activate your account.
Severity: Minor
Found in src/i18n.ts and 1 other location - About 35 mins to fix
src/i18n.ts on lines 867..881

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

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

      OrderStatus: {
        NEW: "Nowe",
        PAID: "Opłacone",
        CANCELLED: "Anulowane",
        FAILED: "Nieudane",
Severity: Major
Found in src/i18n.ts and 7 other locations - About 35 mins to fix
src/i18n.ts on lines 206..217
src/i18n.ts on lines 292..302
src/i18n.ts on lines 572..582
src/i18n.ts on lines 583..592
src/i18n.ts on lines 954..965
src/i18n.ts on lines 1015..1025
src/i18n.ts on lines 1321..1331

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

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

      CourseProgram: {
        TopicAttachment: "Załączniki lekcji",
        ShowAgenda: "Pokaż agendę",
        NoProgram: "Lekcja nie istnieje",
        NoTopic: "Temat nie istnieje",
Severity: Major
Found in src/i18n.ts and 7 other locations - About 35 mins to fix
src/i18n.ts on lines 206..217
src/i18n.ts on lines 292..302
src/i18n.ts on lines 572..582
src/i18n.ts on lines 583..592
src/i18n.ts on lines 1015..1025
src/i18n.ts on lines 1040..1049
src/i18n.ts on lines 1321..1331

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

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

    case EventTypes.ProductRemovedFromCart:
      return {
        translation,
        object: { name: notification.data.product?.name || "" },
      };
Severity: Minor
Found in src/utils/index.ts and 2 other locations - About 35 mins to fix
src/utils/index.ts on lines 59..63
src/utils/index.ts on lines 210..214

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

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

        <button onClick={() => swiperRef.current?.slideNext()} title="next">
          <ArrowRight />
        </button>
Severity: Minor
Found in src/components/Courses/CoursesSlider/swiper.tsx and 1 other location - About 35 mins to fix
src/components/Courses/CoursesSlider/swiper.tsx on lines 74..76

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

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 questionnaires
    ?.find((element) => element.id === questionnaireId)
    ?.questions.filter((item) => item.public_answers)
    .find((item) => item.type === questionType)?.id;
Severity: Minor
Found in src/utils/questionnaires.ts and 1 other location - About 35 mins to fix
src/pages/courses/course/Components/CourseRatings/Questionnaires/Dropdowns/index.tsx on lines 33..36

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

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

      questionnaires
        ?.find((element) => element.id === questionnaireId)
        ?.questions.filter((item) => item.public_answers)
        .filter((item) => item.type !== QuestionType.REVIEW)
src/utils/questionnaires.ts on lines 127..130

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

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

      LoginPage: {
        RememberMe: "Remember me",
        Lost: "Lost your password?",
        Reset: "Reset your password",
        TempLogin: "For this demo you can use the following credentials",
Severity: Major
Found in src/i18n.ts and 7 other locations - About 35 mins to fix
src/i18n.ts on lines 206..217
src/i18n.ts on lines 572..582
src/i18n.ts on lines 583..592
src/i18n.ts on lines 954..965
src/i18n.ts on lines 1015..1025
src/i18n.ts on lines 1040..1049
src/i18n.ts on lines 1321..1331

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

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

      OrderStatus: {
        NEW: "New",
        PAID: "Paid",
        CANCELLED: "Canceled",
        FAILED: "Failed",
Severity: Major
Found in src/i18n.ts and 7 other locations - About 35 mins to fix
src/i18n.ts on lines 206..217
src/i18n.ts on lines 292..302
src/i18n.ts on lines 572..582
src/i18n.ts on lines 954..965
src/i18n.ts on lines 1015..1025
src/i18n.ts on lines 1040..1049
src/i18n.ts on lines 1321..1331

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

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

      if (!user.value?.email) {
        toast(`${t("MissingEmailError")}`, "error");
        setProcessing(false);
        return;
      }
Severity: Minor
Found in src/hooks/usePayment.ts and 2 other locations - About 35 mins to fix
src/hooks/usePayment.ts on lines 36..40
src/hooks/usePayment.ts on lines 60..64

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

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

    case EventTypes.StationaryEventUnassigned:
      return {
        translation,
        object: { name: notification.data.stationaryEvent?.name || "" },
      };
Severity: Minor
Found in src/utils/index.ts and 2 other locations - About 35 mins to fix
src/utils/index.ts on lines 106..110
src/utils/index.ts on lines 210..214

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

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

      EmailActivation: {
        Title: "Aby dokończyć proces rejestracji sprawdź swoją pocztę",
        Title2:
          "Proces rejestracji zakonczy się kiedy administator zweryfikuje Twoje konto",
        Text: `Wysłaliśmy wiadomość na adres **{{email}}** z
Severity: Minor
Found in src/i18n.ts and 1 other location - About 35 mins to fix
src/i18n.ts on lines 249..262

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

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

Avoid too many return statements within this function.
Open

    return (
      <>
        <CourseAccessButton
          course={course}
          onRequestAccess={onRequestAccess}

    Avoid too many return statements within this function.
    Open

      return BuyButton;

      Avoid too many return statements within this function.
      Open

          return (
            <Link to={`/login?referrer=/package/${product.id}`}>
              <Button mode="secondary" block={isMobile}>
                {t("Buy now")}
              </Button>
      Severity: Major
      Found in src/components/Packages/Package/PackageSidebar/Buttons/index.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return (
            <Button
              mode="secondary"
              onClick={() => history.push(`/consultations/${consultation.id}`)}
            >
        Severity: Major
        Found in src/components/Consultations/ConsultationCard/Buttons/index.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return <Text>{t("CoursePage.UnavailableCourse")}</Text>;

            Avoid too many return statements within this function.
            Open

              return (
                <Button
                  onClick={() => push(`/login?referrer=/courses/${course.id}`)}
                  mode="secondary"
                >

              Avoid too many return statements within this function.
              Open

                return <Status status={StatusTypes.DEFAULT} name={status} />;
              Severity: Major
              Found in src/components/Consultations/ConsultationTutorCard/Status/index.tsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return range(1, lastPage);
                Severity: Major
                Found in src/components/Common/Pagination/index.tsx - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language