NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,132 of 1,132 total issues

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

    {
      'tag': '995',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '903',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '907',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '902',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '904',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '905',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '025',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4732..4741
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

    {
      'tag': '887',
      'repeatable': true,
      'fieldType': 'dataField',
      'indicators': {'ind1': ' ', 'ind2': ' '},
Severity: Major
Found in src/melindaCustomMergeFields.js and 18 other locations - About 1 hr to fix
src/melindaCustomMergeFields.js on lines 169..178
src/melindaCustomMergeFields.js on lines 2738..2747
src/melindaCustomMergeFields.js on lines 3991..4000
src/melindaCustomMergeFields.js on lines 4225..4234
src/melindaCustomMergeFields.js on lines 4768..4777
src/melindaCustomMergeFields.js on lines 4778..4787
src/melindaCustomMergeFields.js on lines 4788..4797
src/melindaCustomMergeFields.js on lines 4798..4807
src/melindaCustomMergeFields.js on lines 4808..4817
src/melindaCustomMergeFields.js on lines 4818..4827
src/melindaCustomMergeFields.js on lines 4828..4837
src/melindaCustomMergeFields.js on lines 4950..4957
src/melindaCustomMergeFields.js on lines 4958..4967
src/melindaCustomMergeFields.js on lines 5004..5013
src/melindaCustomMergeFields.js on lines 5053..5062
src/melindaCustomMergeFields.js on lines 5074..5083
src/melindaCustomMergeFields.js on lines 5107..5116
src/melindaCustomMergeFields.js on lines 5133..5140

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

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

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

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

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

Refactorings

Further Reading

Function validateField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function validateField(value, spec, tag) {
      const messagePrefix = tag ? `Field ${tag}` : 'Leader';

      if (typeof spec.length === 'number') {
        if (value.length !== spec.length) {
Severity: Minor
Found in src/fixed-fields.js - About 1 hr to fix

    Function default has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function () {
    
      return {
        description: 'Justify left and sort character groups within 008/18-24',
        validate, fix
    Severity: Minor
    Found in src/field-008-18-34-character-groups.js - About 1 hr to fix

      Function default has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function (tagPattern) {
        if (tagPattern instanceof RegExp) {
          return {
            description:
              'Handles data fields that only differ in the first indicator',
      Severity: Minor
      Found in src/duplicates-ind1.js - About 1 hr to fix

        Function getRelevantFields has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function getRelevantFields(record) {
            //return record.get(/^(?:020|022)$/u).filter(field => {
            return record.fields.filter(field => {
              if (!field.subfields) {
                return false;
        Severity: Minor
        Found in src/isbn-issn.js - About 1 hr to fix

          Function processCharacterGroup has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function processCharacterGroup(field, group) {
            const originalContent = field.value.substring(group.start, group.end + 1);
            const content = removeDuplicateValues(fixBlanks(originalContent));
            //console.info(`008/${group.start}-${group.end}: '${originalContent}'`); // eslint-disable-line no-console
            const charArray = content.split('');
          Severity: Minor
          Found in src/field-008-18-34-character-groups.js - About 1 hr to fix

            Function getIndicatorPreferredValues has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function getIndicatorPreferredValues(tag, indicatorNumber, config) {
                const cands = getIndicatorPreferredValuesForGivenTag(tag, indicatorNumber, config);
                // More complex systems where multiple indicators have same priority are objects.
                // Example: field 506 might return {"0": 1, "1": 1, " ": 2}
                // Here indicator values '0' and '1' share top priority 1, and '#' is of lesser importance, namely 2.
            Severity: Minor
            Found in src/merge-fields/mergeIndicator.js - About 1 hr to fix

              Function default has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function () {
              
                return {
                  description, validate, fix
                };
              Severity: Minor
              Found in src/merge-fields/index.js - About 1 hr to fix

                Function default has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function () {
                  const PATTERN = Object.keys(MAP_CONVERSION).reduce((result, key, index, list) => index === list.length - 1 ? new RegExp(`${result}${key})`, 'u') : `${result}${key}|`, '(');
                
                  return {
                    description: 'Unicode decomposer',
                Severity: Minor
                Found in src/unicode-decomposition.js - About 1 hr to fix

                  Function default has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function () {
                    return {
                      description: 'Handles subfields that contains non-breaking space character',
                      validate,
                      fix
                  Severity: Minor
                  Found in src/non-breaking-space.js - About 1 hr to fix

                    Function default has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function () {
                    
                      // NB! We should and could handle ISNIs here as well.
                      return {
                        description: 'Normalizes identifiers such as subfield $0 values',
                    Severity: Minor
                    Found in src/normalize-identifiers.js - About 1 hr to fix

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

                        function trimExtent(value) {
                          return value.replace(/\([^)]*\)/gu, '').replace(/\[[^\]*]\]/gu, '').replace(/[0-9]/gu, '').replace(/^ +/gu, '').replace(/[ :;+]+$/gu, '').replace(/  +/gu, ' ');
                        }
                      Severity: Major
                      Found in src/addMissingField338.js and 1 other location - About 1 hr to fix
                      src/normalize-utf8-diacritics.js on lines 80..88

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

                      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

                      function normalizeNonFilingIndicator2(field, languages = []) {
                        if (!hasNonFilingIndicator2(field) || !modifiableIndicatorValue(field.ind2)) {
                          return;
                        }
                      
                      
                      Severity: Major
                      Found in src/indicator-fixes.js and 1 other location - About 1 hr to fix
                      src/indicator-fixes.js on lines 131..137

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

                      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