ElectronicBabylonianLiterature/ebl-frontend

View on GitHub

Showing 65 of 766 total issues

File PdfExport.tsx has 661 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react'
import { Fragment } from 'fragmentarium/domain/fragment'
import Record from 'fragmentarium/ui/info/Record'

import { ReactElement } from 'react'
Severity: Major
Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 1 day to fix

    File TextService.test.ts has 574 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import Bluebird from 'bluebird'
    import _ from 'lodash'
    import { TestData, testDelegation } from 'test-support/utils'
    import TextService from './TextService'
    import { LemmatizationToken } from 'transliteration/domain/Lemmatization'
    Severity: Major
    Found in src/corpus/application/TextService.test.ts - About 1 day to fix

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

        render(): JSX.Element {
          const rows = this.state.number?.split('\n').length ?? 0
          const numberSearchForm = (
            <Form.Group as={Row} controlId="number">
              <HelpCol overlay={MuseumSearchHelp()} />
      Severity: Major
      Found in src/fragmentarium/ui/SearchForm.tsx - About 6 hrs to fix

        File TextService.ts has 418 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import Bluebird from 'bluebird'
        import produce, { castDraft } from 'immer'
        import _ from 'lodash'
        import { stringify } from 'query-string'
        
        
        Severity: Minor
        Found in src/corpus/application/TextService.ts - About 6 hrs to fix

          File FragmentRepository.test.ts has 411 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import Promise from 'bluebird'
          import { testDelegation, TestData } from 'test-support/utils'
          import FragmentRepository, { createScript } from './FragmentRepository'
          import Folio from 'fragmentarium/domain/Folio'
          import { fragment, fragmentDto } from 'test-support/test-fragment'
          Severity: Minor
          Found in src/fragmentarium/infrastructure/FragmentRepository.test.ts - About 5 hrs to fix

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

                render() {
                  const { props } = this
                  const {
                    isMouseHovering,
            
            
            Severity: Major
            Found in src/fragmentarium/ui/image-annotation/annotation-tool/Annotation.js - About 5 hrs to fix

              FragmentService has 41 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class FragmentService {
                private readonly referenceInjector: ReferenceInjector
              
                constructor(
                  private readonly fragmentRepository: FragmentRepository &
              Severity: Minor
              Found in src/fragmentarium/application/FragmentService.ts - About 5 hrs to fix

                Function addMainTableWithFootnotes has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function addMainTableWithFootnotes(
                  table: JQuery,
                  notes: JQuery,
                  jQueryRef: any,
                  yPos: number,
                Severity: Major
                Found in src/fragmentarium/ui/fragment/PdfExport.tsx - About 5 hrs to fix

                  Function FragmentAnnotation has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function FragmentAnnotation({
                    tokens,
                    fragment,
                    image,
                    initialAnnotations,

                  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

                  File FragmentRepository.ts has 392 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import Promise from 'bluebird'
                  import _ from 'lodash'
                  import { stringify } from 'query-string'
                  import produce from 'immer'
                  import {
                  Severity: Minor
                  Found in src/fragmentarium/infrastructure/FragmentRepository.ts - About 5 hrs to fix

                    File ChapterEditView.integration.test.ts has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import _ from 'lodash'
                    import Chance from 'chance'
                    
                    import AppDriver from 'test-support/AppDriver'
                    import FakeApi from 'test-support/FakeApi'
                    Severity: Minor
                    Found in src/corpus/ui/ChapterEditView.integration.test.ts - About 5 hrs to fix

                      File FragmentAnnotation.tsx has 376 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import Content from 'fragmentarium/ui/image-annotation/annotation-tool/Content'
                      import { AnnotationToken } from 'fragmentarium/domain/annotation-token'
                      import SignService from 'signs/application/SignService'
                      import AnnotationTool from 'fragmentarium/ui/image-annotation/annotation-tool/Annotation'
                      import { RectangleSelector } from 'react-image-annotation/lib/selectors'

                        File FragmentService.ts has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import Reference from 'bibliography/domain/Reference'
                        import Bluebird from 'bluebird'
                        import DictionaryWord from 'dictionary/domain/Word'
                        import Annotation from 'fragmentarium/domain/annotation'
                        import Folio from 'fragmentarium/domain/Folio'
                        Severity: Minor
                        Found in src/fragmentarium/application/FragmentService.ts - About 4 hrs to fix

                          File ChapterViewLine.tsx has 356 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React, { PropsWithChildren, useContext, useMemo, useState } from 'react'
                          import _ from 'lodash'
                          import {
                            ChapterDisplay,
                            LineDisplay,
                          Severity: Minor
                          Found in src/corpus/ui/ChapterViewLine.tsx - About 4 hrs to fix

                            File dtos.ts has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import _ from 'lodash'
                            
                            import createReference from 'bibliography/application/createReference'
                            import serializeReference from 'bibliography/application/serializeReference'
                            import { AlignmentToken, ChapterAlignment } from 'corpus/domain/alignment'
                            Severity: Minor
                            Found in src/corpus/application/dtos.ts - About 4 hrs to fix

                              File Annotation.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              //https://github.com/Secretmapper/react-image-annotation
                              /*
                              The MIT License (MIT)
                              Copyright (c) 2018-present, Arian Allenson Valdez.
                              
                              
                              Severity: Minor
                              Found in src/fragmentarium/ui/image-annotation/annotation-tool/Annotation.js - About 4 hrs to fix

                                ApiFragmentRepository has 34 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class ApiFragmentRepository
                                  implements FragmentInfoRepository, FragmentRepository, AnnotationRepository {
                                  constructor(private readonly apiClient: JsonApiClient) {}
                                
                                  statistics(): Promise<{ transliteratedFragments: number; lines: number }> {
                                Severity: Minor
                                Found in src/fragmentarium/infrastructure/FragmentRepository.ts - About 4 hrs to fix

                                  File provenance.ts has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Confirmed

                                  export const Provenances = {
                                    'Standard Text': { name: 'Standard Text', abbreviation: 'Std', parent: null },
                                    Assyria: { name: 'Assyria', abbreviation: 'Assa', parent: null },
                                    Aššur: { name: 'Aššur', abbreviation: 'Ašš', parent: 'Assyria' },
                                    'Dūr-Katlimmu': {
                                  Severity: Minor
                                  Found in src/corpus/domain/provenance.ts - About 3 hrs to fix

                                    Function AlignmentForm has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function AlignmentForm(props: AlignerProps) {
                                      const [alignment, setAlignment] = useState(props.token.alignment)
                                      const [variant, setVariant] = useState(props.token.variant?.value ?? '')
                                    
                                      function updateToken(alignmentToken: AlignmentToken): AlignmentToken {
                                    Severity: Major
                                    Found in src/corpus/ui/alignment/WordAligner.tsx - About 2 hrs to fix

                                      Function getMainTableWithFootnotes has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function getMainTableWithFootnotes(
                                        table: JQuery,
                                        footNotesLines: Paragraph[],
                                        jQueryRef: JQuery
                                      ): { table: Array<Table | Paragraph>; footNotes: Paragraph[] } {
                                      Severity: Major
                                      Found in src/fragmentarium/ui/fragment/WordExport.tsx - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language