fbredius/storybook

View on GitHub
addons/docs/src/lib/jsdocParser.test.ts

Summary

Maintainability
F
6 days
Test Coverage

File jsdocParser.test.ts has 254 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { parseJsDoc } from './jsdocParser';

describe('parseJsDoc', () => {
  it('should set includesJsDoc to false when the value is null', () => {
    const { includesJsDoc, description, extractedTags } = parseJsDoc(null);
Severity: Minor
Found in addons/docs/src/lib/jsdocParser.test.ts - About 2 hrs to fix

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

        it('should support multiline @returns description', () => {
          const { extractedTags } = parseJsDoc(
            '@returns {string} - This is\na multiline\ndescription\n'
          );
    
    
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 4 hrs to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 240..247

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

    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('should return a @returns with a type and a description', () => {
          const { extractedTags } = parseJsDoc('@returns {string} - A bar description');
    
          expect(extractedTags.returns).not.toBeNull();
          expect(extractedTags.returns.type).not.toBeNull();
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 4 hrs to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 249..258

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

    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('should return a @returns with a type', () => {
          const { extractedTags } = parseJsDoc('@returns {string}');
    
          expect(extractedTags.returns).not.toBeNull();
          expect(extractedTags.returns.type).not.toBeNull();
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 3 hrs to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 260..266

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

    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('should only consider the last @returns tag when there is multiple', () => {
          const { extractedTags } = parseJsDoc('@returns {string}\n@returns {number}');
    
          expect(extractedTags.returns).not.toBeNull();
          expect(extractedTags.returns.type).not.toBeNull();
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 3 hrs to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 232..238

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

    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('should set ignore to true when @ignore is present', () => {
          const { ignore, description, extractedTags } = parseJsDoc('Hey!\n@ignore');
    
          expect(ignore).toBeTruthy();
          expect(description).toBeUndefined();
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 2 hrs to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 12..18

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

    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('should set includesJsDocto to false when the value dont contains JSDoc', () => {
        const { includesJsDoc, description, extractedTags } = parseJsDoc('Hey!');
    
        expect(includesJsDoc).toBeFalsy();
        expect(description).toBeUndefined();
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 2 hrs to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 33..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 82.

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

          it('should return @param name', () => {
            const { extractedTags } = parseJsDoc('@param {SyntheticEvent} event - React event');
    
            expect(extractedTags.params[0].getPrettyName()).toBe('event');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support nullable type', () => {
            const { extractedTags } = parseJsDoc('@param {?number} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('number');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should fix missing space between the @param name and the description separator', () => {
            const { extractedTags } = parseJsDoc('@param {SyntheticEvent} event- React event');
    
            expect(extractedTags.params[0].getPrettyName()).toBe('event');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support union type', () => {
            const { extractedTags } = parseJsDoc('@param {(number|boolean)} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('(number|boolean)');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support optional param with []', () => {
            const { extractedTags } = parseJsDoc('@param {number} [event]');
    
            expect(extractedTags.params[0].getTypeName()).toBe('number');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support record type with multiple fields', () => {
            const { extractedTags } = parseJsDoc('@param {{a: number, b: string}} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('({a: number, b: string})');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support optional param with =', () => {
            const { extractedTags } = parseJsDoc('@param {number=} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('number');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should fix @param name ending with . followed by a @returns tag', () => {
            const { extractedTags } = parseJsDoc('@param {SyntheticEvent} event.\n');
    
            expect(extractedTags.params[0].getPrettyName()).toBe('event');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215

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

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

          it('should support untyped array type', () => {
            const { extractedTags } = parseJsDoc('@param {[]} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('[]');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support any type', () => {
            const { extractedTags } = parseJsDoc('@param {*} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('any');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support record type with a single field', () => {
            const { extractedTags } = parseJsDoc('@param {{a: number}} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('({a: number})');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support non nullable type', () => {
            const { extractedTags } = parseJsDoc('@param {!number} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('number');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support record type with a field having only a name', () => {
            const { extractedTags } = parseJsDoc('@param {{a}} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('({a})');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

          it('should support array type', () => {
            const { extractedTags } = parseJsDoc('@param {number[]} event');
    
            expect(extractedTags.params[0].getTypeName()).toBe('number[]');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
    addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
    addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
    addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
    addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
    addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
    addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
    addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
    addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
    addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
    addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
    addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
    addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support array type', () => {
            const { extractedTags } = parseJsDoc('@returns {integer[]}');
    
            expect(extractedTags.returns.getTypeName()).toBe('integer[]');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support union type', () => {
            const { extractedTags } = parseJsDoc('@returns {(number|boolean)}');
    
            expect(extractedTags.returns.getTypeName()).toBe('(number|boolean)');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support record type with multiple fields', () => {
            const { extractedTags } = parseJsDoc('@returns {{a: number, b: string}}');
    
            expect(extractedTags.returns.getTypeName()).toBe('({a: number, b: string})');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support record type with a single field', () => {
            const { extractedTags } = parseJsDoc('@returns {{a: number}}');
    
            expect(extractedTags.returns.getTypeName()).toBe('({a: number})');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support untyped array type', () => {
            const { extractedTags } = parseJsDoc('@returns {[]}');
    
            expect(extractedTags.returns.getTypeName()).toBe('[]');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support record type with a field having only a name', () => {
            const { extractedTags } = parseJsDoc('@returns {{a}}');
    
            expect(extractedTags.returns.getTypeName()).toBe('({a})');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support named type', () => {
            const { extractedTags } = parseJsDoc('@returns {string}');
    
            expect(extractedTags.returns.getTypeName()).toBe('string');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support any type', () => {
            const { extractedTags } = parseJsDoc('@returns {*}');
    
            expect(extractedTags.returns.getTypeName()).toBe('any');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 317..321

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

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

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

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

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

    Refactorings

    Further Reading

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

          it('should support void', () => {
            const { extractedTags } = parseJsDoc('@returns {void}');
    
            expect(extractedTags.returns.getTypeName()).toBe('void');
          });
    Severity: Major
    Found in addons/docs/src/lib/jsdocParser.test.ts and 8 other locations - About 1 hr to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 269..273
    addons/docs/src/lib/jsdocParser.test.ts on lines 275..279
    addons/docs/src/lib/jsdocParser.test.ts on lines 281..285
    addons/docs/src/lib/jsdocParser.test.ts on lines 287..291
    addons/docs/src/lib/jsdocParser.test.ts on lines 293..297
    addons/docs/src/lib/jsdocParser.test.ts on lines 299..303
    addons/docs/src/lib/jsdocParser.test.ts on lines 305..309
    addons/docs/src/lib/jsdocParser.test.ts on lines 311..315

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

    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('should ignore invalid @returns', () => {
          const { extractedTags } = parseJsDoc('@returns');
    
          expect(extractedTags.returns).toBeNull();
        });
    Severity: Minor
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 40 mins to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 49..53

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

    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('should ignore invalid @param tags', () => {
          const { extractedTags } = parseJsDoc('@param');
    
          expect(extractedTags.params).toBeNull();
        });
    Severity: Minor
    Found in addons/docs/src/lib/jsdocParser.test.ts and 1 other location - About 40 mins to fix
    addons/docs/src/lib/jsdocParser.test.ts on lines 226..230

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

    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

    There are no issues that match your filters.

    Category
    Status