NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

export default function () {

  return {
    description: 'Validator for updating mismatching f007 based on f300 (DVD/Bluray) (MRA-613)',
    validate, fix
Severity: Minor
Found in src/sync-007-and-300.js - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

    {
      'tag': '070',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': [' ', '0', '1'], 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 2 other locations - About 3 hrs to fix
src/melindaCustomMergeFields.js on lines 2555..2567
src/melindaCustomMergeFields.js on lines 3351..3363

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

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

    {
      'tag': '545',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': [' ', '0', '1'], 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 2 other locations - About 3 hrs to fix
src/melindaCustomMergeFields.js on lines 639..651
src/melindaCustomMergeFields.js on lines 3351..3363

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

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

    {
      'tag': '720',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': [' ', '1', '2'], 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 2 other locations - About 3 hrs to fix
src/melindaCustomMergeFields.js on lines 639..651
src/melindaCustomMergeFields.js on lines 2555..2567

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

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 subfield6Utils.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import createDebugLogger from 'debug';
// const debug = createDebugLogger('@natlibfi/marc-record-validator-melinda/subfield6Utils');

import {add8s, fieldsGetAllSubfield8LinkingNumbers, getSubfield8LinkingNumber, isValidSubfield8} from './subfield8Utils';
import {fieldHasSubfield, fieldToString, fieldsToString, nvdebug, subfieldToString} from './utils';
Severity: Minor
Found in src/subfield6Utils.js - About 3 hrs to fix

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

        {
          'tag': '524',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': [' ', '8'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 1 other location - About 3 hrs to fix
    src/melindaCustomMergeFields.js on lines 2759..2771

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

    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': '581',
          'repeatable': true,
          'fieldType': 'dataField',
          'indicators': {'ind1': [' ', '8'], 'ind2': ' '},
    Severity: Major
    Found in src/melindaCustomMergeFields.js and 1 other location - About 3 hrs to fix
    src/melindaCustomMergeFields.js on lines 2301..2313

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

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

    function controlSubfield9PermitsMerge(baseField, sourceField) {
      const baseFieldSubfields9 = baseField.subfields.filter(sf => sf.code === '9');
      const sourceFieldSubfields9 = sourceField.subfields.filter(sf => sf.code === '9');
    
      //nvdebug('CHECK $9', debugDev);
    Severity: Major
    Found in src/merge-fields/controlSubfields.js - About 3 hrs to fix

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

            const record = new MarcRecord({
              fields: [
                {
                  tag: '005',
                  value: 'whatever'
      Severity: Major
      Found in src/isbn-issn.spec.js and 4 other locations - About 3 hrs to fix
      src/item-language.spec.js on lines 78..102
      src/item-language.spec.js on lines 110..134
      src/item-language.spec.js on lines 165..189
      src/item-language.spec.js on lines 267..291

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

      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

            const record = new MarcRecord({
              fields: [
                {
                  tag: '008',
                  value: '151118t20162016fi^a|||^^^^^^^|0|^0|fin|^'
      Severity: Major
      Found in src/item-language.spec.js and 4 other locations - About 3 hrs to fix
      src/isbn-issn.spec.js on lines 334..353
      src/item-language.spec.js on lines 78..102
      src/item-language.spec.js on lines 165..189
      src/item-language.spec.js on lines 267..291

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

      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

            const record = new MarcRecord({
              fields: [
                {
                  tag: '008',
                  value: '151118t20162016fi^a|||^^^^^^^|0|^0|fin|^'
      Severity: Major
      Found in src/item-language.spec.js and 4 other locations - About 3 hrs to fix
      src/isbn-issn.spec.js on lines 334..353
      src/item-language.spec.js on lines 78..102
      src/item-language.spec.js on lines 110..134
      src/item-language.spec.js on lines 165..189

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

      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

            const record = new MarcRecord({
              fields: [
                {
                  tag: '008',
                  value: '151118t20162016fi^a|||^^^^^^^|0|^0|fin|^'
      Severity: Major
      Found in src/item-language.spec.js and 4 other locations - About 3 hrs to fix
      src/isbn-issn.spec.js on lines 334..353
      src/item-language.spec.js on lines 78..102
      src/item-language.spec.js on lines 110..134
      src/item-language.spec.js on lines 267..291

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

      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

        function validate(record) {
          nvdebug(`VALIDATE ${description}....`);
          const newField = getMissing337(record);
          if (!newField) {
            return {message: [], valid: true};
      Severity: Major
      Found in src/addMissingField337.js and 2 other locations - About 3 hrs to fix
      src/addMissingField041.js on lines 64..72
      src/addMissingField338.js on lines 27..35

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

      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

        function validate(record) {
          nvdebug(`VALIDATE ${description}...`);
          const newField = getMissing338(record);
          if (!newField) {
            return {message: [], valid: true};
      Severity: Major
      Found in src/addMissingField338.js and 2 other locations - About 3 hrs to fix
      src/addMissingField041.js on lines 64..72
      src/addMissingField337.js on lines 41..49

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

      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

        function validate(record) {
          nvdebug(`VALIDATE ${description}...`);
          const data = generateContent(record);
          if (!data) {
            return {message: [], valid: true};
      Severity: Major
      Found in src/addMissingField041.js and 2 other locations - About 3 hrs to fix
      src/addMissingField337.js on lines 41..49
      src/addMissingField338.js on lines 27..35

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

      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

            const record = new MarcRecord({
              fields: [
                {
                  tag: '008',
                  value: '151118t20162016fi^a|||^^^^^^^|0|^0|fin|^'
      Severity: Major
      Found in src/item-language.spec.js and 4 other locations - About 3 hrs to fix
      src/isbn-issn.spec.js on lines 334..353
      src/item-language.spec.js on lines 110..134
      src/item-language.spec.js on lines 165..189
      src/item-language.spec.js on lines 267..291

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

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

          {
            'tag': '027',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 8 other locations - About 3 hrs to fix
      src/melindaCustomMergeFields.js on lines 325..337
      src/melindaCustomMergeFields.js on lines 1112..1124
      src/melindaCustomMergeFields.js on lines 2037..2049
      src/melindaCustomMergeFields.js on lines 2816..2828
      src/melindaCustomMergeFields.js on lines 4622..4634
      src/melindaCustomMergeFields.js on lines 4653..4665
      src/melindaCustomMergeFields.js on lines 5014..5026
      src/melindaCustomMergeFields.js on lines 5117..5127

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

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

          {
            'tag': '501',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 8 other locations - About 3 hrs to fix
      src/melindaCustomMergeFields.js on lines 196..208
      src/melindaCustomMergeFields.js on lines 325..337
      src/melindaCustomMergeFields.js on lines 1112..1124
      src/melindaCustomMergeFields.js on lines 2816..2828
      src/melindaCustomMergeFields.js on lines 4622..4634
      src/melindaCustomMergeFields.js on lines 4653..4665
      src/melindaCustomMergeFields.js on lines 5014..5026
      src/melindaCustomMergeFields.js on lines 5117..5127

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

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

          {
            'tag': '961',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': '8'},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 8 other locations - About 3 hrs to fix
      src/melindaCustomMergeFields.js on lines 196..208
      src/melindaCustomMergeFields.js on lines 325..337
      src/melindaCustomMergeFields.js on lines 1112..1124
      src/melindaCustomMergeFields.js on lines 2037..2049
      src/melindaCustomMergeFields.js on lines 2816..2828
      src/melindaCustomMergeFields.js on lines 4622..4634
      src/melindaCustomMergeFields.js on lines 4653..4665
      src/melindaCustomMergeFields.js on lines 5117..5127

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

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

          {
            'tag': '035',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 8 other locations - About 3 hrs to fix
      src/melindaCustomMergeFields.js on lines 196..208
      src/melindaCustomMergeFields.js on lines 1112..1124
      src/melindaCustomMergeFields.js on lines 2037..2049
      src/melindaCustomMergeFields.js on lines 2816..2828
      src/melindaCustomMergeFields.js on lines 4622..4634
      src/melindaCustomMergeFields.js on lines 4653..4665
      src/melindaCustomMergeFields.js on lines 5014..5026
      src/melindaCustomMergeFields.js on lines 5117..5127

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

      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