fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

          expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
            expect.objectContaining({
              forceRemount: true,
              storyContext: expect.objectContaining({
                id: 'component-one--a',
Severity: Major
Found in lib/preview-web/src/PreviewWeb.test.ts and 4 other locations - About 1 hr to fix
lib/preview-web/src/PreviewWeb.test.ts on lines 1102..1111
lib/preview-web/src/PreviewWeb.test.ts on lines 1535..1544
lib/preview-web/src/PreviewWeb.test.ts on lines 1617..1626
lib/preview-web/src/PreviewWeb.test.ts on lines 1648..1657

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

export const StartInjectedReady = () => (
  <Ref
    {...refs.startInjected_ready}
    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 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 10 locations. Consider refactoring.
Open

export const VersionsMissingCurrent = () => (
  <Ref
    {...refs.versionsMissingCurrent}
    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 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 5 locations. Consider refactoring.
Open

          expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
            expect.objectContaining({
              forceRemount: true,
              storyContext: expect.objectContaining({
                id: 'component-one--a',
Severity: Major
Found in lib/preview-web/src/PreviewWeb.test.ts and 4 other locations - About 1 hr to fix
lib/preview-web/src/PreviewWeb.test.ts on lines 1102..1111
lib/preview-web/src/PreviewWeb.test.ts on lines 1535..1544
lib/preview-web/src/PreviewWeb.test.ts on lines 1592..1601
lib/preview-web/src/PreviewWeb.test.ts on lines 1617..1626

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

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

export const Errored = () => (
  <Ref
    {...refs.error}
    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 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 5 locations. Consider refactoring.
Open

      expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
        expect.objectContaining({
          forceRemount: true,
          storyContext: expect.objectContaining({
            id: 'component-one--a',
Severity: Major
Found in lib/preview-web/src/PreviewWeb.test.ts and 4 other locations - About 1 hr to fix
lib/preview-web/src/PreviewWeb.test.ts on lines 1535..1544
lib/preview-web/src/PreviewWeb.test.ts on lines 1592..1601
lib/preview-web/src/PreviewWeb.test.ts on lines 1617..1626
lib/preview-web/src/PreviewWeb.test.ts on lines 1648..1657

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

    borderBottomColor: match(
      'bottom',
      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 70..77
lib/components/src/tooltip/Tooltip.tsx on lines 78..85

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

export const Auth = () => (
  <Ref
    {...refs.auth}
    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 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 5 locations. Consider refactoring.
Open

          expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
            expect.objectContaining({
              forceRemount: true,
              storyContext: expect.objectContaining({
                id: 'component-one--b',
Severity: Major
Found in lib/preview-web/src/PreviewWeb.test.ts and 4 other locations - About 1 hr to fix
lib/preview-web/src/PreviewWeb.test.ts on lines 1102..1111
lib/preview-web/src/PreviewWeb.test.ts on lines 1535..1544
lib/preview-web/src/PreviewWeb.test.ts on lines 1592..1601
lib/preview-web/src/PreviewWeb.test.ts on lines 1648..1657

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

    borderTopColor: match(
      'top',
      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 62..69
lib/components/src/tooltip/Tooltip.tsx on lines 70..77
lib/components/src/tooltip/Tooltip.tsx on lines 78..85

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

    borderLeftColor: match(
      'left',
      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 78..85

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 Optimized = () => (
  <Ref
    {...refs.optimized}
    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 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
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

Severity
Category
Status
Source
Language