ElectronicBabylonianLiterature/ebl-frontend

View on GitHub

Showing 358 of 771 total issues

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

    render(
      <Editor
        name={name}
        value={value}
        onChange={onChange}
Severity: Minor
Found in src/editor/Editor.test.tsx and 1 other location - About 40 mins to fix
src/dictionary/ui/editor/ArrayWithNotes.test.tsx on lines 58..66

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

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 getPdfDoc has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  tableHtml: JQuery,
  notesHtml: JQuery,
  jQueryRef: JQuery,
  wordService: WordService,
  fragment: Fragment
Severity: Minor
Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 35 mins to fix

    Function addFootnotes has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      notes: JQuery,
      padding: number,
      jQueryRef: JQuery,
      yPos: number,
      doc: jsPDF
    Severity: Minor
    Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 35 mins to fix

      Function createItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        start,
        end,
        activePage,
        setActivePage: (number: number) => void,
        paginationURLParam: string
      Severity: Minor
      Found in src/fragmentarium/ui/search/PaginationItems.tsx - About 35 mins to fix

        Function useRowsContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          numberOfRows: number,
          score?: boolean,
          notes?: boolean,
          parallels?: boolean,
          oldLineNumbers?: boolean
        Severity: Minor
        Found in src/corpus/ui/RowsContext.ts - About 35 mins to fix

          Function getTransliterationText has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            el: HTMLElement | Text | Comment | Document,
            doc: jsPDF,
            xPos: number,
            yPos: number,
            add: boolean
          Severity: Minor
          Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 35 mins to fix

            Function getColumnSizes has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              table: JQuery,
              jQueryRef: JQuery,
              outerPaddingForTable: number,
              firstColumnMinWidth: number,
              doc: jsPDF
            Severity: Minor
            Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 35 mins to fix

              Function addMainTableWithFootnotes has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                table: JQuery,
                notes: JQuery,
                jQueryRef: any,
                yPos: number,
                doc: any
              Severity: Minor
              Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 35 mins to fix

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

                  return {
                    id: reference.id,
                    type: reference.type,
                    pages: reference.pages,
                    notes: reference.notes,
                Severity: Minor
                Found in src/bibliography/application/serializeReference.ts and 2 other locations - About 35 mins to fix
                src/bibliography/application/serializeReference.test.ts on lines 6..12
                src/corpus/application/dtos.ts on lines 296..302

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

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

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

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

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

                Refactorings

                Further Reading

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

                  expect(serializeReference(reference)).toEqual({
                    id: reference.id,
                    type: reference.type,
                    pages: reference.pages,
                    notes: reference.notes,
                Severity: Minor
                Found in src/bibliography/application/serializeReference.test.ts and 2 other locations - About 35 mins to fix
                src/bibliography/application/serializeReference.ts on lines 6..12
                src/corpus/application/dtos.ts on lines 296..302

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

                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

                    component: () => (
                      <PaginationItem
                        paginationURLParam={paginationURLParam}
                        setActivePage={setActivePage}
                        index={index}
                Severity: Minor
                Found in src/fragmentarium/ui/search/PaginationItems.tsx and 1 other location - About 35 mins to fix
                src/fragmentarium/ui/search/PaginationItems.tsx on lines 86..94

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

                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 render(
                    <Router history={history}>
                      <PaginationItemsWrapper startPage={startPage} totalPages={totalPages} />
                    </Router>
                  )
                Severity: Minor
                Found in src/fragmentarium/ui/search/PaginationItems.test.tsx and 1 other location - About 35 mins to fix
                src/signs/ui/search/SignsSearchForm.test.tsx on lines 31..35

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

                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

                      <HeadTags
                        title={`${word._id}: eBL`}
                        description={`Information about the word ${word._id} in the electronic Babylonian Library (eBL).`}
                      />
                Severity: Minor
                Found in src/dictionary/ui/display/WordDisplay.tsx and 1 other location - About 35 mins to fix
                src/signs/ui/display/SignDisplay.tsx on lines 41..44

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

                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 function LinkToLine({
                  number,
                  lineNumber,
                }: {
                  number: number
                Severity: Minor
                Found in src/transliteration/ui/note-links.tsx and 1 other location - About 35 mins to fix
                src/transliteration/ui/note-links.tsx on lines 39..42

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

                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

                function renderAmplifiedMeaningList(entry) {
                  render(
                    <AmplifiedMeaningList value={value} onChange={onChange} entry={entry}>
                      {label}
                    </AmplifiedMeaningList>
                Severity: Minor
                Found in src/dictionary/ui/editor/AmplifiedMeaningList.test.tsx and 1 other location - About 35 mins to fix
                src/common/ArrayInput.test.tsx on lines 39..45

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

                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

                function LinkToNote({ number }: { number: number }): JSX.Element {
                  const noteHref = `#${createNoteId(number)}`
                  return <NoteLink href={noteHref} number={number} />
                }
                Severity: Minor
                Found in src/transliteration/ui/note-links.tsx and 1 other location - About 35 mins to fix
                src/transliteration/ui/note-links.tsx on lines 28..37

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

                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 render(
                    <Router history={history}>
                      <SignsSearchForm sign={undefined} signQuery={signQueryDefault} />
                    </Router>
                  )
                Severity: Minor
                Found in src/signs/ui/search/SignsSearchForm.test.tsx and 1 other location - About 35 mins to fix
                src/fragmentarium/ui/search/PaginationItems.test.tsx on lines 32..36

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

                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

                      await waitFor(() =>
                        expect(history.push).toHaveBeenCalledWith({
                          search: `paginationIndex=${page - 1}`,
                        })
                      )
                Severity: Minor
                Found in src/fragmentarium/ui/search/PaginationItems.test.tsx and 1 other location - About 35 mins to fix
                src/fragmentarium/ui/search/PaginationItems.test.tsx on lines 138..142

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

                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

                  const generatePaginationItem = (index) => (
                    <PaginationItem
                      paginationURLParam={paginationURLParam}
                      setActivePage={setActivePage}
                      index={index}
                Severity: Minor
                Found in src/fragmentarium/ui/search/PaginationItems.tsx and 1 other location - About 35 mins to fix
                src/fragmentarium/ui/search/PaginationItems.tsx on lines 53..61

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

                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

                      await waitFor(() =>
                        expect(history.push).toHaveBeenCalledWith({
                          search: `paginationIndex=${page - 1}`,
                        })
                      )
                Severity: Minor
                Found in src/fragmentarium/ui/search/PaginationItems.test.tsx and 1 other location - About 35 mins to fix
                src/fragmentarium/ui/search/PaginationItems.test.tsx on lines 116..120

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

                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