NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

    {
      'tag': '362',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ['0', '1'], '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 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 2 locations. Consider refactoring.
Open

    it('Throws an error when config array has unidentified field', () => {
      const config = [
        {
          leader: /^035$/u,
          tags: /^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 74..87

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

  const ldf5061old = {
    tag: '506',
    ind1: '1',
    ind2: ' ',
    subfields: [
Severity: Major
Found in src/access-rights.spec.js and 1 other location - About 2 hrs to fix
src/access-rights.spec.js on lines 41..52

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

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

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

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

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

Refactorings

Further Reading

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

  const ldf5061new = {
    tag: '506',
    ind1: '1',
    ind2: ' ',
    subfields: [
Severity: Major
Found in src/access-rights.spec.js and 1 other location - About 2 hrs to fix
src/access-rights.spec.js on lines 28..39

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

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

  function fix(record) {
    getRelevantFields(record).forEach(field => {
      if (field.tag === '020') {
        field.subfields.forEach(subfield => fixField020Subfield(field, subfield));
        return;
Severity: Major
Found in src/isbn-issn.js - About 2 hrs to fix

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

          const record = new MarcRecord({
            fields: [
              {
                tag: '020',
                ind1: ' ',
    Severity: Major
    Found in src/isbn-issn.spec.js and 4 other locations - About 2 hrs to fix
    src/fields-present.spec.js on lines 33..48
    src/fields-present.spec.js on lines 56..71
    src/isbn-issn.spec.js on lines 273..288
    src/item-language.spec.js on lines 28..48

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

    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: '500',
                ind1: ' ',
    Severity: Major
    Found in src/fields-present.spec.js and 4 other locations - About 2 hrs to fix
    src/fields-present.spec.js on lines 56..71
    src/isbn-issn.spec.js on lines 139..154
    src/isbn-issn.spec.js on lines 273..288
    src/item-language.spec.js on lines 28..48

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

    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: '041',
                ind1: ' ',
    Severity: Major
    Found in src/item-language.spec.js and 4 other locations - About 2 hrs to fix
    src/fields-present.spec.js on lines 33..48
    src/fields-present.spec.js on lines 56..71
    src/isbn-issn.spec.js on lines 139..154
    src/isbn-issn.spec.js on lines 273..288

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

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

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

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

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

    Refactorings

    Further Reading

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

          const recordValidSimple = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '880',
    Severity: Major
    Found in src/ending-punctuation.spec.js and 1 other location - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 2481..2495

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

    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: '020',
                ind1: ' ',
    Severity: Major
    Found in src/fields-present.spec.js and 4 other locations - About 2 hrs to fix
    src/fields-present.spec.js on lines 33..48
    src/isbn-issn.spec.js on lines 139..154
    src/isbn-issn.spec.js on lines 273..288
    src/item-language.spec.js on lines 28..48

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

    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: '020',
                ind1: ' ',
    Severity: Major
    Found in src/isbn-issn.spec.js and 4 other locations - About 2 hrs to fix
    src/fields-present.spec.js on lines 33..48
    src/fields-present.spec.js on lines 56..71
    src/isbn-issn.spec.js on lines 139..154
    src/item-language.spec.js on lines 28..48

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

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

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

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

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

    Refactorings

    Further Reading

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

          const recordInvalidSimple = new MarcRecord({
            leader: '',
            fields: [
              {
                tag: '880',
    Severity: Major
    Found in src/ending-punctuation.spec.js and 1 other location - About 2 hrs to fix
    src/ending-punctuation.spec.js on lines 2435..2449

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

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

    function deriveIndividualDeletables(record) {
      const todoList = record.fields.map(f => fieldToString(f));
      //const finishedRecord = encodingLevelIsBetterThanPrepublication(getEncodingLevel(record));
    
      const deletableStringsArray = processTodoList(todoList);
    Severity: Major
    Found in src/removeInferiorDataFields.js - About 2 hrs to fix

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

          {
            'tag': '550',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 262..273
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 652..663
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2067..2078
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2129..2140
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2219..2230
      src/melindaCustomMergeFields.js on lines 4838..4849

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

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

          {
            'tag': '508',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 262..273
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 652..663
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2067..2078
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2219..2230
      src/melindaCustomMergeFields.js on lines 2593..2604
      src/melindaCustomMergeFields.js on lines 4838..4849

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

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

          {
            'tag': '032',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 652..663
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2067..2078
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2129..2140
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2219..2230
      src/melindaCustomMergeFields.js on lines 2593..2604
      src/melindaCustomMergeFields.js on lines 4838..4849

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

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

          {
            'tag': '504',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 262..273
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 652..663
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2129..2140
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2219..2230
      src/melindaCustomMergeFields.js on lines 2593..2604
      src/melindaCustomMergeFields.js on lines 4838..4849

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

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

          {
            'tag': '515',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 262..273
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 652..663
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2067..2078
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2129..2140
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2593..2604
      src/melindaCustomMergeFields.js on lines 4838..4849

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

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

          {
            'tag': '909',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 262..273
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 652..663
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2067..2078
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2129..2140
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2219..2230
      src/melindaCustomMergeFields.js on lines 2593..2604

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

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

          {
            'tag': '071',
            'repeatable': true,
            'fieldType': 'dataField',
            'indicators': {'ind1': ' ', 'ind2': ' '},
      Severity: Major
      Found in src/melindaCustomMergeFields.js and 15 other locations - About 2 hrs to fix
      src/melindaCustomMergeFields.js on lines 38..49
      src/melindaCustomMergeFields.js on lines 222..233
      src/melindaCustomMergeFields.js on lines 262..273
      src/melindaCustomMergeFields.js on lines 338..349
      src/melindaCustomMergeFields.js on lines 560..571
      src/melindaCustomMergeFields.js on lines 616..627
      src/melindaCustomMergeFields.js on lines 791..802
      src/melindaCustomMergeFields.js on lines 1190..1201
      src/melindaCustomMergeFields.js on lines 2067..2078
      src/melindaCustomMergeFields.js on lines 2117..2128
      src/melindaCustomMergeFields.js on lines 2129..2140
      src/melindaCustomMergeFields.js on lines 2183..2194
      src/melindaCustomMergeFields.js on lines 2219..2230
      src/melindaCustomMergeFields.js on lines 2593..2604
      src/melindaCustomMergeFields.js on lines 4838..4849

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

      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