NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 830 of 830 total issues

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

      it('Repairs the invalid record - 658 !Finnish, add punc $d', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid658EngNo);
        expect(recordInvalid658EngNo.equalsTo(recordValid658EngYes)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 231..240
src/ending-punctuation.spec.js on lines 442..451
src/ending-punctuation.spec.js on lines 464..473
src/ending-punctuation.spec.js on lines 475..484
src/ending-punctuation.spec.js on lines 622..631
src/ending-punctuation.spec.js on lines 797..806
src/ending-punctuation.spec.js on lines 1055..1064
src/ending-punctuation.spec.js on lines 1066..1075
src/ending-punctuation.spec.js on lines 1077..1086
src/ending-punctuation.spec.js on lines 1088..1097
src/ending-punctuation.spec.js on lines 1221..1230
src/ending-punctuation.spec.js on lines 1384..1393
src/ending-punctuation.spec.js on lines 1497..1506
src/ending-punctuation.spec.js on lines 1801..1810
src/ending-punctuation.spec.js on lines 1812..1821
src/ending-punctuation.spec.js on lines 1823..1832
src/ending-punctuation.spec.js on lines 1834..1843
src/ending-punctuation.spec.js on lines 1845..1854
src/ending-punctuation.spec.js on lines 2237..2246
src/ending-punctuation.spec.js on lines 2248..2257
src/ending-punctuation.spec.js on lines 2259..2268
src/ending-punctuation.spec.js on lines 2270..2279
src/ending-punctuation.spec.js on lines 2281..2290
src/ending-punctuation.spec.js on lines 2303..2312
src/ending-punctuation.spec.js on lines 2418..2427
src/ending-punctuation.spec.js on lines 2544..2553

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

      it('Repairs the invalid record - Remove punc $c ($c has ©, should not have punc)', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalidCopyrightCExtra);
        expect(recordInvalidCopyrightCExtra.equalsTo(recordValidCopyright)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 231..240
src/ending-punctuation.spec.js on lines 442..451
src/ending-punctuation.spec.js on lines 464..473
src/ending-punctuation.spec.js on lines 475..484
src/ending-punctuation.spec.js on lines 622..631
src/ending-punctuation.spec.js on lines 1055..1064
src/ending-punctuation.spec.js on lines 1066..1075
src/ending-punctuation.spec.js on lines 1077..1086
src/ending-punctuation.spec.js on lines 1088..1097
src/ending-punctuation.spec.js on lines 1221..1230
src/ending-punctuation.spec.js on lines 1384..1393
src/ending-punctuation.spec.js on lines 1497..1506
src/ending-punctuation.spec.js on lines 1801..1810
src/ending-punctuation.spec.js on lines 1812..1821
src/ending-punctuation.spec.js on lines 1823..1832
src/ending-punctuation.spec.js on lines 1834..1843
src/ending-punctuation.spec.js on lines 1845..1854
src/ending-punctuation.spec.js on lines 2237..2246
src/ending-punctuation.spec.js on lines 2248..2257
src/ending-punctuation.spec.js on lines 2259..2268
src/ending-punctuation.spec.js on lines 2270..2279
src/ending-punctuation.spec.js on lines 2281..2290
src/ending-punctuation.spec.js on lines 2292..2301
src/ending-punctuation.spec.js on lines 2303..2312
src/ending-punctuation.spec.js on lines 2418..2427
src/ending-punctuation.spec.js on lines 2544..2553

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

      it('Repairs the invalid record - 662 !Finnish, add pun $a', async () => {
        const validator = await validatorFactory();
        const result = await validator.fix(recordInvalid662EngNo);
        expect(recordInvalid662EngNo.equalsTo(recordValid662EngYes)).to.eql(true);
        expect(result).to.eql({
Severity: Major
Found in src/ending-punctuation.spec.js and 26 other locations - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 231..240
src/ending-punctuation.spec.js on lines 442..451
src/ending-punctuation.spec.js on lines 464..473
src/ending-punctuation.spec.js on lines 475..484
src/ending-punctuation.spec.js on lines 622..631
src/ending-punctuation.spec.js on lines 797..806
src/ending-punctuation.spec.js on lines 1055..1064
src/ending-punctuation.spec.js on lines 1066..1075
src/ending-punctuation.spec.js on lines 1077..1086
src/ending-punctuation.spec.js on lines 1088..1097
src/ending-punctuation.spec.js on lines 1221..1230
src/ending-punctuation.spec.js on lines 1384..1393
src/ending-punctuation.spec.js on lines 1497..1506
src/ending-punctuation.spec.js on lines 1801..1810
src/ending-punctuation.spec.js on lines 1812..1821
src/ending-punctuation.spec.js on lines 1823..1832
src/ending-punctuation.spec.js on lines 1834..1843
src/ending-punctuation.spec.js on lines 1845..1854
src/ending-punctuation.spec.js on lines 2237..2246
src/ending-punctuation.spec.js on lines 2248..2257
src/ending-punctuation.spec.js on lines 2259..2268
src/ending-punctuation.spec.js on lines 2270..2279
src/ending-punctuation.spec.js on lines 2281..2290
src/ending-punctuation.spec.js on lines 2292..2301
src/ending-punctuation.spec.js on lines 2418..2427
src/ending-punctuation.spec.js on lines 2544..2553

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

export default function () {

  return {
    description: 'If Asteri subfield $0 is found, remove non-Asteri $0 subfields',
    validate, fix
Severity: Minor
Found in src/multiple-subfield-0.js - About 3 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 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function () {

  return {
    description: 'If Asteri subfield $0 is found, remove non-Asteri $0 subfields',
    validate, fix
Severity: Major
Found in src/multiple-subfield-0.js - About 3 hrs to fix

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

          expect(record.fields).to.eql([
            {
              tag: '008',
              value: '151118t20162016fi^a|||^^^^^^^|0|^0|eng|^'
            },
    Severity: Major
    Found in src/item-language.spec.js and 2 other locations - About 3 hrs to fix
    src/isbn-issn.spec.js on lines 356..360
    src/item-language.spec.js on lines 240..262

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

    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

          expect(record.fields).to.eql([
            {
              tag: '008',
              value: '151118t20162016fi^a|||^^^^^^^|0|^0|eng|^'
            },
    Severity: Major
    Found in src/item-language.spec.js and 2 other locations - About 3 hrs to fix
    src/isbn-issn.spec.js on lines 356..360
    src/item-language.spec.js on lines 192..214

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 106.

    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

          expect(record.fields).to.eql([
            {tag: '005', value: 'whatever'},
            {tag: '020', ind1: ' ', ind2: ' ', subfields: [{code: 'q', value: 'sidottu'}]},
            {tag: '024', ind1: ' ', ind2: ' ', subfields: [{code: 'a', value: ' 9786003770171'}]}
          ]);
    Severity: Major
    Found in src/isbn-issn.spec.js and 2 other locations - About 3 hrs to fix
    src/item-language.spec.js on lines 192..214
    src/item-language.spec.js on lines 240..262

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

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

    export default function (config) {
      if (!Array.isArray(config)) {
        throw new TypeError('Configuration array not provided');
      }
    
    
    Severity: Major
    Found in src/subfield-exclusion.js - About 3 hrs to fix

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

          const recordInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordInvalidMissing = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '100',
      Severity: Major
      Found in src/field-structure.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordIndInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/subfield-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414

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

      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

          const recordInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordValid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordValid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '100',
      Severity: Major
      Found in src/subfield-exclusion.spec.js and 1 other location - About 3 hrs to fix
      src/subfield-exclusion.spec.js on lines 374..392

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

      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

          const recordInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 565..583
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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

          const recordInvalid = new MarcRecord({
            leader: 'foo',
            fields: [
              {
                tag: '245',
      Severity: Major
      Found in src/field-exclusion.spec.js and 9 other locations - About 3 hrs to fix
      src/field-exclusion.spec.js on lines 226..244
      src/field-exclusion.spec.js on lines 337..355
      src/field-exclusion.spec.js on lines 444..462
      src/field-exclusion.spec.js on lines 545..563
      src/field-exclusion.spec.js on lines 625..643
      src/field-exclusion.spec.js on lines 645..663
      src/field-exclusion.spec.js on lines 783..801
      src/field-structure.spec.js on lines 386..414
      src/subfield-exclusion.spec.js on lines 459..477

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

      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