NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

    {
      'tag': '513',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '036',
      'repeatable': false,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '258',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '010',
      'repeatable': false,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '507',
      'repeatable': false,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '030',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '051',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '061',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 791..802
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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

    {
      'tag': '088',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
src/melindaCustomMergeFields.js on lines 38..49
src/melindaCustomMergeFields.js on lines 222..233
src/melindaCustomMergeFields.js on lines 262..273
src/melindaCustomMergeFields.js on lines 338..349
src/melindaCustomMergeFields.js on lines 560..571
src/melindaCustomMergeFields.js on lines 616..627
src/melindaCustomMergeFields.js on lines 652..663
src/melindaCustomMergeFields.js on lines 1190..1201
src/melindaCustomMergeFields.js on lines 2067..2078
src/melindaCustomMergeFields.js on lines 2117..2128
src/melindaCustomMergeFields.js on lines 2129..2140
src/melindaCustomMergeFields.js on lines 2183..2194
src/melindaCustomMergeFields.js on lines 2219..2230
src/melindaCustomMergeFields.js on lines 2593..2604
src/melindaCustomMergeFields.js on lines 4838..4849

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

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 default has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export default function () {

  return {description, validate, fix};

  function fix(record) {
Severity: Minor
Found in src/fix-language-codes.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 determineNonFilingIndicatorValue has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function determineNonFilingIndicatorValue(field, languages = undefined) {
  const subfieldA = field.subfields.find(sf => sf.code === 'a');
  if (!subfieldA) {
    // nvdebug(' Subfield $a miss!');
    return;
Severity: Minor
Found in src/indicator-fixes.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 default has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export default function (config) {
  if (!Array.isArray(config)) {
    throw new TypeError('Configuration array not provided');
  }

Severity: Minor
Found in src/field-structure.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 fix has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async function fix(record) {
    const f856sUrn = record.fields.filter(hasURN);
    debugData(`f856sUrn: ${JSON.stringify(f856sUrn)}`);

    const ldSubfields = isLegalDeposit ? createLDSubfields() : [];
Severity: Major
Found in src/urn.js - About 2 hrs to fix

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

      function fix(record) {
        nvdebug(`FIX ${description}...`);
        const newField = getMissing337(record);
        const res = {message: [], fix: [], valid: true};
        if (newField) {
    Severity: Major
    Found in src/addMissingField337.js and 2 other locations - About 2 hrs to fix
    src/addMissingField041.js on lines 53..62
    src/addMissingField338.js on lines 14..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 85.

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

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

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

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

    Refactorings

    Further Reading

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

      function fix(record) {
        nvdebug(`FIX ${description}...`);
        const newField = getMissing338(record);
        const res = {message: [], fix: [], valid: true};
    
    
    Severity: Major
    Found in src/addMissingField338.js and 2 other locations - About 2 hrs to fix
    src/addMissingField041.js on lines 53..62
    src/addMissingField337.js on lines 29..39

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 85.

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

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

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

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

    Refactorings

    Further Reading

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

      function fix(record) {
        nvdebug(`FIX ${description}...`);
        const data = generateContent(record);
        const res = {message: [], fix: [], valid: true};
        if (data) {
    Severity: Major
    Found in src/addMissingField041.js and 2 other locations - About 2 hrs to fix
    src/addMissingField337.js on lines 29..39
    src/addMissingField338.js on lines 14..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 85.

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

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

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

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

    Refactorings

    Further Reading

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

          const recordInvalid647FastEndPunc = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '647',
    Severity: Major
    Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 491..505
    src/ending-punctuation.spec.js on lines 559..573
    src/ending-punctuation.spec.js on lines 648..662
    src/ending-punctuation.spec.js on lines 1301..1315
    src/ending-punctuation.spec.js on lines 1514..1528
    src/ending-punctuation.spec.js on lines 2319..2333
    src/ending-punctuation.spec.js on lines 2360..2374

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

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

          const recordValid = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '760',
    Severity: Major
    Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 491..505
    src/ending-punctuation.spec.js on lines 559..573
    src/ending-punctuation.spec.js on lines 648..662
    src/ending-punctuation.spec.js on lines 1301..1315
    src/ending-punctuation.spec.js on lines 1514..1528
    src/ending-punctuation.spec.js on lines 1643..1657
    src/ending-punctuation.spec.js on lines 2360..2374

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

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

          const recordValidInd2v1 = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '264',
    Severity: Major
    Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 491..505
    src/ending-punctuation.spec.js on lines 559..573
    src/ending-punctuation.spec.js on lines 1301..1315
    src/ending-punctuation.spec.js on lines 1514..1528
    src/ending-punctuation.spec.js on lines 1643..1657
    src/ending-punctuation.spec.js on lines 2319..2333
    src/ending-punctuation.spec.js on lines 2360..2374

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

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

          const recordInvalidMissingI = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '538',
    Severity: Major
    Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 491..505
    src/ending-punctuation.spec.js on lines 559..573
    src/ending-punctuation.spec.js on lines 648..662
    src/ending-punctuation.spec.js on lines 1514..1528
    src/ending-punctuation.spec.js on lines 1643..1657
    src/ending-punctuation.spec.js on lines 2319..2333
    src/ending-punctuation.spec.js on lines 2360..2374

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

    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