fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

Function transformer has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function transformer(file, api) {
  const j = api.jscodeshift;
  const root = j(file.source);

  const renameKey = (exp) =>
Severity: Major
Found in lib/codemod/src/transforms/csf-hoist-story-annotations.js - About 2 hrs to fix

    Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        return html`
          <article>
            <sb-header .user="${this.user}"> </sb-header>
            <section>
    Severity: Major
    Found in examples/web-components-kitchen-sink/src/components/sb-page.ts - About 2 hrs to fix

      Function convert has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const convert = (type: PTType): SBType | any => {
        const { name, raw, computed, value } = type;
        const base: any = {};
        if (typeof raw !== 'undefined') base.raw = raw;
      
      
      Severity: Major
      Found in addons/docs/src/lib/convert/proptypes/convert.ts - About 2 hrs to fix

        File SearchResults.tsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { styled } from '@storybook/theming';
        import { Icons } from '@storybook/components';
        import global from 'global';
        import React, {
          FunctionComponent,
        Severity: Minor
        Found in lib/ui/src/components/sidebar/SearchResults.tsx - About 2 hrs to fix

          Function getDerivedStateFromProps has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static getDerivedStateFromProps(props: LayoutProps, state: LayoutState) {
              const { bounds, options } = props;
              const { resizerPanel, resizerNav } = state;
          
              const isNavHidden = options.isFullscreen || !options.showNav;
          Severity: Major
          Found in lib/ui/src/components/layout/container.tsx - About 2 hrs to fix

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/angular/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/html/src/client/preview/index.ts on lines 23..27
            app/preact/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue/src/client/preview/index.ts on lines 25..29
            app/vue3/src/client/preview/index.ts on lines 27..31
            app/web-components/src/client/preview/index.ts on lines 23..27

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/react/src/client/preview/index.tsx and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/html/src/client/preview/index.ts on lines 23..27
            app/preact/src/client/preview/index.ts on lines 23..27
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue/src/client/preview/index.ts on lines 25..29
            app/vue3/src/client/preview/index.ts on lines 27..31
            app/web-components/src/client/preview/index.ts on lines 23..27

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

            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

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

            export const clearManagerCache = async (cacheKey: string, options: Options) => {
              if (options.cache && options.cache.fileExists(cacheKey)) {
                await options.cache.remove(cacheKey);
                return true;
              }
            Severity: Major
            Found in lib/manager-webpack5/src/utils/manager-cache.ts and 1 other location - About 2 hrs to fix
            lib/manager-webpack4/src/utils/manager-cache.ts on lines 54..60

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

            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

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

            export const clearManagerCache = async (cacheKey: string, options: Options) => {
              if (options.cache && options.cache.fileExists(cacheKey)) {
                await options.cache.remove(cacheKey);
                return true;
              }
            Severity: Major
            Found in lib/manager-webpack4/src/utils/manager-cache.ts and 1 other location - About 2 hrs to fix
            lib/manager-webpack5/src/utils/manager-cache.ts on lines 54..60

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/server/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/html/src/client/preview/index.ts on lines 23..27
            app/preact/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/vue/src/client/preview/index.ts on lines 25..29
            app/vue3/src/client/preview/index.ts on lines 27..31
            app/web-components/src/client/preview/index.ts on lines 23..27

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/html/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/preact/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue/src/client/preview/index.ts on lines 25..29
            app/vue3/src/client/preview/index.ts on lines 27..31
            app/web-components/src/client/preview/index.ts on lines 23..27

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/preact/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/html/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue/src/client/preview/index.ts on lines 25..29
            app/vue3/src/client/preview/index.ts on lines 27..31
            app/web-components/src/client/preview/index.ts on lines 23..27

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/web-components/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/html/src/client/preview/index.ts on lines 23..27
            app/preact/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue/src/client/preview/index.ts on lines 25..29
            app/vue3/src/client/preview/index.ts on lines 27..31

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/vue/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/html/src/client/preview/index.ts on lines 23..27
            app/preact/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue3/src/client/preview/index.ts on lines 27..31
            app/web-components/src/client/preview/index.ts on lines 23..27

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

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

            export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
              return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
                framework,
              });
            };
            Severity: Major
            Found in app/vue3/src/client/preview/index.ts and 7 other locations - About 2 hrs to fix
            app/angular/src/client/preview/index.ts on lines 24..28
            app/html/src/client/preview/index.ts on lines 23..27
            app/preact/src/client/preview/index.ts on lines 23..27
            app/react/src/client/preview/index.tsx on lines 22..26
            app/server/src/client/preview/index.ts on lines 21..25
            app/vue/src/client/preview/index.ts on lines 25..29
            app/web-components/src/client/preview/index.ts on lines 23..27

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

            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

                    expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
                      expect.objectContaining({
                        forceRemount: false,
                        storyContext: expect.objectContaining({
                          loaded: { l: 7 },
            Severity: Major
            Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 2 hrs to fix
            lib/preview-web/src/PreviewWeb.test.ts on lines 874..883

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

            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

                <IconButton
                  key="zoomin"
                  onClick={(e: MouseEvent<HTMLButtonElement>) => {
                    e.preventDefault();
                    zoom(0.8);
            Severity: Major
            Found in lib/components/src/blocks/Toolbar.tsx and 1 other location - About 2 hrs to fix
            lib/components/src/blocks/Toolbar.tsx on lines 42..51

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

            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

                    expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
                      expect.objectContaining({
                        forceRemount: false,
                        storyContext: expect.objectContaining({
                          loaded: { l: 7 },
            Severity: Major
            Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 2 hrs to fix
            lib/preview-web/src/PreviewWeb.test.ts on lines 841..850

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

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

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

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

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

            Refactorings

            Further Reading

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

                it('should return the instance type when type is instanceOf', () => {
                  const component = createTestComponent({
                    type: {
                      name: 'instanceOf',
                      value: 'Set',
            addons/docs/src/frameworks/react/propTypes/handleProp.test.tsx on lines 129..140

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

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

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

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

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

            Refactorings

            Further Reading

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

                    it('should not have a deep object as summary', () => {
                      const component = createTestComponent({
                        type: {
                          name: 'custom',
                          raw: '{\n  foo: { bar: PropTypes.string.isRequired,\n  }}',
            addons/docs/src/frameworks/react/propTypes/handleProp.test.tsx on lines 537..548

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

            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