Showing 65 of 766 total issues
File PdfExport.tsx
has 661 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react'
import { Fragment } from 'fragmentarium/domain/fragment'
import Record from 'fragmentarium/ui/info/Record'
import { ReactElement } from 'react'
File TextService.test.ts
has 574 lines of code (exceeds 250 allowed). Consider refactoring. Open
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'
Function render
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(): JSX.Element {
const rows = this.state.number?.split('\n').length ?? 0
const numberSearchForm = (
<Form.Group as={Row} controlId="number">
<HelpCol overlay={MuseumSearchHelp()} />
File TextService.ts
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Bluebird from 'bluebird'
import produce, { castDraft } from 'immer'
import _ from 'lodash'
import { stringify } from 'query-string'
File FragmentRepository.test.ts
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
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'
Function render
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { props } = this
const {
isMouseHovering,
FragmentService
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class FragmentService {
private readonly referenceInjector: ReferenceInjector
constructor(
private readonly fragmentRepository: FragmentRepository &
Function addMainTableWithFootnotes
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addMainTableWithFootnotes(
table: JQuery,
notes: JQuery,
jQueryRef: any,
yPos: number,
Function FragmentAnnotation
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
function FragmentAnnotation({
tokens,
fragment,
image,
initialAnnotations,
- Read upRead up
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
Open
import Promise from 'bluebird'
import _ from 'lodash'
import { stringify } from 'query-string'
import produce from 'immer'
import {
File ChapterEditView.integration.test.ts
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import Chance from 'chance'
import AppDriver from 'test-support/AppDriver'
import FakeApi from 'test-support/FakeApi'
File FragmentAnnotation.tsx
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
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'
File ChapterViewLine.tsx
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { PropsWithChildren, useContext, useMemo, useState } from 'react'
import _ from 'lodash'
import {
ChapterDisplay,
LineDisplay,
File dtos.ts
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import createReference from 'bibliography/application/createReference'
import serializeReference from 'bibliography/application/serializeReference'
import { AlignmentToken, ChapterAlignment } from 'corpus/domain/alignment'
File Annotation.js
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
//https://github.com/Secretmapper/react-image-annotation
/*
The MIT License (MIT)
Copyright (c) 2018-present, Arian Allenson Valdez.
ApiFragmentRepository
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ApiFragmentRepository
implements FragmentInfoRepository, FragmentRepository, AnnotationRepository {
constructor(private readonly apiClient: JsonApiClient) {}
statistics(): Promise<{ transliteratedFragments: number; lines: number }> {
File provenance.ts
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Confirmed
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': {
Function AlignmentForm
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 {
Function getMainTableWithFootnotes
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getMainTableWithFootnotes(
table: JQuery,
footNotesLines: Paragraph[],
jQueryRef: JQuery
): { table: Array<Table | Paragraph>; footNotes: Paragraph[] } {