NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

    {
      'tag': '511',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ['0', '1'], 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 2 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 2231..2241
src/melindaCustomMergeFields.js on lines 2290..2300

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

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 punctuateField has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function punctuateField(field, recordType) {
    const rules = readPunctuationRulesFromJSON(recordType);
    debug(`Handling field ${field.tag}`);
    debug(`Field contents: ${fieldToString(field)}`);
    const rulesForField = getRulesForField(field.tag, rules);
Severity: Major
Found in src/punctuation/index.js - About 2 hrs to fix

    Function default has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function () {
    
      return {
        description, validate, fix
      };
    Severity: Minor
    Found in src/addMissingField041.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function normalizeQualifyingInformationField has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    function normalizeQualifyingInformationField(field) {
      if (!['015', '020', '024', '028'].includes(field.tag) || !field.subfields) {
        return;
      }
    
    
    Severity: Minor
    Found in src/normalize-qualifying-information.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

          it('Finds record invalid - 650 !Finnish, without punc', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid650EngControl);
            expect(result).to.eql({
              message: ['Field 650 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - Punc $b (only data field)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidWithoutA);
            expect(result).to.eql({
              message: ['Field 567 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - Ind2 = 4, copyright, extra punc $c', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidCopyrightCExtra);
            expect(result).to.eql({
              message: ['Field 264 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - No punc $a (only)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidOnlyA);
            expect(result).to.eql({
              message: ['Field 538 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - No punc $a (only)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordValidWithoutYMissingA);
            expect(result).to.eql({
              message: ['Field 242 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - No punc $a (with $u)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidWithU);
            expect(result).to.eql({
              message: ['Field 520 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - No punc $a (only)', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidOnlyA);
            expect(result).to.eql({
              message: ['Field 760 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - No punc $d (last of two) followed by $g', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidComplexDMissing);
            expect(result).to.eql({
              message: ['Field 340 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - Only $a with punc', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidOnlyA);
            expect(result).to.eql({
              message: ['Field 036 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - No punc $c', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidComplex);
            expect(result).to.eql({
              message: ['Field 880 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid - 662 !Finnish, without punc $a', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalid662EngNo);
            expect(result).to.eql({
              message: ['Field 662 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 601..608
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('Finds record invalid', async () => {
            const validator = await validatorFactory();
            const result = await validator.validate(recordInvalidEndGDouble);
            expect(result).to.eql({
              message: ['Field 260 has invalid ending punctuation'],
    Severity: Major
    Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 210..217
    src/ending-punctuation.spec.js on lines 421..428
    src/ending-punctuation.spec.js on lines 776..783
    src/ending-punctuation.spec.js on lines 1034..1041
    src/ending-punctuation.spec.js on lines 1200..1207
    src/ending-punctuation.spec.js on lines 1363..1370
    src/ending-punctuation.spec.js on lines 1476..1483
    src/ending-punctuation.spec.js on lines 1780..1787
    src/ending-punctuation.spec.js on lines 2216..2223
    src/ending-punctuation.spec.js on lines 2397..2404
    src/ending-punctuation.spec.js on lines 2523..2530

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

    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 processTodoList has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function processTodoList(thingsToDo, deletables = []) {
        const [currString, ...stillToDo] = thingsToDo;
    
        if (currString === undefined) {
          return deletables;
    Severity: Minor
    Found in src/removeInferiorDataFields.js - About 2 hrs to fix

      Function validate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function validate(record) {
          const messages = configuration.reduce((messages, item) => {
            let results; // eslint-disable-line functional/no-let
      
            if (item.leader) { // eslint-disable-line functional/no-conditional-statements
      Severity: Minor
      Found in src/fixed-fields.js - About 2 hrs to fix

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

            {
              'tag': '066',
              'repeatable': false,
              'fieldType': 'dataField',
              'indicators': {'ind1': ' ', 'ind2': ' '},
        Severity: Major
        Found in src/melindaCustomMergeFields.js and 19 other locations - About 2 hrs to fix
        src/melindaCustomMergeFields.js on lines 108..118
        src/melindaCustomMergeFields.js on lines 368..378
        src/melindaCustomMergeFields.js on lines 677..687
        src/melindaCustomMergeFields.js on lines 1140..1150
        src/melindaCustomMergeFields.js on lines 1168..1178
        src/melindaCustomMergeFields.js on lines 1179..1189
        src/melindaCustomMergeFields.js on lines 1219..1229
        src/melindaCustomMergeFields.js on lines 1289..1299
        src/melindaCustomMergeFields.js on lines 2314..2324
        src/melindaCustomMergeFields.js on lines 2582..2592
        src/melindaCustomMergeFields.js on lines 2748..2758
        src/melindaCustomMergeFields.js on lines 4151..4161
        src/melindaCustomMergeFields.js on lines 4162..4172
        src/melindaCustomMergeFields.js on lines 4193..4203
        src/melindaCustomMergeFields.js on lines 4267..4277
        src/melindaCustomMergeFields.js on lines 4278..4288
        src/melindaCustomMergeFields.js on lines 4289..4299
        src/melindaCustomMergeFields.js on lines 4757..4767
        src/melindaCustomMergeFields.js on lines 5063..5073

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

            {
              'tag': '018',
              'repeatable': false,
              'fieldType': 'dataField',
              'indicators': {'ind1': ' ', 'ind2': ' '},
        Severity: Major
        Found in src/melindaCustomMergeFields.js and 19 other locations - About 2 hrs to fix
        src/melindaCustomMergeFields.js on lines 368..378
        src/melindaCustomMergeFields.js on lines 628..638
        src/melindaCustomMergeFields.js on lines 677..687
        src/melindaCustomMergeFields.js on lines 1140..1150
        src/melindaCustomMergeFields.js on lines 1168..1178
        src/melindaCustomMergeFields.js on lines 1179..1189
        src/melindaCustomMergeFields.js on lines 1219..1229
        src/melindaCustomMergeFields.js on lines 1289..1299
        src/melindaCustomMergeFields.js on lines 2314..2324
        src/melindaCustomMergeFields.js on lines 2582..2592
        src/melindaCustomMergeFields.js on lines 2748..2758
        src/melindaCustomMergeFields.js on lines 4151..4161
        src/melindaCustomMergeFields.js on lines 4162..4172
        src/melindaCustomMergeFields.js on lines 4193..4203
        src/melindaCustomMergeFields.js on lines 4267..4277
        src/melindaCustomMergeFields.js on lines 4278..4288
        src/melindaCustomMergeFields.js on lines 4289..4299
        src/melindaCustomMergeFields.js on lines 4757..4767
        src/melindaCustomMergeFields.js on lines 5063..5073

        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

        Severity
        Category
        Status
        Source
        Language