fbredius/storybook

View on GitHub
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts

Summary

Maintainability
F
4 days
Test Coverage

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

  it('should return a signature with a single arg when there is a @param tag with a name and a type', () => {
    const { params, returns } = parseJsDoc('@param {SyntheticEvent} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: SyntheticEvent)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return a signature with a single arg when there is a @param tag with a name, a type and a desc', () => {
    const { params, returns } = parseJsDoc(
      '@param {SyntheticEvent} event - React event'
    ).extractedTags;
    const result = generateFuncSignature(params, returns);
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return a full signature when there is a multiple @param tags and a @returns', () => {
    const { params, returns } = parseJsDoc(
      '@param {SyntheticEvent} event - React event.\n@param {string} data\n@returns {string}'
    ).extractedTags;
    const result = generateFuncSignature(params, returns);
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @param with a nullable type', () => {
    const { params, returns } = parseJsDoc('@param {?number} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: number)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @param with a non nullable type', () => {
    const { params, returns } = parseJsDoc('@param {!number} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: number)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @param of array type', () => {
    const { params, returns } = parseJsDoc('@param {number[]} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: number[])');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return ( ... ) when there is @params', () => {
    const { params, returns } = parseJsDoc('@param event').extractedTags;
    const result = generateShortFuncSignature(params, returns);

    expect(result).toBe('( ... )');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return () => returnsType when there is only a @returns', () => {
    const { params, returns } = parseJsDoc('@returns {string}').extractedTags;
    const result = generateShortFuncSignature(params, returns);

    expect(result).toBe('() => string');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179

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

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

  it('should support @returns of record type', () => {
    const { params, returns } = parseJsDoc('@returns {{a: number, b: string}}').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('() => ({a: number, b: string})');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @param of record type', () => {
    const { params, returns } = parseJsDoc('@param {{a: number}} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: ({a: number}))');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @param of type any', () => {
    const { params, returns } = parseJsDoc('@param {*} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: any)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @returns of array type', () => {
    const { params, returns } = parseJsDoc('@returns {integer[]}').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('() => integer[]');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support optional @param with =', () => {
    const { params, returns } = parseJsDoc('@param {number=} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: number)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @returns type any', () => {
    const { params, returns } = parseJsDoc('@returns {*}').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('() => any');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return a full signature when there is a single @param tag and a @returns', () => {
    const { params, returns } = parseJsDoc(
      '@param {SyntheticEvent} event - React event.\n@returns {string}'
    ).extractedTags;
    const result = generateFuncSignature(params, returns);
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support multiple @param tags', () => {
    const { params, returns } = parseJsDoc(
      '@param {SyntheticEvent} event\n@param {string} customData'
    ).extractedTags;
    const result = generateFuncSignature(params, returns);
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return ( ... ) => returnsType when there is @params and a @returns', () => {
    const { params, returns } = parseJsDoc('@param event\n@returns {string}').extractedTags;
    const result = generateShortFuncSignature(params, returns);

    expect(result).toBe('( ... ) => string');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return a signature with a return type when there is a @returns with a type', () => {
    const { params, returns } = parseJsDoc('@returns {string}').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('() => string');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should return a signature with a single arg when there is a @param tag with a name', () => {
    const { params, returns } = parseJsDoc('@param event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @returns of type void', () => {
    const { params, returns } = parseJsDoc('@returns {void}').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('() => void');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @param of union type', () => {
    const { params, returns } = parseJsDoc('@param {(number|boolean)} event').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: (number|boolean))');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support optional @param with []', () => {
    const { params, returns } = parseJsDoc('@param {number} [event]').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('(event: number)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

  it('should support @returns of union type', () => {
    const { params, returns } = parseJsDoc('@returns {(number|boolean)}').extractedTags;
    const result = generateFuncSignature(params, returns);

    expect(result).toBe('() => (number|boolean)');
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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