ElectronicBabylonianLiterature/ebl-frontend

View on GitHub

Showing 358 of 771 total issues

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

  amplifiedMeanings = (): JSX.Element => (
    <AmplifiedMeaningList
      value={this.state.word.amplifiedMeanings}
      onChange={this.onChangeValue('amplifiedMeanings')}
    >
Severity: Major
Found in src/dictionary/ui/editor/WordForm.tsx and 1 other location - About 1 hr to fix
src/dictionary/ui/editor/WordForm.tsx on lines 94..101

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

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 addGlossary has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addGlossary(
  glossaryHtml: JQuery,
  jQueryRef: JQuery,
  yPos: number,
  doc: any
Severity: Minor
Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 1 hr to fix

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

      derived = (): JSX.Element => (
        <DerivedList
          value={this.state.word.derived}
          onChange={this.onChangeValue('derived')}
        >
    Severity: Major
    Found in src/dictionary/ui/editor/WordForm.tsx and 1 other location - About 1 hr to fix
    src/dictionary/ui/editor/WordForm.tsx on lines 65..72

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

    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

    test.each([
      [
        manuscriptFactory.standardText().build(),
        manuscriptFactory.standardText().build(),
        0,
    Severity: Major
    Found in src/corpus/domain/manuscript.test.ts and 1 other location - About 1 hr to fix
    src/corpus/domain/manuscript.test.ts on lines 19..53

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

    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

    test.each([
      [ManuscriptTypes.None, ManuscriptTypes.Library, 1],
      [ManuscriptTypes.None, ManuscriptTypes.School, 1],
      [ManuscriptTypes.None, ManuscriptTypes.Varia, 0],
      [ManuscriptTypes.None, ManuscriptTypes.Commentary, 0],
    Severity: Major
    Found in src/corpus/domain/manuscript.test.ts and 1 other location - About 1 hr to fix
    src/corpus/domain/manuscript.test.ts on lines 55..168

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

    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 handleSelection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const handleSelection = (annotation: RawAnnotation | Annotation): void => {
        const { geometry, data } = annotation
        if (data) {
          const selectedAnnotation = getSelectionById(data.id, annotations)
          if (selectedAnnotation) {

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

        setSurface(surface: SurfaceLabel): Label {
          return produce(this, (draft: Draft<Label>) => {
            draft.surface = castDraft(surface)
          })
        }
      Severity: Major
      Found in src/transliteration/domain/Label.ts and 4 other locations - About 1 hr to fix
      src/transliteration/domain/Label.ts on lines 24..28
      src/transliteration/domain/Label.ts on lines 36..40
      src/fragmentarium/domain/Colophon.ts on lines 120..124
      src/fragmentarium/domain/Colophon.ts on lines 126..130

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

      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

      export class SurfaceAtLine extends AtLine {
        readonly type = 'SurfaceAtLine'
        readonly label: SurfaceLabel
      
        constructor(data: SurfaceAtLineDto) {
      Severity: Major
      Found in src/transliteration/domain/at-lines.ts and 2 other locations - About 1 hr to fix
      src/transliteration/domain/at-lines.ts on lines 49..57
      src/transliteration/domain/at-lines.ts on lines 96..104

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

      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

      export class ObjectAtLine extends AtLine {
        readonly type = 'ObjectAtLine'
        readonly label: ObjectLabel
      
        constructor(data: ObjectAtLineDto) {
      Severity: Major
      Found in src/transliteration/domain/at-lines.ts and 2 other locations - About 1 hr to fix
      src/transliteration/domain/at-lines.ts on lines 49..57
      src/transliteration/domain/at-lines.ts on lines 81..89

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

      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

      export class ColumnAtLine extends AtLine {
        readonly type = 'ColumnAtLine'
        readonly label: ColumnLabel
      
        constructor(data: ColumnAtLineDto) {
      Severity: Major
      Found in src/transliteration/domain/at-lines.ts and 2 other locations - About 1 hr to fix
      src/transliteration/domain/at-lines.ts on lines 81..89
      src/transliteration/domain/at-lines.ts on lines 96..104

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

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

        setObject(object: ObjectLabel): Label {
          return produce(this, (draft: Draft<Label>) => {
            draft.object = castDraft(object)
          })
        }
      Severity: Major
      Found in src/transliteration/domain/Label.ts and 4 other locations - About 1 hr to fix
      src/transliteration/domain/Label.ts on lines 30..34
      src/transliteration/domain/Label.ts on lines 36..40
      src/fragmentarium/domain/Colophon.ts on lines 120..124
      src/fragmentarium/domain/Colophon.ts on lines 126..130

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

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

        setColumn(column: ColumnLabel): Label {
          return produce(this, (draft: Draft<Label>) => {
            draft.column = castDraft(column)
          })
        }
      Severity: Major
      Found in src/transliteration/domain/Label.ts and 4 other locations - About 1 hr to fix
      src/transliteration/domain/Label.ts on lines 24..28
      src/transliteration/domain/Label.ts on lines 30..34
      src/fragmentarium/domain/Colophon.ts on lines 120..124
      src/fragmentarium/domain/Colophon.ts on lines 126..130

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

      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 getColumnSizes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getColumnSizes(
        table: JQuery,
        jQueryRef: JQuery,
        outerPaddingForTable: number,
        firstColumnMinWidth: number,
      Severity: Minor
      Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 1 hr to fix

        Function findChapterLine has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          findChapterLine(
            id: ChapterId,
            number: number,
            variantNumber: number
          ): Bluebird<LineDetails> {
        Severity: Minor
        Found in src/corpus/application/TextService.ts - About 1 hr to fix

          Function dealWithGlossaryHtml has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function dealWithGlossaryHtml(
            el: HTMLElement | Text | Comment | Document,
            doc: jsPDF,
            xPos: number,
            yPos: number
          Severity: Minor
          Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 1 hr to fix

            Function Highlight has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function Highlight({
              scale,
              annotation,
              active,
              isToggled,
            Severity: Minor
            Found in src/fragmentarium/ui/image-annotation/annotation-tool/Highlight.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

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

              [
                {
                  museumNumber: { number: '1', ...basicMuseumNumber },
                  isChecked: false,
                  isInFragmentarium: true,
            Severity: Major
            Found in src/test-support/test-joins.ts and 1 other location - About 1 hr to fix
            src/test-support/test-joins.ts on lines 30..43

            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 class SealAtLine extends AtLine {
              readonly type = 'SealAtLine'
              readonly number: number
            
              constructor(data: SealAtLineDto) {
            Severity: Major
            Found in src/transliteration/domain/at-lines.ts and 1 other location - About 1 hr to fix
            src/transliteration/domain/at-lines.ts on lines 33..41

            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

              [
                {
                  museumNumber: { number: '3', ...basicMuseumNumber },
                  isChecked: true,
                  isInFragmentarium: true,
            Severity: Major
            Found in src/test-support/test-joins.ts and 1 other location - About 1 hr to fix
            src/test-support/test-joins.ts on lines 16..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 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 class HeadingAtLine extends AtLine {
              readonly type = 'HeadingAtLine'
              readonly number: number
            
              constructor(data: HeadingAtLineDto) {
            Severity: Major
            Found in src/transliteration/domain/at-lines.ts and 1 other location - About 1 hr to fix
            src/transliteration/domain/at-lines.ts on lines 18..26

            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

            Severity
            Category
            Status
            Source
            Language