EscolaLMS/sdk

View on GitHub

Showing 334 of 334 total issues

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

  fetchProducts: (
    filter: API.PageParams &
      API.PaginationParams & { type?: string; "tags[]"?: string; name?: string }
  ) => Promise.reject(),
Severity: Major
Found in src/react/context/defaults.ts and 3 other locations - About 1 hr to fix
src/react/context/defaults.ts on lines 218..221
src/react/context/defaults.ts on lines 627..630
src/react/context/defaults.ts on lines 631..634

Duplicated Code

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

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

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

Tuning

This issue has a mass of 58.

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

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

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

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

Refactorings

Further Reading

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

  fetchMyProducts: (
    filter: API.PageParams &
      API.PaginationParams & { type?: string; "tags[]"?: string; name?: string }
  ) => Promise.reject(),
Severity: Major
Found in src/react/context/defaults.ts and 3 other locations - About 1 hr to fix
src/react/context/defaults.ts on lines 213..216
src/react/context/defaults.ts on lines 218..221
src/react/context/defaults.ts on lines 627..630

Duplicated Code

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

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

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

Tuning

This issue has a mass of 58.

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

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

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

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

Refactorings

Further Reading

Function readNotify has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    (id: string) => {
      return token
        ? readNotification
            .bind(null, apiUrl)(id, token)
            .then((response) => {
Severity: Minor
Found in src/react/context/notifications.tsx - About 1 hr to fix

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

                  byId: prevState.byId
                    ? {
                        ...prevState.byId,
                        [id]: {
                          error: response,
    Severity: Major
    Found in src/react/context/index.tsx and 1 other location - About 1 hr to fix
    src/react/context/index.tsx on lines 1168..1181

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

    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

                  byId: prevState.byId
                    ? {
                        ...prevState.byId,
                        [id]: {
                          error: response,
    Severity: Major
    Found in src/react/context/index.tsx and 1 other location - About 1 hr to fix
    src/react/context/index.tsx on lines 1456..1469

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

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

      const progressMap = useMemo(() => {
        const defaultMap: {
          coursesProcProgress: Record<number, number>;
          finishedTopics: number[];
        } = {
    Severity: Minor
    Found in src/react/context/index.tsx - About 1 hr to fix

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

        sendQuestionnaireAnswer: (
          model: string,
          modelID: number,
          id: number,
          body: Partial<EscolaLms.Questionnaire.Models.QuestionAnswer>
      Severity: Major
      Found in src/react/context/defaults.ts and 1 other location - About 1 hr to fix
      src/react/context/defaults.ts on lines 688..693

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

      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

        const fetchCertificate = useCallback(
          (id: number) => {
            return token
              ? getCertificate.bind(null, apiUrl)(token, id)
              : Promise.reject("noToken");
      Severity: Major
      Found in src/react/context/index.tsx and 2 other locations - About 1 hr to fix
      src/react/context/index.tsx on lines 964..971
      src/react/context/index.tsx on lines 1048..1055

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

      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

        const getProductInfo = useCallback(
          (id: number) => {
            return token
              ? getSingleProduct.bind(null, apiUrl)(id, token)
              : Promise.reject("noToken");
      Severity: Major
      Found in src/react/context/index.tsx and 2 other locations - About 1 hr to fix
      src/react/context/index.tsx on lines 955..962
      src/react/context/index.tsx on lines 964..971

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

      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

        const generateCertificate = useCallback(
          (id: number) => {
            return token
              ? generateCertificatePdf.bind(null, apiUrl)(token, id)
              : Promise.reject("noToken");
      Severity: Major
      Found in src/react/context/index.tsx and 2 other locations - About 1 hr to fix
      src/react/context/index.tsx on lines 955..962
      src/react/context/index.tsx on lines 1048..1055

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

      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

          {
            method: "POST",
            /* useCache: true */ useCache: false,
            headers: {
              "Content-Type": "application/json",
      Severity: Major
      Found in src/services/notify.ts and 1 other location - About 1 hr to fix
      src/services/notify.ts on lines 52..61

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

      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

        sendQuestionnaireAnswer: (
          model: string,
          modelID: number,
          id: number,
          body: Partial<EscolaLms.Questionnaire.Models.QuestionAnswer>
      Severity: Major
      Found in src/react/context/defaults.ts and 1 other location - About 1 hr to fix
      src/react/context/defaults.ts on lines 288..293

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

      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

          {
            method: "POST",
            /* useCache: true */ useCache: false,
            headers: {
              "Content-Type": "application/json",
      Severity: Major
      Found in src/services/notify.ts and 1 other location - About 1 hr to fix
      src/services/notify.ts on lines 32..41

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

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

        fetchScheduleTutors: () => Promise<
          | void
          | API.DefaultResponse<API.LessonTutor>
          | API.DefaultMetaResponse<API.LessonTutor>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 129..133
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 151..153
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 359..363
      src/react/context/types.ts on lines 389..393
      src/react/context/types.ts on lines 429..433
      src/react/context/types.ts on lines 530..534

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

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

        fetchSchedule: () => Promise<
          | void
          | API.DefaultResponse<API.ScheduleData>
          | API.DefaultMetaResponse<API.ScheduleData>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 129..133
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 151..153
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 359..363
      src/react/context/types.ts on lines 389..393
      src/react/context/types.ts on lines 429..433
      src/react/context/types.ts on lines 535..539

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

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

        fetchUserStationaryEvents: () => Promise<
          | void
          | API.DefaultResponse<API.StationaryEvent>
          | API.DefaultMetaResponse<API.StationaryEvent>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 129..133
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 151..153
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 359..363
      src/react/context/types.ts on lines 389..393
      src/react/context/types.ts on lines 530..534
      src/react/context/types.ts on lines 535..539

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

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

        fetchTutorConsultations: () => Promise<
          | void
          | API.DefaultResponse<API.AppointmentTerm>
          | API.DefaultMetaResponse<API.AppointmentTerm>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 129..133
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 151..153
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 389..393
      src/react/context/types.ts on lines 429..433
      src/react/context/types.ts on lines 530..534
      src/react/context/types.ts on lines 535..539

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

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

        fetchRegisterableGroups: () => Promise<
          | void
          | API.DefaultResponse<API.UserGroup>
          | API.DefaultMetaResponse<API.UserGroup>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 151..153
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 359..363
      src/react/context/types.ts on lines 389..393
      src/react/context/types.ts on lines 429..433
      src/react/context/types.ts on lines 530..534
      src/react/context/types.ts on lines 535..539

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

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

        fetchTags: () => Promise<
          void | API.DefaultResponse<API.Tag> | API.DefaultMetaResponse<API.Tag>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 129..133
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 359..363
      src/react/context/types.ts on lines 389..393
      src/react/context/types.ts on lines 429..433
      src/react/context/types.ts on lines 530..534
      src/react/context/types.ts on lines 535..539

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

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

        fetchUserWebinars: () => Promise<
          | void
          | API.DefaultResponse<API.Webinar>
          | API.DefaultMetaResponse<API.Webinar>
        >;
      Severity: Major
      Found in src/react/context/types.ts and 17 other locations - About 55 mins to fix
      src/react/context/types.ts on lines 129..133
      src/react/context/types.ts on lines 136..140
      src/react/context/types.ts on lines 141..145
      src/react/context/types.ts on lines 146..150
      src/react/context/types.ts on lines 151..153
      src/react/context/types.ts on lines 170..172
      src/react/context/types.ts on lines 186..190
      src/react/context/types.ts on lines 209..213
      src/react/context/types.ts on lines 226..230
      src/react/context/types.ts on lines 231..235
      src/react/context/types.ts on lines 247..251
      src/react/context/types.ts on lines 252..254
      src/react/context/types.ts on lines 295..299
      src/react/context/types.ts on lines 359..363
      src/react/context/types.ts on lines 429..433
      src/react/context/types.ts on lines 530..534
      src/react/context/types.ts on lines 535..539

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

      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