NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 830 of 830 total issues

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

      it('Repairs the invalid record - 655 Finnish, removes punc $a 2', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid655FinYes2);
        expect(recordInvalid655FinYes2.equalsTo(recordValid655FinNo2)).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 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 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 - Remove punc $y (Language field)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidOnlyAPuncY);
        expect(recordInvalidOnlyAPuncY.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 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 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 - 657 !Finnish, add punc $z', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid657EngNo);
        expect(recordInvalid657EngNo.equalsTo(recordValid657EngYes)).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 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 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 - Removes punc $a (register)', 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 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 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 - 655 !Finnish, add punc $y', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid655EngNo);
        expect(recordInvalid655EngNo.equalsTo(recordValid655EngYes)).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 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 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 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 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 - 656 Finnish, remove punc $a', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid656FinYes);
        expect(recordInvalid656FinYes.equalsTo(recordValid656FinNo)).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 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 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 $c', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidComplex);
        expect(recordInvalidComplex.equalsTo(recordValidComplex)).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 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

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 (last)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidAMissingB);
        expect(recordInvalidAMissingB.equalsTo(recordValidAB)).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 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 $b (mandatory)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidABMissing);
        expect(recordInvalidABMissing.equalsTo(recordValidAB)).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 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 - 655 !Finnish, add punc $a (no control)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid655EngNoNoControl);
        expect(recordInvalid655EngNoNoControl.equalsTo(recordValid655EngYesNoControl)).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 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 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 - Remove punc $b (only data field)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidWithoutA);
        expect(recordInvalidWithoutA.equalsTo(recordValidWithoutA)).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 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 (last before $u)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidWithU);
        expect(recordInvalidWithU.equalsTo(recordValidWithU)).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 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 - 648 Fast, removes punc $a', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid648FastYes);
        expect(recordInvalid648FastYes.equalsTo(recordValid648FastNo)).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 1801..1810
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 - 650 Finnish, removes punc $x', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid650FinYes);
        expect(recordInvalid650FinYes.equalsTo(recordValid650FinNo)).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 1801..1810
src/ending-punctuation.spec.js on lines 1812..1821
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 2 locations. Consider refactoring.
Open

export function removeWorsePrepubField594s(record) {
  // Remove lower-level entries:
  const fields594 = getRelevant5XXFields(record, false, true); // 500=false, 594=true
  nvdebugFieldArray(fields594, '  Candidates for non-best 594 b4 filtering: ', debugDev);
  const nonBest = fields594.filter(field => fields594.some(field2 => firstFieldHasBetterPrepubEncodingLevel(field2, field)));
Severity: Major
Found in src/prepublicationUtils.js and 1 other location - About 3 hrs to fix
src/prepublicationUtils.js on lines 207..214

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', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordValidWithoutYMissingA);
        expect(recordValidWithoutYMissingA.equalsTo(recordValidWithoutY)).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 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 two)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidDDMissing);
        expect(recordInvalidDDMissing.equalsTo(recordValidDD)).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 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 - 650 !Finnish, add punc $a', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid650EngControl);
        expect(recordInvalid650EngControl.equalsTo(recordValid650EngControl)).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 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 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 - 650 !Finnish, add punc $v (no control)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid650EngNoControl);
        expect(recordInvalid650EngNoControl.equalsTo(recordValid650EngNoControl)).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 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 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