ElectronicBabylonianLiterature/ebl-frontend

View on GitHub
src/chronology/domain/Date.test.ts

Summary

Maintainability
A
0 mins
Test Coverage

File Date.test.ts has 316 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

import { Eponym } from 'chronology/ui/DateEditor/Eponyms'
import { MesopotamianDate } from 'chronology/domain/Date'
import { Ur3Calendar } from 'chronology/domain/DateParameters'

const king = {
Severity: Minor
Found in src/chronology/domain/Date.test.ts - About 3 hrs to fix

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

      it('returns the correct string representation (broken, missing)', () => {
        const date = new MesopotamianDate({
          year: { value: '', isBroken: true },
          month: { value: '', isBroken: true, isIntercalary: true },
          day: { value: '', isBroken: true },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 2 other locations - About 3 hrs to fix
    src/chronology/domain/Date.test.ts on lines 270..278
    src/chronology/domain/Date.test.ts on lines 280..288

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

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

      it('returns the correct string representation (broken, reconstructed)', () => {
        const date = new MesopotamianDate({
          year: { value: '1', isBroken: true },
          month: { value: '2', isBroken: true, isIntercalary: true },
          day: { value: '3', isBroken: true },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 2 other locations - About 3 hrs to fix
    src/chronology/domain/Date.test.ts on lines 260..268
    src/chronology/domain/Date.test.ts on lines 280..288

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

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

      it('returns the correct string representation (uncertain)', () => {
        const date = new MesopotamianDate({
          year: { value: '1', isUncertain: true },
          month: { value: '2', isUncertain: true, isIntercalary: true },
          day: { value: '3', isUncertain: true },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 2 other locations - About 3 hrs to fix
    src/chronology/domain/Date.test.ts on lines 260..268
    src/chronology/domain/Date.test.ts on lines 270..278

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

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

      it('returns the correct string representation (Nabonassar era, no year)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '5' },
          day: { value: '' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 4 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 148..159
    src/chronology/domain/Date.test.ts on lines 174..185
    src/chronology/domain/Date.test.ts on lines 187..198
    src/chronology/domain/Date.test.ts on lines 200..211

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

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

      it('returns the correct string representation (Nabonassar era)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '5' },
          day: { value: '12' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 4 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 161..172
    src/chronology/domain/Date.test.ts on lines 174..185
    src/chronology/domain/Date.test.ts on lines 187..198
    src/chronology/domain/Date.test.ts on lines 200..211

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

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

      it('returns the correct string representation (Nabonassar era, no month)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '' },
          day: { value: '12' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 4 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 148..159
    src/chronology/domain/Date.test.ts on lines 161..172
    src/chronology/domain/Date.test.ts on lines 187..198
    src/chronology/domain/Date.test.ts on lines 200..211

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

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

      it('returns the correct string representation (Nabonassar era, no day)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '5' },
          day: { value: '' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 4 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 148..159
    src/chronology/domain/Date.test.ts on lines 161..172
    src/chronology/domain/Date.test.ts on lines 174..185
    src/chronology/domain/Date.test.ts on lines 200..211

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

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

      it('returns the correct string representation (Nabonassar era, king only)', () => {
        const date = new MesopotamianDate({
          year: { value: '' },
          month: { value: '' },
          day: { value: '' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 4 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 148..159
    src/chronology/domain/Date.test.ts on lines 161..172
    src/chronology/domain/Date.test.ts on lines 174..185
    src/chronology/domain/Date.test.ts on lines 187..198

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

    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 4 locations. Consider refactoring.
    Invalid

      it('returns the correct string representation (Seleucid, no year)', () => {
        const date = new MesopotamianDate({
          year: { value: '' },
          month: { value: '5' },
          day: { value: '12' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 3 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 102..112
    src/chronology/domain/Date.test.ts on lines 114..124
    src/chronology/domain/Date.test.ts on lines 126..136

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

    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 4 locations. Consider refactoring.
    Invalid

      it('returns the correct string representation (Seleucid)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '5' },
          day: { value: '12' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 3 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 114..124
    src/chronology/domain/Date.test.ts on lines 126..136
    src/chronology/domain/Date.test.ts on lines 138..146

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

    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 4 locations. Consider refactoring.
    Invalid

      it('returns the correct string representation (Seleucid, no day)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '5' },
          day: { value: '' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 3 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 102..112
    src/chronology/domain/Date.test.ts on lines 126..136
    src/chronology/domain/Date.test.ts on lines 138..146

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

    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 4 locations. Consider refactoring.
    Invalid

      it('returns the correct string representation (Seleucid, no month)', () => {
        const date = new MesopotamianDate({
          year: { value: '10' },
          month: { value: '' },
          day: { value: '12' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 3 other locations - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 102..112
    src/chronology/domain/Date.test.ts on lines 114..124
    src/chronology/domain/Date.test.ts on lines 138..146

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

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

      it('returns the correct string representation (empty)', () => {
        const date = new MesopotamianDate({
          year: { value: '' },
          month: { value: '' },
          day: { value: '' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 1 other location - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 91..99

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

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

        it('returns the correct string representation (standard)', () => {
          const date = new MesopotamianDate({
            year: { value: '10' },
            month: { value: '5' },
            day: { value: '12' },
    Severity: Major
    Found in src/chronology/domain/Date.test.ts and 1 other location - About 2 hrs to fix
    src/chronology/domain/Date.test.ts on lines 240..248

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

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

    const nabonassarEraKing = {
      orderGlobal: 172,
      dynastyNumber: '14',
      dynastyName: 'Persian Rulers',
      orderInDynasty: '3',
    Severity: Minor
    Found in src/chronology/domain/Date.test.ts and 2 other locations - About 40 mins to fix
    src/chronology/domain/Date.test.ts on lines 5..14
    src/chronology/domain/Date.test.ts on lines 16..25

    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

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

    const kingUr3 = {
      orderGlobal: 14,
      dynastyNumber: '2',
      dynastyName: 'Third Dynasty of Ur',
      orderInDynasty: '3',
    Severity: Minor
    Found in src/chronology/domain/Date.test.ts and 2 other locations - About 40 mins to fix
    src/chronology/domain/Date.test.ts on lines 5..14
    src/chronology/domain/Date.test.ts on lines 35..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 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

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

    const king = {
      orderGlobal: 1,
      dynastyNumber: '1',
      dynastyName: 'Dynasty of Akkad',
      orderInDynasty: '1',
    Severity: Minor
    Found in src/chronology/domain/Date.test.ts and 2 other locations - About 40 mins to fix
    src/chronology/domain/Date.test.ts on lines 16..25
    src/chronology/domain/Date.test.ts on lines 35..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 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

    There are no issues that match your filters.

    Category
    Status