EscolaLMS/sdk

View on GitHub

Showing 336 of 336 total issues

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

  fetchConsultationAccess: (
    filter?: API.CourseAccessEnquiryListParams
  ) => Promise<API.DefaultMetaResponse<API.ConsultationsAccessEnquiry>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  fetchBookmarkNotes: (
    filter?: API.BookmarkNoteParams
  ) => Promise<API.DefaultMetaResponse<API.BookmarkNote>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 520..522

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

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

  fetchCourseAccess: (
    filter?: API.CourseAccessEnquiryListParams
  ) => Promise<API.DefaultMetaResponse<API.CourseAccessEnquiry>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  addCourseAccess: (
    data: API.CourseAccessEnquiryCreateRequest
  ) => Promise<API.DefaultResponse<API.CourseAccessEnquiry>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

      } else {
        if (Array.isArray(flatTopics) && flatTopics[currentTopicIndex - 1]) {
          return flatTopics[currentTopicIndex - 1] || null;
        }
      }
Severity: Minor
Found in src/react/context/index.tsx and 1 other location - About 30 mins to fix
src/react/context/index.tsx on lines 1776..1780

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

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

  fetchWebinars: (
    filter: API.WebinarParams
  ) => Promise<API.DefaultMetaResponse<API.Webinar>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  fetchPaginatedProgress: (
    filter: API.PaginatedProgressParams
  ) => Promise<API.DefaultMetaResponse<API.CourseProgressItem>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  register: (
    body: API.RegisterRequest
  ) => Promise<API.DefaultResponse<API.RegisterResponse>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

      if (next) {
        if (Array.isArray(flatTopics) && flatTopics[currentTopicIndex + 1]) {
          return flatTopics[currentTopicIndex + 1] || null;
        }
      } else {
Severity: Minor
Found in src/react/context/index.tsx and 1 other location - About 30 mins to fix
src/react/context/index.tsx on lines 1780..1784

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

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

  fetchTasks: (
    filter: API.TaskParams
  ) => Promise<API.DefaultMetaResponse<API.Task>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  createBookmarkNote: (
    body: API.CreateBookmarkNote
  ) => Promise<API.DefaultResponse<API.BookmarkNote>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519

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

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

  fetchNotifications: (
    filter?: API.PaginationParams
  ) => Promise<API.DefaultMetaResponse<API.Notification>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  updateProfile: (
    data: API.UpdateUserDetails
  ) => Promise<API.DefaultResponse<API.UserAsProfile>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 469..471
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

  addConsultationAccess: (
    data: API.ConsultationsAccessEnquiryCreateRequest
  ) => Promise<API.DefaultResponse<API.ConsultationsAccessEnquiry>>;
Severity: Major
Found in src/react/context/types.ts and 14 other locations - About 30 mins to fix
src/react/context/types.ts on lines 108..110
src/react/context/types.ts on lines 111..113
src/react/context/types.ts on lines 156..158
src/react/context/types.ts on lines 191..193
src/react/context/types.ts on lines 260..262
src/react/context/types.ts on lines 263..265
src/react/context/types.ts on lines 274..276
src/react/context/types.ts on lines 350..352
src/react/context/types.ts on lines 449..451
src/react/context/types.ts on lines 452..454
src/react/context/types.ts on lines 456..458
src/react/context/types.ts on lines 466..468
src/react/context/types.ts on lines 517..519
src/react/context/types.ts on lines 520..522

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

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

export function useLocalStorage<T>(
  storeKey: string,
  key: string,
  initialValue: T,
  ssrHydration: boolean = false
Severity: Minor
Found in src/react/hooks/useLocalStorage.ts - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function TasksContextProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

> = ({ children, defaults, apiUrl, ssrHydration }) => {
  const abortControllers = useRef<Record<string, AbortController | null>>({});

  const { token } = useContext(UserContext);

Severity: Minor
Found in src/react/context/tasks.tsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

Severity
Category
Status
Source
Language