radar/twist-v2

View on GitHub

Showing 143 of 143 total issues

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

Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function registerValidSW(swUrl: string, config?: Config) {
  navigator.serviceWorker
    .register(swUrl)
    .then(registration => {
      registration.onupdatefound = () => {
Severity: Minor
Found in frontend/src/serviceWorker.ts - About 1 hr to fix

    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

    Function renderDeleteConfirmation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderDeleteConfirmation = () => {
        if (showDeleteConfirmation) {
          return (
            <div className="text-red-800 mt-4">
              <hr />
    Severity: Minor
    Found in frontend/src/Book/Note/Comments/Delete.tsx - About 1 hr to fix

      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

      Method handle has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def handle(req, res)
                  # TODO!
                  # raise "states do not match" if session[:state] != params[:state]
                  res.format = :json
      
      
      Severity: Minor
      Found in backend/lib/twist/web/controllers/oauth/callback.rb - About 1 hr to fix

        Function ElementNote has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        const ElementNote: FunctionComponent<ElementNoteProps> = (props) => {
          const { user, createdAt, bookPermalink, number, id, text, comments } = props;
          const [state, setState] = useState<string>(props.state);
          const [showForm, setShowForm] = useState<boolean>(false);
        
        
        Severity: Minor
        Found in frontend/src/Book/Note/Note.tsx - About 1 hr 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

        Method run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def run(query:, variables: {}, context: {})
                  context = context.merge(
                    branch_loader: branch_loader,
                    commit_loader: commit_loader,
                    element_loader: element_loader,
        Severity: Minor
        Found in backend/lib/twist/web/graphql/runner.rb - About 1 hr to fix

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

            render() {
              const {
                id,
                direction,
                part,
          Severity: Minor
          Found in frontend/src/Book/Chapter/Link.tsx - About 1 hr to fix

            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

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

                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 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 useOpenNoteMutationMutation(baseOptions?: Apollo.MutationHookOptions<OpenNoteMutationMutation, OpenNoteMutationMutationVariables>) {
                    return Apollo.useMutation<OpenNoteMutationMutation, OpenNoteMutationMutationVariables>(OpenNoteMutationDocument, 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 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 useUpdateNoteMutationMutation(baseOptions?: Apollo.MutationHookOptions<UpdateNoteMutationMutation, UpdateNoteMutationMutationVariables>) {
                    return Apollo.useMutation<UpdateNoteMutationMutation, UpdateNoteMutationMutationVariables>(UpdateNoteMutationDocument, 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 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 useBooksQuery(baseOptions?: Apollo.QueryHookOptions<BooksQuery, BooksQueryVariables>) {
                    return Apollo.useQuery<BooksQuery, BooksQueryVariables>(BooksDocument, 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 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

            Severity
            Category
            Status
            Source
            Language