radar/twist-v2

View on GitHub

Showing 114 of 143 total issues

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

export type CurrentUserQuery = { readonly __typename: 'Query', readonly currentUser?: Maybe<{ readonly __typename: 'User', readonly id: string, readonly githubLogin?: Maybe<string>, readonly email: string }> };
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 505..505

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

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

      <ul className="list-disc list-inside">
        {filteredReaders.map((reader, index) => (
          <ReaderItem
            {...reader}
            key={reader.id}
Severity: Major
Found in frontend/src/Book/Invitations/Readers.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Invitations/Readers.tsx on lines 66..75

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

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

  module Web
    module GraphQL
      module Mutations
        module Notes
          class Update < BaseMutation
Severity: Major
Found in backend/lib/twist/web/graphql/mutations/notes/update.rb and 1 other location - About 1 hr to fix
backend/lib/twist/web/graphql/mutations/comments/update.rb on lines 2..24

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

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

  module Web
    module GraphQL
      module Mutations
        module Comments
          class Update < BaseMutation
Severity: Major
Found in backend/lib/twist/web/graphql/mutations/comments/update.rb and 1 other location - About 1 hr to fix
backend/lib/twist/web/graphql/mutations/notes/update.rb on lines 2..21

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

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 type RemoveReaderMutation = { readonly __typename: 'Mutations', readonly removeReader: { readonly __typename: 'RemovePayload', readonly bookId?: Maybe<string>, readonly userId?: Maybe<string> } };
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 513..513

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

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 type InviteUserMutation = { readonly __typename: 'Mutations', readonly inviteUser: { readonly __typename: 'InvitePayload', readonly bookId?: Maybe<string>, readonly userId?: Maybe<string> } };
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 528..528

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

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 type ChapterQuery = { readonly __typename: 'Query', readonly book: { readonly __typename: 'Book', readonly title: string, readonly id: string, readonly permalink: string, readonly latestCommit: { readonly __typename: 'Commit', readonly sha: string }, readonly commit: { readonly __typename: 'Commit', readonly id: string, readonly sha: string, readonly createdAt: string, readonly branch: { readonly __typename: 'Branch', readonly name: string }, readonly chapter: { readonly __typename: 'Chapter', readonly id: string, readonly title: string, readonly position: number, readonly permalink: string, readonly part: string, readonly sections: ReadonlyArray<(
          { readonly __typename: 'Section', readonly subsections: ReadonlyArray<(
            { readonly __typename: 'Section' }
            & SectionFragmentFragment
          )> }
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 628..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 60.

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 type BookNotesQuery = { readonly __typename: 'Query', readonly elementsWithNotes: ReadonlyArray<(
    { readonly __typename: 'Element', readonly notes: ReadonlyArray<(
      { readonly __typename: 'Note' }
      & NoteFragment
    )> }
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 452..458

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

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

  const checkForSubmit = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
    if (e.metaKey && e.key === "Enter") {
      submit(e);
    }
  };
Severity: Major
Found in frontend/src/Book/Note/EditForm.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Note/Comments/EditForm.tsx on lines 27..31

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

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

  const checkForSubmit = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
    if (e.metaKey && e.key === "Enter") {
      submit(e);
    }
  };
Severity: Major
Found in frontend/src/Book/Note/Comments/EditForm.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Note/EditForm.tsx on lines 25..29

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

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 type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 6..6

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

    return (
      <ul className="section_listing">
        {sections.map((section) => (
          <Section {...section} key={section.id} />
        ))}
Severity: Major
Found in frontend/src/Book/Chapter/SectionList.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Chapter/SectionList.tsx on lines 18..24

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

export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
Severity: Major
Found in frontend/src/graphql/types.ts and 1 other location - About 1 hr to fix
frontend/src/graphql/types.ts on lines 5..5

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

    return (
      <ul className="section_listing">
        {subsections.map((section) => (
          <Subsection {...section} key={section.id} />
        ))}
Severity: Major
Found in frontend/src/Book/Chapter/SectionList.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Chapter/SectionList.tsx on lines 59..65

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

export class PreviousChapterLink extends Component<
  Omit<ChapterLinkProps, "direction">
> {
  render() {
    return <ChapterLink {...this.props} direction="back" />;
Severity: Major
Found in frontend/src/Book/Chapter/Link.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Chapter/Link.tsx on lines 59..65

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

export class NextChapterLink extends Component<
  Omit<ChapterLinkProps, "direction">
> {
  render() {
    return <ChapterLink {...this.props} direction="forward" />;
Severity: Major
Found in frontend/src/Book/Chapter/Link.tsx and 1 other location - About 1 hr to fix
frontend/src/Book/Chapter/Link.tsx on lines 51..57

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

export function useBranchesQuery(baseOptions: Apollo.QueryHookOptions<BranchesQuery, BranchesQueryVariables>) {
        return Apollo.useQuery<BranchesQuery, BranchesQueryVariables>(BranchesDocument, baseOptions);
      }
Severity: Major
Found in frontend/src/graphql/types.ts and 25 other locations - About 55 mins to fix
frontend/src/graphql/types.ts on lines 792..794
frontend/src/graphql/types.ts on lines 828..830
frontend/src/graphql/types.ts on lines 872..874
frontend/src/graphql/types.ts on lines 1002..1004
frontend/src/graphql/types.ts on lines 1039..1041
frontend/src/graphql/types.ts on lines 1075..1077
frontend/src/graphql/types.ts on lines 1118..1120
frontend/src/graphql/types.ts on lines 1153..1155
frontend/src/graphql/types.ts on lines 1190..1192
frontend/src/graphql/types.ts on lines 1231..1233
frontend/src/graphql/types.ts on lines 1268..1270
frontend/src/graphql/types.ts on lines 1303..1305
frontend/src/graphql/types.ts on lines 1339..1341
frontend/src/graphql/types.ts on lines 1372..1374
frontend/src/graphql/types.ts on lines 1402..1404
frontend/src/graphql/types.ts on lines 1437..1439
frontend/src/graphql/types.ts on lines 1471..1473
frontend/src/graphql/types.ts on lines 1506..1508
frontend/src/graphql/types.ts on lines 1542..1544
frontend/src/graphql/types.ts on lines 1577..1579
frontend/src/graphql/types.ts on lines 1611..1613
frontend/src/graphql/types.ts on lines 1649..1651
frontend/src/graphql/types.ts on lines 1684..1686
frontend/src/graphql/types.ts on lines 1719..1721
frontend/src/graphql/types.ts on lines 1761..1763

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

export function useCurrentUserQuery(baseOptions?: Apollo.QueryHookOptions<CurrentUserQuery, CurrentUserQueryVariables>) {
        return Apollo.useQuery<CurrentUserQuery, CurrentUserQueryVariables>(CurrentUserDocument, baseOptions);
      }
Severity: Major
Found in frontend/src/graphql/types.ts and 25 other locations - About 55 mins to fix
frontend/src/graphql/types.ts on lines 792..794
frontend/src/graphql/types.ts on lines 828..830
frontend/src/graphql/types.ts on lines 872..874
frontend/src/graphql/types.ts on lines 913..915
frontend/src/graphql/types.ts on lines 1002..1004
frontend/src/graphql/types.ts on lines 1039..1041
frontend/src/graphql/types.ts on lines 1075..1077
frontend/src/graphql/types.ts on lines 1118..1120
frontend/src/graphql/types.ts on lines 1153..1155
frontend/src/graphql/types.ts on lines 1190..1192
frontend/src/graphql/types.ts on lines 1231..1233
frontend/src/graphql/types.ts on lines 1268..1270
frontend/src/graphql/types.ts on lines 1303..1305
frontend/src/graphql/types.ts on lines 1339..1341
frontend/src/graphql/types.ts on lines 1372..1374
frontend/src/graphql/types.ts on lines 1402..1404
frontend/src/graphql/types.ts on lines 1437..1439
frontend/src/graphql/types.ts on lines 1471..1473
frontend/src/graphql/types.ts on lines 1506..1508
frontend/src/graphql/types.ts on lines 1542..1544
frontend/src/graphql/types.ts on lines 1577..1579
frontend/src/graphql/types.ts on lines 1611..1613
frontend/src/graphql/types.ts on lines 1649..1651
frontend/src/graphql/types.ts on lines 1684..1686
frontend/src/graphql/types.ts on lines 1761..1763

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

export function useChapterQuery(baseOptions: Apollo.QueryHookOptions<ChapterQuery, ChapterQueryVariables>) {
        return Apollo.useQuery<ChapterQuery, ChapterQueryVariables>(ChapterDocument, baseOptions);
      }
Severity: Major
Found in frontend/src/graphql/types.ts and 25 other locations - About 55 mins to fix
frontend/src/graphql/types.ts on lines 792..794
frontend/src/graphql/types.ts on lines 828..830
frontend/src/graphql/types.ts on lines 872..874
frontend/src/graphql/types.ts on lines 913..915
frontend/src/graphql/types.ts on lines 1039..1041
frontend/src/graphql/types.ts on lines 1075..1077
frontend/src/graphql/types.ts on lines 1118..1120
frontend/src/graphql/types.ts on lines 1153..1155
frontend/src/graphql/types.ts on lines 1190..1192
frontend/src/graphql/types.ts on lines 1231..1233
frontend/src/graphql/types.ts on lines 1268..1270
frontend/src/graphql/types.ts on lines 1303..1305
frontend/src/graphql/types.ts on lines 1339..1341
frontend/src/graphql/types.ts on lines 1372..1374
frontend/src/graphql/types.ts on lines 1402..1404
frontend/src/graphql/types.ts on lines 1437..1439
frontend/src/graphql/types.ts on lines 1471..1473
frontend/src/graphql/types.ts on lines 1506..1508
frontend/src/graphql/types.ts on lines 1542..1544
frontend/src/graphql/types.ts on lines 1577..1579
frontend/src/graphql/types.ts on lines 1611..1613
frontend/src/graphql/types.ts on lines 1649..1651
frontend/src/graphql/types.ts on lines 1684..1686
frontend/src/graphql/types.ts on lines 1719..1721
frontend/src/graphql/types.ts on lines 1761..1763

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

export function useUsersQuery(baseOptions: Apollo.QueryHookOptions<UsersQuery, UsersQueryVariables>) {
        return Apollo.useQuery<UsersQuery, UsersQueryVariables>(UsersDocument, baseOptions);
      }
Severity: Major
Found in frontend/src/graphql/types.ts and 25 other locations - About 55 mins to fix
frontend/src/graphql/types.ts on lines 792..794
frontend/src/graphql/types.ts on lines 828..830
frontend/src/graphql/types.ts on lines 872..874
frontend/src/graphql/types.ts on lines 913..915
frontend/src/graphql/types.ts on lines 1002..1004
frontend/src/graphql/types.ts on lines 1039..1041
frontend/src/graphql/types.ts on lines 1075..1077
frontend/src/graphql/types.ts on lines 1118..1120
frontend/src/graphql/types.ts on lines 1190..1192
frontend/src/graphql/types.ts on lines 1231..1233
frontend/src/graphql/types.ts on lines 1268..1270
frontend/src/graphql/types.ts on lines 1303..1305
frontend/src/graphql/types.ts on lines 1339..1341
frontend/src/graphql/types.ts on lines 1372..1374
frontend/src/graphql/types.ts on lines 1402..1404
frontend/src/graphql/types.ts on lines 1437..1439
frontend/src/graphql/types.ts on lines 1471..1473
frontend/src/graphql/types.ts on lines 1506..1508
frontend/src/graphql/types.ts on lines 1542..1544
frontend/src/graphql/types.ts on lines 1577..1579
frontend/src/graphql/types.ts on lines 1611..1613
frontend/src/graphql/types.ts on lines 1649..1651
frontend/src/graphql/types.ts on lines 1684..1686
frontend/src/graphql/types.ts on lines 1719..1721
frontend/src/graphql/types.ts on lines 1761..1763

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