NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

export default function () {

  return {
    description: 'Fix deprecated country codes',
    validate, fix
Severity: Minor
Found in src/fix-country-codes.js - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

    const recordValid = new MarcRecord({
      leader: 'foo',
      fields: [
        {
          tag: '100',
Severity: Major
Found in src/subfield-exclusion.spec.js and 5 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 260..275
src/subfield-exclusion.spec.js on lines 305..320
src/subfield-exclusion.spec.js on lines 357..372
src/subfield-exclusion.spec.js on lines 394..409
src/subfield-exclusion.spec.js on lines 479..494

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

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

        {tag: /^BAR$/u, length: 6, rules: [
          {position: 0, pattern: /[fb]/u},
          {position: 1, pattern: /a/u, dependencies: [{position: 0, pattern: /b/u}]},
          {position: [2, 3], pattern: /u/u, dependencies: [{position: 0, pattern: /[^b]/u}]}
        ]}
Severity: Major
Found in src/fixed-fields.spec.js and 1 other location - About 2 hrs to fix
src/fixed-fields.spec.js on lines 62..66

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

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

    const recordInvalidFixed = new MarcRecord({
      leader: 'foo',
      fields: [
        {
          tag: '100',
Severity: Major
Found in src/subfield-exclusion.spec.js and 5 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 223..238
src/subfield-exclusion.spec.js on lines 305..320
src/subfield-exclusion.spec.js on lines 357..372
src/subfield-exclusion.spec.js on lines 394..409
src/subfield-exclusion.spec.js on lines 479..494

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

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

        {tag: /^BAR$/u, length: 6, rules: [
          {position: 0, pattern: /[fb]/u},
          {position: 1, pattern: /a/u, dependencies: [{position: 0, pattern: /b/u}]},
          {position: [2, 3], pattern: /u/u, dependencies: [{position: 0, pattern: /[^a]/u}]}
        ]},
Severity: Major
Found in src/fixed-fields.spec.js and 1 other location - About 2 hrs to fix
src/fixed-fields.spec.js on lines 34..38

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

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

    const recordOriginal = new MarcRecord({
      leader: 'foo',
      fields: [
        {
          tag: '041',
Severity: Major
Found in src/subfield-exclusion.spec.js and 5 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 223..238
src/subfield-exclusion.spec.js on lines 260..275
src/subfield-exclusion.spec.js on lines 357..372
src/subfield-exclusion.spec.js on lines 394..409
src/subfield-exclusion.spec.js on lines 479..494

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

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

    const recordIndInvalidFixed = new MarcRecord({
      leader: 'foo',
      fields: [
        {
          tag: '245',
Severity: Major
Found in src/subfield-exclusion.spec.js and 5 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 223..238
src/subfield-exclusion.spec.js on lines 260..275
src/subfield-exclusion.spec.js on lines 305..320
src/subfield-exclusion.spec.js on lines 357..372
src/subfield-exclusion.spec.js on lines 394..409

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

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

    const recordInvalidFixed = new MarcRecord({
      leader: 'foo',
      fields: [
        {
          tag: '210',
Severity: Major
Found in src/subfield-exclusion.spec.js and 5 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 223..238
src/subfield-exclusion.spec.js on lines 260..275
src/subfield-exclusion.spec.js on lines 305..320
src/subfield-exclusion.spec.js on lines 357..372
src/subfield-exclusion.spec.js on lines 479..494

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

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

    const recordValid = new MarcRecord({
      leader: 'foo',
      fields: [
        {
          tag: '210',
Severity: Major
Found in src/subfield-exclusion.spec.js and 5 other locations - About 2 hrs to fix
src/subfield-exclusion.spec.js on lines 223..238
src/subfield-exclusion.spec.js on lines 260..275
src/subfield-exclusion.spec.js on lines 305..320
src/subfield-exclusion.spec.js on lines 394..409
src/subfield-exclusion.spec.js on lines 479..494

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

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

  function specialCases(res, field, tag) {
    let lastSubField = null; // eslint-disable-line functional/no-let
    // Punctuation should be only after specific field
    if (res.special.afterOnly) {
      lastSubField = findLastSubfield(field);
Severity: Major
Found in src/ending-punctuation.js - About 2 hrs to fix

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

          if (!(/,$/u).test(preceedingSubfield.value)) {
            if (!(/^[[(]/u).test(currentSubfield.value)) { // eslint-disable-line functional/no-conditional-statements
              const nextValue = `${preceedingSubfield.value},`;
              debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
              preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
    Severity: Major
    Found in src/punctuation/index.js and 1 other location - About 2 hrs to fix
    src/punctuation/index.js on lines 193..199

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

    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

        if (punctType === 'COND_COMMA') {
          if (!(/[-,]$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statements
            const nextValue = `${preceedingSubfield.value},`;
            debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
            preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
    Severity: Major
    Found in src/punctuation/index.js and 1 other location - About 2 hrs to fix
    src/punctuation/index.js on lines 184..190

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

    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

    File mergeConstraints.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import createDebugLogger from 'debug';
    const debug = createDebugLogger('@natlibfi/melinda-marc-record-merge-reducers:mergeConstraints');
    //const debugData = debug.extend('data');
    const debugDev = debug.extend('dev');
    
    
    Severity: Minor
    Found in src/merge-fields/mergeConstraints.js - About 2 hrs to fix

      File resolvable-ext-references-melinda.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      
      export const fixture5000 = `
      <?xml version="1.0"?>
      <zs:searchRetrieveResponse xmlns:zs="http://www.loc.gov/zing/srw/"><zs:version>1.1</zs:version><zs:numberOfRecords>1</zs:numberOfRecords><zs:records><zs:record><zs:recordSchema>info:srw/schema/1/marcxml-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><record xmlns="http://www.loc.gov/MARC21/slim">
      <leader>00639cam a22002057i 4500</leader>
      Severity: Minor
      Found in test-fixtures/resolvable-ext-references-melinda.js - About 2 hrs to fix

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

        export default function ({endpoint, prefixPattern, fields}) {
          if (typeof endpoint === 'string' && prefixPattern instanceof RegExp && typeof fields === 'object') {
            return {
              description: 'Checks if Melinda entity references are resolvable',
              validate
        Severity: Minor
        Found in src/resolvable-ext-references-melinda.js - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            it('Throws an error when config array has excluded element', () => {
              const config = [
                {
                  leader: /^035$/u,
                  tag: /^035$/u
        Severity: Major
        Found in src/field-structure.spec.js and 1 other location - About 2 hrs to fix
        src/field-structure.spec.js on lines 44..57

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

        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': '307',
              'repeatable': true,
              'fieldType': 'dataField',
              'indicators': {'ind1': [' ', '8'], 'ind2': ' '},
        Severity: Major
        Found in src/melindaCustomMergeFields.js and 4 other locations - About 2 hrs to fix
        src/melindaCustomMergeFields.js on lines 80..91
        src/melindaCustomMergeFields.js on lines 1708..1719
        src/melindaCustomMergeFields.js on lines 2650..2661
        src/melindaCustomMergeFields.js on lines 2829..2840

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

        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': '586',
              'repeatable': true,
              'fieldType': 'dataField',
              'indicators': {'ind1': [' ', '8'], 'ind2': ' '},
        Severity: Major
        Found in src/melindaCustomMergeFields.js and 4 other locations - About 2 hrs to fix
        src/melindaCustomMergeFields.js on lines 80..91
        src/melindaCustomMergeFields.js on lines 1300..1311
        src/melindaCustomMergeFields.js on lines 1708..1719
        src/melindaCustomMergeFields.js on lines 2650..2661

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

        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': '016',
              'repeatable': true,
              'fieldType': 'dataField',
              'indicators': {'ind1': [' ', '7'], 'ind2': ' '},
        Severity: Major
        Found in src/melindaCustomMergeFields.js and 4 other locations - About 2 hrs to fix
        src/melindaCustomMergeFields.js on lines 1300..1311
        src/melindaCustomMergeFields.js on lines 1708..1719
        src/melindaCustomMergeFields.js on lines 2650..2661
        src/melindaCustomMergeFields.js on lines 2829..2840

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

        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': '556',
              'repeatable': true,
              'fieldType': 'dataField',
              'indicators': {'ind1': [' ', '8'], 'ind2': ' '},
        Severity: Major
        Found in src/melindaCustomMergeFields.js and 4 other locations - About 2 hrs to fix
        src/melindaCustomMergeFields.js on lines 80..91
        src/melindaCustomMergeFields.js on lines 1300..1311
        src/melindaCustomMergeFields.js on lines 1708..1719
        src/melindaCustomMergeFields.js on lines 2829..2840

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

        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