NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,132 of 1,132 total issues

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

      try {
        await validatorFactory(config);
      } catch (error) {
        expect(error).to.be.an('error').with.property('message', 'Configuration array not provided');
      }
Severity: Major
Found in src/field-exclusion.spec.js and 9 other locations - About 1 hr to fix
src/field-exclusion.spec.js on lines 49..53
src/field-exclusion.spec.js on lines 77..81
src/field-exclusion.spec.js on lines 92..96
src/field-exclusion.spec.js on lines 109..113
src/field-exclusion.spec.js on lines 124..128
src/field-exclusion.spec.js on lines 142..146
src/field-exclusion.spec.js on lines 161..165
src/field-exclusion.spec.js on lines 179..183
src/field-exclusion.spec.js on lines 198..202

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

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

      try {
        await validatorFactory(config);
      } catch (error) {
        expect(error).to.be.an('error').with.property('message', 'Configuration not valid - invalid data type for: code');
      }
Severity: Major
Found in src/field-exclusion.spec.js and 9 other locations - About 1 hr to fix
src/field-exclusion.spec.js on lines 49..53
src/field-exclusion.spec.js on lines 62..66
src/field-exclusion.spec.js on lines 92..96
src/field-exclusion.spec.js on lines 109..113
src/field-exclusion.spec.js on lines 124..128
src/field-exclusion.spec.js on lines 142..146
src/field-exclusion.spec.js on lines 161..165
src/field-exclusion.spec.js on lines 179..183
src/field-exclusion.spec.js on lines 198..202

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

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

      try {
        await validatorFactory(config);
      } catch (error) {
        expect(error).to.be.an('error').with.property('message', 'Configuration not valid - invalid data type for: value');
      }
Severity: Major
Found in src/field-exclusion.spec.js and 9 other locations - About 1 hr to fix
src/field-exclusion.spec.js on lines 49..53
src/field-exclusion.spec.js on lines 62..66
src/field-exclusion.spec.js on lines 77..81
src/field-exclusion.spec.js on lines 109..113
src/field-exclusion.spec.js on lines 124..128
src/field-exclusion.spec.js on lines 142..146
src/field-exclusion.spec.js on lines 161..165
src/field-exclusion.spec.js on lines 179..183
src/field-exclusion.spec.js on lines 198..202

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

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

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

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

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

Refactorings

Further Reading

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

export function nvdebugSubfieldArray(subfields, prefix = '  ', func = undefined) {
  subfields.forEach(subfield => nvdebug(`${prefix}${subfieldToString(subfield)}`, func));
}
Severity: Major
Found in src/utils.js and 1 other location - About 1 hr to fix
src/utils.js on lines 101..103

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

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

export default function () {

  return {
    description: 'Normalize " ; " separators as " -- "',
    validate, fix
Severity: Minor
Found in src/field-505-separators.js - About 1 hr to fix

    Function default has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function () {
    
      return {
        description: 'Various fixes for field 521',
        validate, fix
    Severity: Minor
    Found in src/field-521-fix.js - About 1 hr to fix

      Function fieldHandleDuplicateDatafields has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function fieldHandleDuplicateDatafields(field, record) {
        const chain = fieldToChain(field, record);
        nvdebug(` TRY TO HANDLE DUPLICATES OF '${fieldsToString(chain)}'`);
      
        if (chain.length === 0) {
      Severity: Minor
      Found in src/removeDuplicateDataFields.js - About 1 hr to fix

        Function validateRecord has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function validateRecord(record) {
            const removedPrefixes = [];
        
            // Filter matching field keys from record.fields
            const subfields = record.fields.reduce((prev, current) => {
        Severity: Minor
        Found in src/resolvable-ext-references-melinda.js - About 1 hr to fix

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

                const recordValidOnlyA = new MarcRecord({
                  leader: '',
                  fields: [
                    {
                      tag: '036',
          Severity: Major
          Found in src/ending-punctuation.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

              const recordInvalidFixed = new MarcRecord({
                leader: 'foo',
                fields: [
                  {
                    tag: '245',
          Severity: Major
          Found in src/field-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

                const recordInvalidOnlyA = new MarcRecord({
                  leader: '',
                  fields: [
                    {
                      tag: '760',
          Severity: Major
          Found in src/ending-punctuation.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

              const recordModified = new MarcRecord({
                leader: 'foo',
                fields: [
                  {
                    tag: '245',
          Severity: Major
          Found in src/subfield-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886

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

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

              const recordInvalidFixed = new MarcRecord({
                leader: 'foo',
                fields: [
                  {
                    tag: '245',
          Severity: Major
          Found in src/field-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

                const recordValidOnlyA = new MarcRecord({
                  leader: '',
                  fields: [
                    {
                      tag: '538',
          Severity: Major
          Found in src/ending-punctuation.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

              const recordInvalidFixed = new MarcRecord({
                leader: 'foo',
                fields: [
                  {
                    tag: '245',
          Severity: Major
          Found in src/field-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

                const record = new MarcRecord({
                  leader: '00000cam^a22003372i^4500',
                  fields: [
                    {
                      tag: '041',
          Severity: Major
          Found in src/field-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/subfield-exclusion.spec.js on lines 322..332

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

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

                const recordInvalidOnlyA = new MarcRecord({
                  leader: '',
                  fields: [
                    {
                      tag: '538',
          Severity: Major
          Found in src/ending-punctuation.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

              const recordInvalidFixed = new MarcRecord({
                leader: 'foo',
                fields: [
                  {
                    tag: '245',
          Severity: Major
          Found in src/field-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

              const recordInvalidFixed = new MarcRecord({
                leader: 'foo',
                fields: [
                  {
                    tag: '245',
          Severity: Major
          Found in src/field-exclusion.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2335..2345
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

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

                const recordValidOnlyA = new MarcRecord({
                  leader: '',
                  fields: [
                    {
                      tag: '760',
          Severity: Major
          Found in src/ending-punctuation.spec.js and 16 other locations - About 1 hr to fix
          src/ending-punctuation.spec.js on lines 149..159
          src/ending-punctuation.spec.js on lines 1270..1280
          src/ending-punctuation.spec.js on lines 1333..1343
          src/ending-punctuation.spec.js on lines 1908..1918
          src/ending-punctuation.spec.js on lines 2078..2088
          src/ending-punctuation.spec.js on lines 2376..2386
          src/field-exclusion.spec.js on lines 214..224
          src/field-exclusion.spec.js on lines 274..284
          src/field-exclusion.spec.js on lines 325..335
          src/field-exclusion.spec.js on lines 385..395
          src/field-exclusion.spec.js on lines 492..502
          src/field-exclusion.spec.js on lines 585..595
          src/field-exclusion.spec.js on lines 702..712
          src/field-exclusion.spec.js on lines 818..828
          src/field-exclusion.spec.js on lines 876..886
          src/subfield-exclusion.spec.js on lines 322..332

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

          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