NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,132 of 1,132 total issues

File bib.js has 420 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const bibRules =
[
  {
    selector: '[1678]00',
    namePortion: '$a',
Severity: Minor
Found in src/punctuation/rules/bib.js - About 6 hrs to fix

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

        const recordInvalidDouble = new MarcRecord({
          leader: 'foo',
          fields: [
            {
              tag: '245',
    Severity: Major
    Found in src/field-exclusion.spec.js and 2 other locations - About 5 hrs to fix
    src/field-exclusion.spec.js on lines 246..272
    src/field-exclusion.spec.js on lines 464..490

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

    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

        const recordInvalidDouble = new MarcRecord({
          leader: 'foo',
          fields: [
            {
              tag: '245',
    Severity: Major
    Found in src/field-exclusion.spec.js and 2 other locations - About 5 hrs to fix
    src/field-exclusion.spec.js on lines 246..272
    src/field-exclusion.spec.js on lines 357..383

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

    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

        const recordInvalidDouble = new MarcRecord({
          leader: 'foo',
          fields: [
            {
              tag: '245',
    Severity: Major
    Found in src/field-exclusion.spec.js and 2 other locations - About 5 hrs to fix
    src/field-exclusion.spec.js on lines 357..383
    src/field-exclusion.spec.js on lines 464..490

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

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

        {
          'tag': '260',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': [' ', '2', '3'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 4 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 719..735
    src/melindaCustomMergeFields.js on lines 1454..1470
    src/melindaCustomMergeFields.js on lines 2538..2554
    src/melindaCustomMergeFields.js on lines 2633..2649

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

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

        {
          'tag': '555',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': [' ', '0', '8'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 4 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 719..735
    src/melindaCustomMergeFields.js on lines 1202..1218
    src/melindaCustomMergeFields.js on lines 1454..1470
    src/melindaCustomMergeFields.js on lines 2538..2554

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

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

        {
          'tag': '083',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ['0', '1', '7'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 4 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 1202..1218
    src/melindaCustomMergeFields.js on lines 1454..1470
    src/melindaCustomMergeFields.js on lines 2538..2554
    src/melindaCustomMergeFields.js on lines 2633..2649

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

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

        {
          'tag': '341',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': [' ', '0', '1'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 4 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 719..735
    src/melindaCustomMergeFields.js on lines 1202..1218
    src/melindaCustomMergeFields.js on lines 2538..2554
    src/melindaCustomMergeFields.js on lines 2633..2649

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

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

        {
          'tag': '544',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': [' ', '0', '1'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 4 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 719..735
    src/melindaCustomMergeFields.js on lines 1202..1218
    src/melindaCustomMergeFields.js on lines 1454..1470
    src/melindaCustomMergeFields.js on lines 2633..2649

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

    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 38 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (isLegalDeposit = false, useMelindaTemp = true) {
      const debug = createDebugLogger('@natlibfi/marc-record-validators-melinda:urn');
      const debugData = debug.extend('data');
    
      // We should check that the f856 with URN has second indicator '0' (Resource), ' ' (No information provided) or '8' (No display constant generated)
    Severity: Minor
    Found in src/urn.js - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        {
          'tag': '562',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2050..2066

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '255',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2050..2066
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '026',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2050..2066
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '348',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 2050..2066
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '300',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2050..2066
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '335',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2050..2066
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '336',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2050..2066
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

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

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

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

    Refactorings

    Further Reading

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

        {
          'tag': '502',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': ' ', 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 7 other locations - About 5 hrs to fix
    src/melindaCustomMergeFields.js on lines 179..195
    src/melindaCustomMergeFields.js on lines 1151..1167
    src/melindaCustomMergeFields.js on lines 1272..1288
    src/melindaCustomMergeFields.js on lines 1358..1374
    src/melindaCustomMergeFields.js on lines 1375..1391
    src/melindaCustomMergeFields.js on lines 1600..1616
    src/melindaCustomMergeFields.js on lines 2676..2692

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

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

    function validateField(field, linkedTag, fix, message) {
      // This is used to find last subfield that should have punctuation
      function findLastSubfield(field) {
        const subfields = field.subfields.filter(sf => isNaN(sf.code) && 'value' in sf);
        return subfields.slice(-1).shift();
    Severity: Major
    Found in src/ending-punctuation.js - About 5 hrs to fix

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

      async function testValidatorFactory() {
        const validator = await validatorFactory();
      
        expect(validator)
          .to.be.an('object')
      Severity: Major
      Found in src/addMissingField041.spec.js and 6 other locations - About 5 hrs to fix
      src/addMissingField336.spec.js on lines 20..30
      src/addMissingField337.spec.js on lines 20..30
      src/addMissingField338.spec.js on lines 20..30
      src/cyrillux-usemarcon-replacement.spec.js on lines 21..31
      src/cyrillux.spec.js on lines 20..30
      src/fix-33X.spec.js on lines 20..30

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

      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