NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

    it('Finds the record invalid (spec)', async () => {
      const validator = await validatorFactory(config);
      const result = await validator.validate(recordInvalid);
      expect(result).to.eql({valid: false, message: ['Subfield $100$$4should be excluded']});
    });
Severity: Major
Found in src/subfield-exclusion.spec.js and 3 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 334..338
src/subfield-exclusion.spec.js on lines 417..421
src/subfield-exclusion.spec.js on lines 502..506

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    it('Finds the record invalid - Ind', async () => {
      const validator = await validatorFactory(configInd);
      const result = await validator.validate(recordIndInvalid);
      expect(result).to.eql({valid: false, message: ['Subfield $500$$2should be excluded']});
    });
Severity: Major
Found in src/subfield-exclusion.spec.js and 3 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 283..287
src/subfield-exclusion.spec.js on lines 334..338
src/subfield-exclusion.spec.js on lines 417..421

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

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

Function mergeOrAddSubfield has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function mergeOrAddSubfield(targetField, candSubfieldData, candFieldPairs880 = []) {

  const candSubfieldAsString = `${candSubfieldData.code} ${candSubfieldData.originalValue}`;

  nvdebug(`   Q: mergeOrAddSubfield '${candSubfieldAsString}'\n      with field '${fieldToString(targetField)}'?`, debugDev);
Severity: Minor
Found in src/merge-fields/mergeOrAddSubfield.js - About 1 hr to fix

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

          it('Finds record invalid - No punc $c', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidInd2v1);
            expect(result).to.eql({
              message: ['Field 264 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - 648 Fast, with punc', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid648FastYes);
            expect(result).to.eql({
              message: ['Field 648 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $d (last of two)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidDDMissing);
            expect(result).to.eql({
              message: ['Field 340 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - Invalid punc $i (":" not valid punc mark, but this is according example...)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidI);
            expect(result).to.eql({
              message: ['Field 538 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $b (mandatory)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidABMissing);
            expect(result).to.eql({
              message: ['Field 340 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - 656 Finnish, with punc $a', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid656FinYes);
            expect(result).to.eql({
              message: ['Field 656 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $a (last)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidAMissingB);
            expect(result).to.eql({
              message: ['Field 340 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - Punc $e (language field, strict)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid);
            expect(result).to.eql({
              message: ['Field 760 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $i (last before $u)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidMissingI);
            expect(result).to.eql({
              message: ['Field 538 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - 647 Fast, dot at end', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid647FastEndPunc);
            expect(result).to.eql({
              message: ['Field 647 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $b', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidSimple);
            expect(result).to.eql({
              message: ['Field 880 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395

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

    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('Finds record invalid - No punc $p (last before $y)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordValidMultipleMissingP);
            expect(result).to.eql({
              message: ['Field 242 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - 648 Finnish, with punc', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvali648dFinYes);
            expect(result).to.eql({
              message: ['Field 648 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - 650 !Finnish, without punc (no control)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid650EngNoControl);
            expect(result).to.eql({
              message: ['Field 650 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $b', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid);
            expect(result).to.eql({
              message: ['Field 036 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidEndC);
            expect(result).to.eql({
              message: ['Field 260 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 998..1005
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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('Finds record invalid - No punc $a (only)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidA);
            expect(result).to.eql({
              message: ['Field 340 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 26 other locations - About 1 hr to fix
    src/ending-punctuation.spec.js on lines 201..208
    src/ending-punctuation.spec.js on lines 385..392
    src/ending-punctuation.spec.js on lines 412..419
    src/ending-punctuation.spec.js on lines 592..599
    src/ending-punctuation.spec.js on lines 767..774
    src/ending-punctuation.spec.js on lines 1007..1014
    src/ending-punctuation.spec.js on lines 1016..1023
    src/ending-punctuation.spec.js on lines 1025..1032
    src/ending-punctuation.spec.js on lines 1191..1198
    src/ending-punctuation.spec.js on lines 1345..1352
    src/ending-punctuation.spec.js on lines 1354..1361
    src/ending-punctuation.spec.js on lines 1467..1474
    src/ending-punctuation.spec.js on lines 1735..1742
    src/ending-punctuation.spec.js on lines 1744..1751
    src/ending-punctuation.spec.js on lines 1753..1760
    src/ending-punctuation.spec.js on lines 1762..1769
    src/ending-punctuation.spec.js on lines 1771..1778
    src/ending-punctuation.spec.js on lines 2153..2160
    src/ending-punctuation.spec.js on lines 2162..2169
    src/ending-punctuation.spec.js on lines 2171..2178
    src/ending-punctuation.spec.js on lines 2180..2187
    src/ending-punctuation.spec.js on lines 2189..2196
    src/ending-punctuation.spec.js on lines 2198..2205
    src/ending-punctuation.spec.js on lines 2207..2214
    src/ending-punctuation.spec.js on lines 2388..2395
    src/ending-punctuation.spec.js on lines 2514..2521

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

    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