NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 830 of 830 total issues

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  it('Creates a validator', async () => {
    const validator = await validatorFactory();

    expect(validator)
      .to.be.an('object')
Severity: Major
Found in src/identical-fields.spec.js and 5 other locations - About 4 hrs to fix
src/double-commas.spec.js on lines 6..15
src/empty-fields.spec.js on lines 14..23
src/isbn-issn.spec.js on lines 6..15
src/sort-tags.spec.js on lines 6..15
src/unicode-decomposition.spec.js on lines 10..19

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  it('Creates a validator', async () => {
    const validator = await validatorFactory();

    expect(validator)
      .to.be.an('object')
Severity: Major
Found in src/unicode-decomposition.spec.js and 5 other locations - About 4 hrs to fix
src/double-commas.spec.js on lines 6..15
src/empty-fields.spec.js on lines 14..23
src/identical-fields.spec.js on lines 6..15
src/isbn-issn.spec.js on lines 6..15
src/sort-tags.spec.js on lines 6..15

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  it('Creates a validator', async () => {
    const validator = await validatorFactory();

    expect(validator)
      .to.be.an('object')
Severity: Major
Found in src/sort-tags.spec.js and 5 other locations - About 4 hrs to fix
src/double-commas.spec.js on lines 6..15
src/empty-fields.spec.js on lines 14..23
src/identical-fields.spec.js on lines 6..15
src/isbn-issn.spec.js on lines 6..15
src/unicode-decomposition.spec.js on lines 10..19

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  it('Creates a validator', async () => {
    const validator = await validatorFactory();

    expect(validator)
      .to.be.an('object')
Severity: Major
Found in src/isbn-issn.spec.js and 5 other locations - About 4 hrs to fix
src/double-commas.spec.js on lines 6..15
src/empty-fields.spec.js on lines 14..23
src/identical-fields.spec.js on lines 6..15
src/sort-tags.spec.js on lines 6..15
src/unicode-decomposition.spec.js on lines 10..19

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  it('Creates a validator', async () => {
    const validator = await validatorFactory();

    expect(validator)
      .to.be.an('object')
Severity: Major
Found in src/double-commas.spec.js and 5 other locations - About 4 hrs to fix
src/empty-fields.spec.js on lines 14..23
src/identical-fields.spec.js on lines 6..15
src/isbn-issn.spec.js on lines 6..15
src/sort-tags.spec.js on lines 6..15
src/unicode-decomposition.spec.js on lines 10..19

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

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 recordValidComplex = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '340',
Severity: Major
Found in src/ending-punctuation.spec.js and 1 other location - About 4 hrs to fix
src/ending-punctuation.spec.js on lines 979..996

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

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 recordInvalidComplexDMissing = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '340',
Severity: Major
Found in src/ending-punctuation.spec.js and 1 other location - About 4 hrs to fix
src/ending-punctuation.spec.js on lines 857..874

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

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 105 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/field-exclusion.js - About 4 hrs to fix

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/update-field-540.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/mergeRelatorTermFields.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/punctuation.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/field-008-18-34-character-groups.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/fix-language-codes.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/multiple-subfield-0.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/sortSubfields.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/normalize-identifiers.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/ending-whitespace.spec.js and 29 other locations - About 4 hrs to fix
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/resolveOrphanedSubfield6s.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/indicator-fixes.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-country-codes.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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

    Identical blocks of code found in 30 locations. Consider refactoring.
    Open

    async function testValidatorFactory() {
      const validator = await validatorFactory();
    
      expect(validator)
        .to.be.an('object')
    Severity: Major
    Found in src/fix-country-codes.spec.js and 29 other locations - About 4 hrs to fix
    src/ending-whitespace.spec.js on lines 20..29
    src/field-008-18-34-character-groups.spec.js on lines 22..31
    src/field-505-separators.spec.js on lines 22..31
    src/field-521-fix.spec.js on lines 22..31
    src/fix-language-codes.spec.js on lines 20..29
    src/fixRelatorTerms.spec.js on lines 22..31
    src/indicator-fixes.spec.js on lines 22..31
    src/mergeField500Lisapainokset.spec.js on lines 22..31
    src/mergeRelatorTermFields.spec.js on lines 22..31
    src/multiple-subfield-0.spec.js on lines 22..31
    src/non-breaking-space.spec.js on lines 20..29
    src/normalize-dashes.spec.js on lines 22..31
    src/normalize-identifiers.spec.js on lines 22..31
    src/normalize-qualifying-information.spec.js on lines 22..31
    src/normalize-utf8-diacritics.spec.js on lines 22..31
    src/punctuation.spec.js on lines 22..31
    src/punctuation2.spec.js on lines 22..31
    src/reindexSubfield6OccurenceNumbers.spec.js on lines 22..31
    src/removeDuplicateDataFields.spec.js on lines 22..31
    src/removeInferiorDataFields.spec.js on lines 22..31
    src/resolveOrphanedSubfield6s.spec.js on lines 22..31
    src/sanitize-vocabulary-source-codes.spec.js on lines 22..31
    src/sortFields.spec.js on lines 22..31
    src/sortRelatorTerms.spec.js on lines 22..31
    src/sortSubfields.spec.js on lines 22..31
    src/stripPunctuation.spec.js on lines 22..31
    src/subfieldValueNormalizations.spec.js on lines 22..31
    src/sync-007-and-300.spec.js on lines 22..31
    src/update-field-540.spec.js on lines 22..31

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

    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