EscolaLMS/sdk

View on GitHub

Showing 334 of 334 total issues

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

  fetchPayments: () => Promise<
    | void
    | API.DefaultResponse<API.Payment>
    | API.DefaultMetaResponse<API.Payment>
  >;
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 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

  fetchSettings: () => Promise<
    | void
    | API.DefaultResponse<API.AppSettings>
    | API.DefaultMetaResponse<API.AppSettings>
  >;
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 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

  fetchCart: () => Promise<
    void | API.DefaultResponse<API.Cart> | API.DefaultMetaResponse<API.Cart>
  >;
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 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

  fetchProgress: () => Promise<
    | void
    | API.DefaultResponse<API.CourseProgress>
    | API.DefaultMetaResponse<API.CourseProgress>
  >;
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 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 4 locations. Consider refactoring.
Open

  return (
    <NotificationsContext.Provider
      value={{
        readAllNotifications,
        notifications,
Severity: Major
Found in src/react/context/notifications.tsx and 3 other locations - About 55 mins to fix
src/react/context/challenges.tsx on lines 125..136
src/react/context/studentDetails.tsx on lines 118..129
src/react/context/tasks.tsx on lines 116..127

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

  return (
    <ChallengesContext.Provider
      value={{
        challenges,
        fetchChallenges,
Severity: Major
Found in src/react/context/challenges.tsx and 3 other locations - About 55 mins to fix
src/react/context/notifications.tsx on lines 173..184
src/react/context/studentDetails.tsx on lines 118..129
src/react/context/tasks.tsx on lines 116..127

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

  fetchCategories: () => Promise<
    | void
    | API.DefaultResponse<API.Category>
    | API.DefaultMetaResponse<API.Category>
  >;
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 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

  fetchConfig: () => Promise<
    | void
    | API.DefaultResponse<API.AppConfig>
    | API.DefaultMetaResponse<API.AppConfig>
  >;
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 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

  fetchPages: () => Promise<
    void | API.DefaultResponse<API.Page> | API.DefaultMetaResponse<API.Page>
  >;
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 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

  fetchTutors: () => Promise<
    | void
    | API.DefaultResponse<API.UserItem>
    | API.DefaultMetaResponse<API.UserItem>
  >;
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 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

  fetchUserConsultations: () => Promise<
    | void
    | API.DefaultResponse<API.Consultation>
    | API.DefaultMetaResponse<API.Consultation>
  >;
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 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

  fetchProfile: () => Promise<
    | void
    | API.DefaultResponse<API.UserAsProfile>
    | API.DefaultMetaResponse<API.UserAsProfile>
  >;
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 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

  fetchMattermostChannels: () => Promise<
    | void
    | API.DefaultResponse<API.MattermostData>
    | API.DefaultMetaResponse<API.MattermostData>
  >;
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 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 4 locations. Consider refactoring.
Open

  return (
    <StudentDetailsContext.Provider
      value={{
        academicYears,
        fetchAcademicYears,
Severity: Major
Found in src/react/context/studentDetails.tsx and 3 other locations - About 55 mins to fix
src/react/context/challenges.tsx on lines 125..136
src/react/context/notifications.tsx on lines 173..184
src/react/context/tasks.tsx on lines 116..127

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

  return (
    <TasksContext.Provider
      value={{
        tasks,
        fetchTasks,
Severity: Major
Found in src/react/context/tasks.tsx and 3 other locations - About 55 mins to fix
src/react/context/challenges.tsx on lines 125..136
src/react/context/notifications.tsx on lines 173..184
src/react/context/studentDetails.tsx on lines 118..129

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

  const addCourseAccess = useCallback(
    (data: API.CourseAccessEnquiryCreateRequest) => {
      return token
        ? createCourseAccess(apiUrl, token, data)
        : Promise.reject("noToken");
Severity: Major
Found in src/react/context/course_access.tsx and 2 other locations - About 55 mins to fix
src/react/context/bookmark_notes.tsx on lines 103..110
src/react/context/consultations_access.tsx on lines 112..119

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

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 addConsultationAccess = useCallback(
    (data: API.ConsultationsAccessEnquiryCreateRequest) => {
      return token
        ? createConsultationAccess(apiUrl, token, data)
        : Promise.reject("noToken");
Severity: Major
Found in src/react/context/consultations_access.tsx and 2 other locations - About 55 mins to fix
src/react/context/bookmark_notes.tsx on lines 103..110
src/react/context/course_access.tsx on lines 143..150

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

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 createBookmarkNote = useCallback(
    (data: API.CreateBookmarkNote) => {
      return token
        ? postCreateBookmarkNote(apiUrl, token, data)
        : Promise.reject("noToken");
Severity: Major
Found in src/react/context/bookmark_notes.tsx and 2 other locations - About 55 mins to fix
src/react/context/consultations_access.tsx on lines 112..119
src/react/context/course_access.tsx on lines 143..150

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

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 interface UserContextProviderType {
  apiUrl: string;
  defaults?: Partial<Pick<EscolaLMSContextReadConfig, "user" | "token">>;
  ssrHydration?: boolean;
}
Severity: Minor
Found in src/react/context/user.tsx and 1 other location - About 50 mins to fix
src/react/context/studentDetails.tsx on lines 45..52

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

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 interface ContextPaginatedMetaState<T> {
  loading: boolean;
  list?: API.PaginatedMetaList<T>;
  error?: API.DefaultResponseError;
}
Severity: Minor
Found in src/react/context/types.ts and 1 other location - About 50 mins to fix
src/react/context/types.ts on lines 16..20

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

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