EscolaLMS/sdk

View on GitHub

Showing 336 of 336 total issues

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

  const fetchBookmarkNotes = useCallback(
    (filter: API.BookmarkNoteParams = { page: 0, per_page: 25 }) => {
      return token
        ? fetchDataType<API.BookmarkNote>({
            controllers: abortControllers.current,
Severity: Major
Found in src/react/context/bookmark_notes.tsx and 4 other locations - About 6 hrs to fix
src/react/context/consultations_access.tsx on lines 83..110
src/react/context/course_access.tsx on lines 118..141
src/react/context/notifications.tsx on lines 69..92
src/react/context/tasks.tsx on lines 77..94

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

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

  const fetchConsultationAccess = useCallback(
    (
      filter: API.ConsultationsAccessEnquiryParams = {
        page: 1,
        per_page: 25,
Severity: Major
Found in src/react/context/consultations_access.tsx and 4 other locations - About 6 hrs to fix
src/react/context/bookmark_notes.tsx on lines 83..101
src/react/context/course_access.tsx on lines 118..141
src/react/context/notifications.tsx on lines 69..92
src/react/context/tasks.tsx on lines 77..94

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

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

  const fetchNotifications = useCallback(
    (
      filter: API.PaginationParams = {
        page: 0,
        per_page: 25,
Severity: Major
Found in src/react/context/notifications.tsx and 4 other locations - About 6 hrs to fix
src/react/context/bookmark_notes.tsx on lines 83..101
src/react/context/consultations_access.tsx on lines 83..110
src/react/context/course_access.tsx on lines 118..141
src/react/context/tasks.tsx on lines 77..94

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

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

  const fetchTasks = useCallback(
    (filter: API.TaskParams = { current: 0, pageSize: 25 }) => {
      return token
        ? fetchDataType<API.Task>({
            controllers: abortControllers.current,
Severity: Major
Found in src/react/context/tasks.tsx and 4 other locations - About 6 hrs to fix
src/react/context/bookmark_notes.tsx on lines 83..101
src/react/context/consultations_access.tsx on lines 83..110
src/react/context/course_access.tsx on lines 118..141
src/react/context/notifications.tsx on lines 69..92

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

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

  const fetchCourseAccess = useCallback(
    (
      filter: API.CourseAccessEnquiryListParams = {
        current_page: 0,
        per_page: 25,
Severity: Major
Found in src/react/context/course_access.tsx and 4 other locations - About 6 hrs to fix
src/react/context/bookmark_notes.tsx on lines 83..101
src/react/context/consultations_access.tsx on lines 83..110
src/react/context/notifications.tsx on lines 69..92
src/react/context/tasks.tsx on lines 77..94

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

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

export async function fetchDataType<T>(params: fetchDataType<T>) {
  const { setState, fetchAction, mode, controller, controllers, onError } =
    params;

  if (mode === "paginated") {
Severity: Major
Found in src/react/context/states.ts - About 6 hrs to fix

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

      const fetchMyAuthoredCourses = useCallback(
        (params?: API.PaginationParams) => {
          return token
            ? fetchDataType<API.Course>({
                controllers: abortControllers.current,
    Severity: Major
    Found in src/react/context/index.tsx and 4 other locations - About 6 hrs to fix
    src/react/context/challenges.tsx on lines 88..105
    src/react/context/index.tsx on lines 1382..1404
    src/react/context/index.tsx on lines 1511..1528
    src/react/context/subjects.tsx on lines 66..83

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

      const fetchPaginatedProgress = useCallback(
        (filter: API.PaginatedProgressParams) => {
          return token
            ? fetchDataType<API.CourseProgressItem>({
                controllers: abortControllers.current,
    Severity: Major
    Found in src/react/context/index.tsx and 4 other locations - About 6 hrs to fix
    src/react/context/challenges.tsx on lines 88..105
    src/react/context/index.tsx on lines 1406..1428
    src/react/context/index.tsx on lines 1511..1528
    src/react/context/subjects.tsx on lines 66..83

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

      const fetchSubjects = useCallback(
        (params?: API.SubjectsParams) => {
          return token
            ? fetchDataType<API.GroupSubject>({
                controllers: abortControllers.current,
    Severity: Major
    Found in src/react/context/subjects.tsx and 4 other locations - About 6 hrs to fix
    src/react/context/challenges.tsx on lines 88..105
    src/react/context/index.tsx on lines 1382..1404
    src/react/context/index.tsx on lines 1406..1428
    src/react/context/index.tsx on lines 1511..1528

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

      const fetchChallenges = useCallback(
        (filter?: API.ChallengesParams) => {
          return token
            ? fetchDataType<API.CompetencyChallenge>({
                controllers: abortControllers.current,
    Severity: Major
    Found in src/react/context/challenges.tsx and 4 other locations - About 6 hrs to fix
    src/react/context/index.tsx on lines 1382..1404
    src/react/context/index.tsx on lines 1406..1428
    src/react/context/index.tsx on lines 1511..1528
    src/react/context/subjects.tsx on lines 66..83

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

      const fetchOrders = useCallback(
        (params?: API.PaginationParams) => {
          return token
            ? fetchDataType<API.Order>({
                controllers: abortControllers.current,
    Severity: Major
    Found in src/react/context/index.tsx and 4 other locations - About 6 hrs to fix
    src/react/context/challenges.tsx on lines 88..105
    src/react/context/index.tsx on lines 1382..1404
    src/react/context/index.tsx on lines 1406..1428
    src/react/context/subjects.tsx on lines 66..83

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

    export async function updateTask(
      apiUrl: string,
      token: string,
      id: number,
      body: EscolaLms.Tasks.Http.Requests.UpdateTaskRequest,
    Severity: Major
    Found in src/services/task_notes.ts and 1 other location - About 6 hrs to fix
    src/services/tasks.ts on lines 108..126

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

    export async function updateTask(
      apiUrl: string,
      token: string,
      id: number,
      body: EscolaLms.Tasks.Http.Requests.UpdateTaskRequest,
    Severity: Major
    Found in src/services/tasks.ts and 1 other location - About 6 hrs to fix
    src/services/task_notes.ts on lines 25..43

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 158.

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

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

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

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

    Refactorings

    Further Reading

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

    export async function approveConsultation(
      apiUrl: string,
      token: string,
      id: number,
      term: string,
    Severity: Major
    Found in src/services/consultations.ts and 1 other location - About 5 hrs to fix
    src/services/consultations.ts on lines 125..148

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 153.

    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 async function rejectConsultation(
      apiUrl: string,
      token: string,
      id: number,
      term: string,
    Severity: Major
    Found in src/services/consultations.ts and 1 other location - About 5 hrs to fix
    src/services/consultations.ts on lines 99..122

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

    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

    File user.tsx has 402 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      createContext,
      FunctionComponent,
      PropsWithChildren,
      useCallback,
    Severity: Minor
    Found in src/react/context/user.tsx - About 5 hrs to fix

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

        const approveConsultationTerm = useCallback(
          (id: number, term: string, userId?: number) => {
            return token
              ? fetchDataType<API.AppointmentTerm>({
                  controllers: abortControllers.current,
      Severity: Major
      Found in src/react/context/index.tsx and 1 other location - About 5 hrs to fix
      src/react/context/index.tsx on lines 892..913

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

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

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

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

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

      Refactorings

      Further Reading

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

        const rejectConsultationTerm = useCallback(
          (id: number, term: string, userId?: number) => {
            return token
              ? fetchDataType<API.AppointmentTerm>({
                  controllers: abortControllers.current,
      Severity: Major
      Found in src/react/context/index.tsx and 1 other location - About 5 hrs to fix
      src/react/context/index.tsx on lines 868..890

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

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

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

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

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

      Refactorings

      Further Reading

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

        const fetchFields = useCallback((filter: API.FieldsParams) => {
          return fetchDataType<API.Metadata>({
            controllers: abortControllers.current,
            controller: `fields/${JSON.stringify(filter)}`,
            mode: "list",
      Severity: Major
      Found in src/react/context/index.tsx and 1 other location - About 5 hrs to fix
      src/react/context/index.tsx on lines 792..808

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

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

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

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

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

      Refactorings

      Further Reading

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

        const fetchStationaryEvents = useCallback(
          (filter: API.StationaryEventsParams) => {
            return fetchDataType<API.StationaryEvent>({
              controllers: abortControllers.current,
              controller: `stationaryevents/${JSON.stringify(filter)}`,
      Severity: Major
      Found in src/react/context/index.tsx and 1 other location - About 5 hrs to fix
      src/react/context/index.tsx on lines 777..788

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

      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