NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 830 of 830 total issues

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

      it('Repairs the invalid record - Add punc $c', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidEndC);
        expect(recordInvalidEndC.equalsTo(recordValidEndC)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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

      it('Repairs the invalid record - Add punc $b', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidSimple);
        expect(recordInvalidSimple.equalsTo(recordValidSimple)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416

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

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('Finds the record invalid', async () => {
      const validator = await validatorFactory();
      const record = new MarcRecord({
        fields: [{tag: '700', subfields: [{code: 'e', value: 'foo,,bar'}]}]
      });
Severity: Major
Found in src/double-commas.spec.js and 1 other location - About 3 hrs to fix
src/double-commas.spec.js 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 110.

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

      it('Repairs the invalid record - Add punc $a (only)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid);
        expect(recordInvalid.equalsTo(recordValid)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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('Repairs the invalid record - Add punc $a & remove punc $y (Language field)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidOnlyAMissingAPuncY);
        expect(recordInvalidOnlyAMissingAPuncY.equalsTo(recordValidOnlyA)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 1 other location - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 117..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 110.

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

      it('Repairs the invalid record - Add punc $a (only)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid);
        expect(recordInvalid.equalsTo(recordValid)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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('Finds the record valid', async () => {
      const validator = await validatorFactory();
      const record = new MarcRecord({
        fields: [{tag: '700', subfields: [{code: 'e', value: 'foo,bar'}]}]
      });
Severity: Major
Found in src/double-commas.spec.js and 1 other location - About 3 hrs to fix
src/double-commas.spec.js on lines 27..35

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

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

      it('Repairs the invalid record - Add punc $b', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid);
        expect(recordInvalid.equalsTo(recordValid)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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

      it('Repairs the invalid record - Add punc $a', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidOnlyAMissingA);
        expect(recordInvalidOnlyAMissingA.equalsTo(recordValidOnlyA)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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

      it('Repairs the invalid record - Add punc $c', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidInd2v1);
        expect(recordInvalidInd2v1.equalsTo(recordValidInd2v1)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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

      it('Repairs the invalid record - 655 Finnish, remove punc $a', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid655FinYes);
        expect(recordInvalid655FinYes.equalsTo(recordValid655FinNo)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2407..2416
src/ending-punctuation.spec.js on lines 2533..2542

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

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

      it('Repairs the invalid record - Remove punc $e (language field, strict)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid);
        expect(recordInvalid.equalsTo(recordValid)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 11 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 220..229
src/ending-punctuation.spec.js on lines 431..440
src/ending-punctuation.spec.js on lines 611..620
src/ending-punctuation.spec.js on lines 786..795
src/ending-punctuation.spec.js on lines 1044..1053
src/ending-punctuation.spec.js on lines 1210..1219
src/ending-punctuation.spec.js on lines 1373..1382
src/ending-punctuation.spec.js on lines 1486..1495
src/ending-punctuation.spec.js on lines 1790..1799
src/ending-punctuation.spec.js on lines 2226..2235
src/ending-punctuation.spec.js on lines 2533..2542

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

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('Repairs the invalid record', async () => {
      const validator = await validatorFactory();
      const result = await validator.fix(recordBroken);
      expect(recordBroken.equalsTo(recordValid)).to.eql(true);
      expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 1 other location - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 453..462

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

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 item-language.spec.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {MarcRecord} from '@natlibfi/marc-record';
import validatorFactory from '../src/item-language';

Severity: Minor
Found in src/item-language.spec.js - About 3 hrs to fix

    File addMissingField338.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //import createDebugLogger from 'debug';
    import {fieldHasSubfield, fieldToString, getCatalogingLanguage, nvdebug} from './utils';
    import {getFormOfItem, map338CodeToTerm} from './field33XUtils';
    
    // Based mostly on USEMARCON-RDA. However, many things have been rethought, modernized etc.
    Severity: Minor
    Found in src/addMissingField338.js - About 3 hrs to fix

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

            it('Repairs the invalid record - Remove double punc $g', async () => {
              const validator = await validatorFactory();
              const result = await validator.fix(recordInvalidEndGDouble);
              expect(recordInvalidEndGDouble.equalsTo(recordValidEndG)).to.eql(true);
              expect(result).to.eql({
      Severity: Major
      Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
      src/ending-punctuation.spec.js on lines 231..240
      src/ending-punctuation.spec.js on lines 442..451
      src/ending-punctuation.spec.js on lines 464..473
      src/ending-punctuation.spec.js on lines 475..484
      src/ending-punctuation.spec.js on lines 797..806
      src/ending-punctuation.spec.js on lines 1055..1064
      src/ending-punctuation.spec.js on lines 1066..1075
      src/ending-punctuation.spec.js on lines 1077..1086
      src/ending-punctuation.spec.js on lines 1088..1097
      src/ending-punctuation.spec.js on lines 1221..1230
      src/ending-punctuation.spec.js on lines 1384..1393
      src/ending-punctuation.spec.js on lines 1497..1506
      src/ending-punctuation.spec.js on lines 1801..1810
      src/ending-punctuation.spec.js on lines 1812..1821
      src/ending-punctuation.spec.js on lines 1823..1832
      src/ending-punctuation.spec.js on lines 1834..1843
      src/ending-punctuation.spec.js on lines 1845..1854
      src/ending-punctuation.spec.js on lines 2237..2246
      src/ending-punctuation.spec.js on lines 2248..2257
      src/ending-punctuation.spec.js on lines 2259..2268
      src/ending-punctuation.spec.js on lines 2270..2279
      src/ending-punctuation.spec.js on lines 2281..2290
      src/ending-punctuation.spec.js on lines 2292..2301
      src/ending-punctuation.spec.js on lines 2303..2312
      src/ending-punctuation.spec.js on lines 2418..2427
      src/ending-punctuation.spec.js on lines 2544..2553

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

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

            it('Repairs the invalid record - Add punc $p', async () => {
              const validator = await validatorFactory();
              const result = await validator.fix(recordValidMultipleMissingP);
              expect(recordValidMultipleMissingP.equalsTo(recordValidMultiple)).to.eql(true);
              expect(result).to.eql({
      Severity: Major
      Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
      src/ending-punctuation.spec.js on lines 231..240
      src/ending-punctuation.spec.js on lines 442..451
      src/ending-punctuation.spec.js on lines 475..484
      src/ending-punctuation.spec.js on lines 622..631
      src/ending-punctuation.spec.js on lines 797..806
      src/ending-punctuation.spec.js on lines 1055..1064
      src/ending-punctuation.spec.js on lines 1066..1075
      src/ending-punctuation.spec.js on lines 1077..1086
      src/ending-punctuation.spec.js on lines 1088..1097
      src/ending-punctuation.spec.js on lines 1221..1230
      src/ending-punctuation.spec.js on lines 1384..1393
      src/ending-punctuation.spec.js on lines 1497..1506
      src/ending-punctuation.spec.js on lines 1801..1810
      src/ending-punctuation.spec.js on lines 1812..1821
      src/ending-punctuation.spec.js on lines 1823..1832
      src/ending-punctuation.spec.js on lines 1834..1843
      src/ending-punctuation.spec.js on lines 1845..1854
      src/ending-punctuation.spec.js on lines 2237..2246
      src/ending-punctuation.spec.js on lines 2248..2257
      src/ending-punctuation.spec.js on lines 2259..2268
      src/ending-punctuation.spec.js on lines 2270..2279
      src/ending-punctuation.spec.js on lines 2281..2290
      src/ending-punctuation.spec.js on lines 2292..2301
      src/ending-punctuation.spec.js on lines 2303..2312
      src/ending-punctuation.spec.js on lines 2418..2427
      src/ending-punctuation.spec.js on lines 2544..2553

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

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

            it('Repairs the invalid record - Add punc $d (last of list)', async () => {
              const validator = await validatorFactory();
              const result = await validator.fix(recordInvalidComplexDMissing);
              expect(recordInvalidComplexDMissing.equalsTo(recordInvalidComplexDMissing)).to.eql(true);
              expect(result).to.eql({
      Severity: Major
      Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
      src/ending-punctuation.spec.js on lines 231..240
      src/ending-punctuation.spec.js on lines 442..451
      src/ending-punctuation.spec.js on lines 464..473
      src/ending-punctuation.spec.js on lines 475..484
      src/ending-punctuation.spec.js on lines 622..631
      src/ending-punctuation.spec.js on lines 797..806
      src/ending-punctuation.spec.js on lines 1055..1064
      src/ending-punctuation.spec.js on lines 1066..1075
      src/ending-punctuation.spec.js on lines 1077..1086
      src/ending-punctuation.spec.js on lines 1221..1230
      src/ending-punctuation.spec.js on lines 1384..1393
      src/ending-punctuation.spec.js on lines 1497..1506
      src/ending-punctuation.spec.js on lines 1801..1810
      src/ending-punctuation.spec.js on lines 1812..1821
      src/ending-punctuation.spec.js on lines 1823..1832
      src/ending-punctuation.spec.js on lines 1834..1843
      src/ending-punctuation.spec.js on lines 1845..1854
      src/ending-punctuation.spec.js on lines 2237..2246
      src/ending-punctuation.spec.js on lines 2248..2257
      src/ending-punctuation.spec.js on lines 2259..2268
      src/ending-punctuation.spec.js on lines 2270..2279
      src/ending-punctuation.spec.js on lines 2281..2290
      src/ending-punctuation.spec.js on lines 2292..2301
      src/ending-punctuation.spec.js on lines 2303..2312
      src/ending-punctuation.spec.js on lines 2418..2427
      src/ending-punctuation.spec.js on lines 2544..2553

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

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

            it('Repairs the invalid record - Add punc $a (only)', async () => {
              const validator = await validatorFactory();
              const result = await validator.fix(recordInvalidOnlyA);
              expect(recordInvalidOnlyA.equalsTo(recordValidOnlyA)).to.eql(true);
              expect(result).to.eql({
      Severity: Major
      Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
      src/ending-punctuation.spec.js on lines 231..240
      src/ending-punctuation.spec.js on lines 442..451
      src/ending-punctuation.spec.js on lines 464..473
      src/ending-punctuation.spec.js on lines 475..484
      src/ending-punctuation.spec.js on lines 622..631
      src/ending-punctuation.spec.js on lines 797..806
      src/ending-punctuation.spec.js on lines 1055..1064
      src/ending-punctuation.spec.js on lines 1066..1075
      src/ending-punctuation.spec.js on lines 1077..1086
      src/ending-punctuation.spec.js on lines 1088..1097
      src/ending-punctuation.spec.js on lines 1221..1230
      src/ending-punctuation.spec.js on lines 1497..1506
      src/ending-punctuation.spec.js on lines 1801..1810
      src/ending-punctuation.spec.js on lines 1812..1821
      src/ending-punctuation.spec.js on lines 1823..1832
      src/ending-punctuation.spec.js on lines 1834..1843
      src/ending-punctuation.spec.js on lines 1845..1854
      src/ending-punctuation.spec.js on lines 2237..2246
      src/ending-punctuation.spec.js on lines 2248..2257
      src/ending-punctuation.spec.js on lines 2259..2268
      src/ending-punctuation.spec.js on lines 2270..2279
      src/ending-punctuation.spec.js on lines 2281..2290
      src/ending-punctuation.spec.js on lines 2292..2301
      src/ending-punctuation.spec.js on lines 2303..2312
      src/ending-punctuation.spec.js on lines 2418..2427
      src/ending-punctuation.spec.js on lines 2544..2553

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

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

            it('Repairs the invalid record - 648 Finnish, removes punc $a', async () => {
              const validator = await validatorFactory();
              const result = await validator.fix(recordInvali648dFinYes);
              expect(recordInvali648dFinYes.equalsTo(recordVali648dFinNo)).to.eql(true);
              expect(result).to.eql({
      Severity: Major
      Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
      src/ending-punctuation.spec.js on lines 231..240
      src/ending-punctuation.spec.js on lines 442..451
      src/ending-punctuation.spec.js on lines 464..473
      src/ending-punctuation.spec.js on lines 475..484
      src/ending-punctuation.spec.js on lines 622..631
      src/ending-punctuation.spec.js on lines 797..806
      src/ending-punctuation.spec.js on lines 1055..1064
      src/ending-punctuation.spec.js on lines 1066..1075
      src/ending-punctuation.spec.js on lines 1077..1086
      src/ending-punctuation.spec.js on lines 1088..1097
      src/ending-punctuation.spec.js on lines 1221..1230
      src/ending-punctuation.spec.js on lines 1384..1393
      src/ending-punctuation.spec.js on lines 1497..1506
      src/ending-punctuation.spec.js on lines 1812..1821
      src/ending-punctuation.spec.js on lines 1823..1832
      src/ending-punctuation.spec.js on lines 1834..1843
      src/ending-punctuation.spec.js on lines 1845..1854
      src/ending-punctuation.spec.js on lines 2237..2246
      src/ending-punctuation.spec.js on lines 2248..2257
      src/ending-punctuation.spec.js on lines 2259..2268
      src/ending-punctuation.spec.js on lines 2270..2279
      src/ending-punctuation.spec.js on lines 2281..2290
      src/ending-punctuation.spec.js on lines 2292..2301
      src/ending-punctuation.spec.js on lines 2303..2312
      src/ending-punctuation.spec.js on lines 2418..2427
      src/ending-punctuation.spec.js on lines 2544..2553

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

      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