NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 830 of 830 total issues

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

    it('Finds the record valid (spec)', async () => {
      const validator = await validatorFactory(config);
      const {valid, message} = await validator.validate(recordValid);
      expect({valid, message}).to.eql({valid: true, message: []});
    });
Severity: Major
Found in src/field-exclusion.spec.js and 6 other locations - About 3 hrs to fix
src/field-exclusion.spec.js on lines 286..290
src/field-exclusion.spec.js on lines 504..508
src/field-exclusion.spec.js on lines 597..601
src/field-exclusion.spec.js on lines 714..718
src/field-exclusion.spec.js on lines 830..834
src/field-exclusion.spec.js on lines 836..840

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

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 recordValidMultipleMissingP = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '242',
Severity: Major
Found in src/ending-punctuation.spec.js and 1 other location - About 3 hrs to fix
src/ending-punctuation.spec.js on lines 261..276

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

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

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

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

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

Refactorings

Further Reading

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

export default function () {

  return {description, validate, fix};

  function fix(record) {
Severity: Major
Found in src/fix-language-codes.js - About 3 hrs to fix

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

    export default function () {
      const sf506 = [{code: 'a', value: /aineisto on käytettävissä vapaakappaletyöasemilla/ui}];
      const sf506old = [{code: 'a', value: /aineisto on käytettävissä vapaakappalekirjastoissa/ui}];
      const sf540 = [{code: 'c', value: /laki kulttuuriaineistojen tallettamisesta ja säilyttämisestä/ui}];
    
    
    Severity: Major
    Found in src/access-rights.js - About 3 hrs to fix

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

      export default function () {
      
        return {
          description, validate, fix
        };
      Severity: Major
      Found in src/addMissingField337.js - About 3 hrs to fix

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

              const recordInvalid657EngNo = new MarcRecord({
                leader: '',
                fields: [
                  {
                    tag: '657',
        Severity: Major
        Found in src/ending-punctuation.spec.js and 3 other locations - About 2 hrs to fix
        src/ending-punctuation.spec.js on lines 507..522
        src/ending-punctuation.spec.js on lines 575..590
        src/ending-punctuation.spec.js on lines 1935..1950

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

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

              const recordInvalidEndGDouble = new MarcRecord({
                leader: '',
                fields: [
                  {
                    tag: '260',
        Severity: Major
        Found in src/ending-punctuation.spec.js and 3 other locations - About 2 hrs to fix
        src/ending-punctuation.spec.js on lines 507..522
        src/ending-punctuation.spec.js on lines 1935..1950
        src/ending-punctuation.spec.js on lines 2105..2120

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

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

              const recordValidEndG = new MarcRecord({
                leader: '',
                fields: [
                  {
                    tag: '260',
        Severity: Major
        Found in src/ending-punctuation.spec.js and 3 other locations - About 2 hrs to fix
        src/ending-punctuation.spec.js on lines 575..590
        src/ending-punctuation.spec.js on lines 1935..1950
        src/ending-punctuation.spec.js on lines 2105..2120

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

        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 validateField(field, res) {
            const orig = fieldToString(field);
        
            const normalizedField = fix505(clone(field));
            const mod = fieldToString(normalizedField);
        Severity: Major
        Found in src/field-505-separators.js and 1 other location - About 2 hrs to fix
        src/field-521-fix.js on lines 40..50

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

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

              const recordValid657EngYes = new MarcRecord({
                leader: '',
                fields: [
                  {
                    tag: '657',
        Severity: Major
        Found in src/ending-punctuation.spec.js and 3 other locations - About 2 hrs to fix
        src/ending-punctuation.spec.js on lines 507..522
        src/ending-punctuation.spec.js on lines 575..590
        src/ending-punctuation.spec.js on lines 2105..2120

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

        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 validateField(field, res) {
            const orig = fieldToString(field);
        
            const normalizedField = fix521(clone(field));
            const mod = fieldToString(normalizedField);
        Severity: Major
        Found in src/field-521-fix.js and 1 other location - About 2 hrs to fix
        src/field-505-separators.js on lines 33..43

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

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

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

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

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

        Refactorings

        Further Reading

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

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

        Cognitive Complexity

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

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

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

        Further reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language