EscolaLMS/Front

View on GitHub

Showing 585 of 585 total issues

Function CourseProgram has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CourseProgram = () => {
  const { t } = useTranslation();

  const { id } = useParams<{ id: string }>();
  const { program, fetchProgram } = useContext(EscolaLMSContext);
Severity: Minor
Found in src/pages/courses/preview/index.tsx - About 1 hr to fix

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

    export const IconLocation = () => (
      <svg
        width="25"
        height="25"
        viewBox="0 0 25 25"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const IconChevronDoubleDown = () => (
      <svg
        width="15"
        height="15"
        viewBox="0 0 15 15"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const ShareIcon = () => (
      <svg
        width="16"
        height="20"
        viewBox="0 0 16 20"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const ThumbUp = () => (
      <svg
        width="23"
        height="21"
        viewBox="0 0 23 21"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const IconUser = () => (
      <svg
        width="19"
        height="21"
        viewBox="0 0 19 21"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1049..1062

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

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

    export const DownloadIcon = () => (
      <svg
        width="16"
        height="20"
        viewBox="0 0 16 20"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const StarOrange = () => (
      <svg
        width="21"
        height="21"
        viewBox="0 0 21 21"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const IconChevronDoubleUp = () => (
      <svg
        width="15"
        height="15"
        viewBox="0 0 15 15"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const Medal = () => (
      <svg
        width="23"
        height="23"
        viewBox="0 0 23 23"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const IconUsers = () => (
      <svg
        width="22"
        height="22"
        viewBox="0 0 22 22"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047
    src/icons/index.tsx on lines 1049..1062

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

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

    export const IconDoubleUser = () => (
      <svg
        width="21"
        height="21"
        viewBox="0 0 21 21"
    Severity: Major
    Found in src/icons/index.tsx and 10 other locations - About 1 hr to fix
    src/icons/index.tsx on lines 283..296
    src/icons/index.tsx on lines 298..311
    src/icons/index.tsx on lines 313..326
    src/icons/index.tsx on lines 817..830
    src/icons/index.tsx on lines 832..845
    src/icons/index.tsx on lines 974..987
    src/icons/index.tsx on lines 989..1002
    src/icons/index.tsx on lines 1004..1017
    src/icons/index.tsx on lines 1019..1032
    src/icons/index.tsx on lines 1034..1047

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

    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

              {filteredConsultations.map((consultation) => (
                <Col key={consultation.id} xs={12} sm={6} md={4} lg={3}>
                  <ConsultationCard consultation={consultation} />
                </Col>
              ))}
    Severity: Major
    Found in src/components/Consultations/ConsultationsSlider/index.tsx and 1 other location - About 1 hr to fix
    src/components/Consultations/List/ConsultationsCollection/index.tsx on lines 42..46

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

    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

              .map((consultation: API.Consultation) => (
                <Col key={consultation.id} xs={12} sm={6} md={4} lg={3}>
                  <ConsultationCard consultation={consultation} />
                </Col>
              ))}
    src/components/Consultations/ConsultationsSlider/index.tsx on lines 109..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 67.

    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 CourseAccessButton has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    const CourseAccessButton: React.FC<CourseAccessButtonProps> = ({
      course,
      onRequestAccess,
      setModalVisible,
    }) => {

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function ProposedTermsContent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    const ProposedTermsContent = ({ consultation, onClose }: Props) => {
      const [selectedDate, setSelectedDay] = useState<Date | null>(null);
      const [selectedTime, setSelectedTime] = useState<Date | null>(null);
      const [loading, setLoading] = useState(false);
      const [step, setStep] = useState(1);
    Severity: Minor
    Found in src/components/Book/BookTermModal/ProposedTermsContent/index.tsx - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function SubscriptionBox has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    const SubscriptionBox: React.FC<Props> = ({ subscription }) => {
      const { t } = useTranslation();
      const { buySubscriptionByP24, user } = usePayment();
    
      const history = useHistory();
    Severity: Minor
    Found in src/components/Subscriptions/Box/index.tsx - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function WebinarSidebar has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const WebinarSidebar = () => {
      const {
        webinar: { value: webinarObject },
      } = useContext(EscolaLMSContext);
      const { t } = useTranslation();
    Severity: Minor
    Found in src/components/Webinars/Webinar/WebinarSidebar/index.tsx - About 1 hr to fix

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

        const {
          completeCurrentTopic,
          currentTopic,
          finishedTopicsIds,
          courseId,
      src/components/Cart/CartContent/stripe.tsx on lines 35..47

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

      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

          case EventTypes.PaymentFailed:
            return {
              translation,
              object: {
                amount: getPriceWithTax(notification.data.payment?.amount ?? 0) || 0,
      Severity: Major
      Found in src/utils/index.ts and 1 other location - About 1 hr to fix
      src/utils/index.ts on lines 134..141

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

      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