ElectronicBabylonianLiterature/ebl-frontend

View on GitHub

Showing 358 of 766 total issues

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

      <Form.Group controlId={_.uniqueId('colophon-')}>
        <Form.Label>Colophon</Form.Label>{' '}
        <Editor
          name={_.uniqueId('colophon-editor-')}
          value={manuscript.colophon}
Severity: Major
Found in src/corpus/ui/manuscripts/ManuscriptForm.tsx and 1 other location - About 4 hrs to fix
src/corpus/ui/manuscripts/ManuscriptForm.tsx on lines 165..178

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

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

      <Form.Group controlId={_.uniqueId('unplaced-lines-')}>
        <Form.Label>Unplaced Lines</Form.Label>{' '}
        <Editor
          name={_.uniqueId('unplaced-lines-editor-')}
          value={manuscript.unplacedLines}
Severity: Major
Found in src/corpus/ui/manuscripts/ManuscriptForm.tsx and 1 other location - About 4 hrs to fix
src/corpus/ui/manuscripts/ManuscriptForm.tsx on lines 151..164

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

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 const kurToken: AkkadianWord = {
  value: 'kur',
  cleanValue: 'kur',
  enclosureType: [],
  erasure: 'NONE',
Severity: Major
Found in src/test-support/test-tokens.ts and 1 other location - About 4 hrs to fix
src/test-support/test-tokens.ts on lines 101..126

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

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 const raToken: AkkadianWord = {
  value: 'ra',
  cleanValue: 'ra',
  enclosureType: [],
  erasure: 'NONE',
Severity: Major
Found in src/test-support/test-tokens.ts and 1 other location - About 4 hrs to fix
src/test-support/test-tokens.ts on lines 128..153

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

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

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

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

            export default withData<
              { fragment: Fragment; updateScript: (script: Script) => Bluebird<Fragment> },
              { fragmentService: FragmentService },
              readonly string[]
            >(
            Severity: Major
            Found in src/fragmentarium/ui/info/ScriptSelection.tsx and 1 other location - About 4 hrs to fix
            src/fragmentarium/ui/ScriptSearchForm.tsx on lines 42..64

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

            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 const atfTokenRa: Word = {
              ...atfToken,
              value: 'ra',
              parts: [
                {
            Severity: Major
            Found in src/test-support/test-tokens.ts and 1 other location - About 4 hrs to fix
            src/test-support/test-tokens.ts on lines 48..73

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

            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 const atfTokenKur: Word = {
              ...atfToken,
              value: 'kur',
              parts: [
                {
            Severity: Major
            Found in src/test-support/test-tokens.ts and 1 other location - About 4 hrs to fix
            src/test-support/test-tokens.ts on lines 21..46

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

            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('Makes a put request with given parameters', async () => {
                setUpSuccessResponse()
            
                await apiClient.putJson(path, requestJson)
            
            
            Severity: Major
            Found in src/http/ApiClient.test.ts and 1 other location - About 3 hrs to fix
            src/http/ApiClient.test.ts on lines 72..87

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

            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('Makes a post request with given parameters', async () => {
                setUpSuccessResponse()
            
                await apiClient.postJson(path, requestJson)
            
            
            Severity: Major
            Found in src/http/ApiClient.test.ts and 1 other location - About 3 hrs to fix
            src/http/ApiClient.test.ts on lines 105..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 109.

            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

            async function renderSigns(path: string): Promise<void> {
              render(
                <MemoryRouter initialEntries={[path]}>
                  <SessionContext.Provider value={session}>
                    <SignsWithRouter signService={signService} />
            Severity: Major
            Found in src/signs/ui/search/Signs.test.tsx and 1 other location - About 3 hrs to fix
            src/dictionary/ui/search/Dictionary.test.tsx on lines 64..73

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

            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

            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

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

                          <Col xs={1}>
                            <SubmitAnnotationButton
                              disabled={disabled}
                              isHoveringOverAnnotation={
                                hoveringAnnotation?.data.value === null
              src/fragmentarium/ui/image-annotation/annotation-tool/Editor.tsx on lines 36..49

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

              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

                          <Col xs={1}>
                            <SubmitAnnotationButton
                              disabled={disabled}
                              isHoveringOverAnnotation={
                                hoveringAnnotation?.data.value === null
              src/fragmentarium/ui/image-annotation/annotation-tool/Editor.tsx on lines 50..63

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

              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

                it('1,2,3,4,5', async () => {
                  renderPaginationItems(1, 4)
                  await screen.findByText('2')
                  expectPaginationElementControlsToBeVisible(3, 5)
                  expect(screen.queryByText('…')).not.toBeInTheDocument()
              Severity: Major
              Found in src/fragmentarium/ui/search/PaginationItems.test.tsx and 1 other location - About 3 hrs to fix
              src/fragmentarium/ui/search/PaginationItems.test.tsx on lines 63..69

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

              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

                it('1,2,3,4,5', async () => {
                  renderPaginationItems(0, 4)
                  await screen.findByText('1')
                  expectPaginationElementControlsToBeVisible(2, 5)
                  expect(screen.queryByText('…')).not.toBeInTheDocument()
              Severity: Major
              Found in src/fragmentarium/ui/search/PaginationItems.test.tsx and 1 other location - About 3 hrs to fix
              src/fragmentarium/ui/search/PaginationItems.test.tsx on lines 70..76

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

              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