fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

export const StartInjectedLoading = () => (
  <Ref
    {...refs.startInjected_loading}
    isLoading={false}
    isBrowsing
Severity: Major
Found in lib/ui/src/components/sidebar/Refs.stories.tsx and 9 other locations - About 1 hr to fix
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 119..128
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 129..138
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 139..148
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 159..168
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 169..178
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 179..188
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 189..198
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 199..208
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 209..218

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

export const Long = () => (
  <Ref
    {...refs.long}
    isLoading={false}
    isBrowsing
Severity: Major
Found in lib/ui/src/components/sidebar/Refs.stories.tsx and 9 other locations - About 1 hr to fix
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 119..128
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 129..138
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 139..148
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 149..158
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 159..168
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 169..178
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 179..188
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 189..198
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 199..208

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

    borderRightColor: match(
      'right',
      placement,
      theme.color[color] || color || theme.base === 'light'
        ? lighten(theme.background.app)
Severity: Major
Found in lib/components/src/tooltip/Tooltip.tsx and 3 other locations - About 1 hr to fix
lib/components/src/tooltip/Tooltip.tsx on lines 54..61
lib/components/src/tooltip/Tooltip.tsx on lines 62..69
lib/components/src/tooltip/Tooltip.tsx on lines 70..77

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

export const StartInjectedUnknown = () => (
  <Ref
    {...refs.startInjected_unknown}
    isLoading={false}
    isBrowsing
Severity: Major
Found in lib/ui/src/components/sidebar/Refs.stories.tsx and 9 other locations - About 1 hr to fix
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 119..128
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 129..138
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 149..158
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 159..168
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 169..178
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 179..188
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 189..198
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 199..208
lib/ui/src/components/sidebar/Refs.stories.tsx on lines 209..218

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

    const stateChangeHandlers = {
      [`${SHARED_STATE_CHANGED}-client-${stateId}`]: (s: S) => setState(s),
      [`${SHARED_STATE_SET}-client-${stateId}`]: (s: S) => setState(s),
    };
Severity: Major
Found in lib/api/src/index.tsx and 1 other location - About 1 hr to fix
lib/store/src/hooks.ts on lines 47..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 2 locations. Consider refactoring.
Open

    () => ({
      [`${SHARED_STATE_CHANGED}-manager-${sharedId}`]: (s: S) => setState(s),
      [`${SHARED_STATE_SET}-manager-${sharedId}`]: (s: S) => setState(s),
    }),
Severity: Major
Found in lib/store/src/hooks.ts and 1 other location - About 1 hr to fix
lib/api/src/index.tsx on lines 391..394

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

export function readPackageJson(): PackageJson | false {
  const packageJsonPath = path.resolve('package.json');
  if (!fs.existsSync(packageJsonPath)) {
    return false;
  }
Severity: Major
Found in lib/cli/src/js-package-manager/PackageJsonHelper.ts and 1 other location - About 1 hr to fix
lib/cli/src/helpers.ts on lines 14..22

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

export function getBowerJson() {
  const bowerJsonPath = path.resolve('bower.json');
  if (!fs.existsSync(bowerJsonPath)) {
    return false;
  }
Severity: Major
Found in lib/cli/src/helpers.ts and 1 other location - About 1 hr to fix
lib/cli/src/js-package-manager/PackageJsonHelper.ts on lines 5..13

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

Function withMeasure has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const withMeasure = (
  StoryFn: StoryFunction<AnyFramework>,
  context: StoryContext<AnyFramework>
) => {
  const { measureEnabled } = context.globals;
Severity: Minor
Found in addons/measure/src/withMeasure.ts - About 1 hr to fix

    Function functionResolver has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const functionResolver: TypeResolver = (rawDefaultProp, propDef) => {
      let isElement = false;
      let inspectionResult;
    
      // Try to display the name of the component. The body of the component is omitted since the code has been transpiled.

      Function getStoryIndex has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        getStoryIndex(store: StoryStore<TFramework>) {
          const fileNameOrder = Object.keys(this.csfExports);
          const storySortParameter = this.projectAnnotations.parameters?.options?.storySort;
      
          const storyEntries = Object.entries(this.stories);
      Severity: Minor
      Found in lib/client-api/src/StoryStoreFacade.ts - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language