fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

Function decorators has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ((StoryFn, c) => {
      const locationProp = parsePath('/?path=/story/story--id');

      const location = {
        pathname: locationProp.pathname || '/',
Severity: Minor
Found in lib/ui/src/components/preview/preview.stories.tsx - About 1 hr to fix

    Function inferControl has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const inferControl = (argType: StrictInputType, name: string, matchers: ControlsMatchers): any => {
      const { type, options } = argType;
      if (!type && !options) {
        return undefined;
      }
    Severity: Minor
    Found in lib/store/src/inferControls.ts - About 1 hr to fix

      Function copyComponents has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function copyComponents(framework: SupportedFrameworks, language: SupportedLanguage) {
        const languageFolderMapping: Record<SupportedLanguage, string> = {
          javascript: 'js',
          typescript: 'ts',
        };
      Severity: Minor
      Found in lib/cli/src/helpers.ts - About 1 hr to fix

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

            '2-22': {
              id: '2-22',
              depth: 1,
              name: 'Child B2',
              isLeaf: true,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 175..187
        lib/ui/src/components/sidebar/mockdata.ts on lines 188..200
        lib/ui/src/components/sidebar/mockdata.ts on lines 201..213
        lib/ui/src/components/sidebar/mockdata.ts on lines 224..236

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

        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

        if (storybookUrl != null) {
          initStoryshots({
            suite: 'Puppeteer tests',
            storyKindRegex: /^Addons\/Storyshots/,
            framework: 'react',
        examples/official-storybook/storyshots-puppeteer/axe-tests.runner.js on lines 11..19

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

        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

            '3-32-322': {
              isRoot: false,
              isLeaf: true,
              prepared: true,
              isComponent: false,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 16..28
        lib/ui/src/components/sidebar/mockdata.ts on lines 29..41
        lib/ui/src/components/sidebar/mockdata.ts on lines 106..118
        lib/ui/src/components/sidebar/mockdata.ts on lines 129..141

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

        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

            '2-22': {
              isRoot: false,
              isLeaf: true,
              prepared: true,
              isComponent: false,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 16..28
        lib/ui/src/components/sidebar/mockdata.ts on lines 106..118
        lib/ui/src/components/sidebar/mockdata.ts on lines 129..141
        lib/ui/src/components/sidebar/mockdata.ts on lines 142..154

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

        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 const Story3 = () => (
          <Horizontal>
            <pre>START</pre>
            <pre>middle</pre>
            <pre>END</pre>
        Severity: Major
        Found in examples/official-storybook/stories/core/scroll.stories.js and 1 other location - About 1 hr to fix
        examples/official-storybook/stories/core/scroll.stories.js on lines 49..55

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

        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

            '1-12-121': {
              id: '1-12-121',
              depth: 2,
              name: 'GrandChild A1.1',
              isLeaf: true,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 175..187
        lib/ui/src/components/sidebar/mockdata.ts on lines 201..213
        lib/ui/src/components/sidebar/mockdata.ts on lines 224..236
        lib/ui/src/components/sidebar/mockdata.ts on lines 237..249

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

        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 const Story4 = () => (
          <Horizontal>
            <pre>START</pre>
            <pre>middle</pre>
            <pre>END</pre>
        Severity: Major
        Found in examples/official-storybook/stories/core/scroll.stories.js and 1 other location - About 1 hr to fix
        examples/official-storybook/stories/core/scroll.stories.js on lines 40..46

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

        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

            '3-32-321': {
              isRoot: false,
              isLeaf: true,
              prepared: true,
              isComponent: false,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 16..28
        lib/ui/src/components/sidebar/mockdata.ts on lines 29..41
        lib/ui/src/components/sidebar/mockdata.ts on lines 106..118
        lib/ui/src/components/sidebar/mockdata.ts on lines 142..154

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

        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

        if (storybookUrl != null) {
          initStoryshots({
            suite: 'Puppeteer tests',
            storyKindRegex: /^Basics|UI/,
            framework: 'react',
        examples/official-storybook/storyshots-puppeteer/puppeteer-tests.runner.js on lines 11..19

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

        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

            '3-31': {
              isRoot: false,
              isLeaf: true,
              prepared: true,
              isComponent: false,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 16..28
        lib/ui/src/components/sidebar/mockdata.ts on lines 29..41
        lib/ui/src/components/sidebar/mockdata.ts on lines 129..141
        lib/ui/src/components/sidebar/mockdata.ts on lines 142..154

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

        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

            '1-12-122': {
              id: '1-12-122',
              depth: 2,
              name: 'GrandChild A1.2',
              isLeaf: true,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 175..187
        lib/ui/src/components/sidebar/mockdata.ts on lines 188..200
        lib/ui/src/components/sidebar/mockdata.ts on lines 224..236
        lib/ui/src/components/sidebar/mockdata.ts on lines 237..249

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

        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

            '1-11': {
              id: '1-11',
              depth: 1,
              name: 'Child A1',
              isLeaf: true,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 188..200
        lib/ui/src/components/sidebar/mockdata.ts on lines 201..213
        lib/ui/src/components/sidebar/mockdata.ts on lines 224..236
        lib/ui/src/components/sidebar/mockdata.ts on lines 237..249

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

        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

            '2-21': {
              id: '2-21',
              depth: 1,
              name: 'Child B1',
              isLeaf: true,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 175..187
        lib/ui/src/components/sidebar/mockdata.ts on lines 188..200
        lib/ui/src/components/sidebar/mockdata.ts on lines 201..213
        lib/ui/src/components/sidebar/mockdata.ts on lines 237..249

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

        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

            '2-21': {
              isRoot: false,
              isLeaf: true,
              prepared: true,
              isComponent: false,
        Severity: Major
        Found in lib/ui/src/components/sidebar/mockdata.ts and 4 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/mockdata.ts on lines 29..41
        lib/ui/src/components/sidebar/mockdata.ts on lines 106..118
        lib/ui/src/components/sidebar/mockdata.ts on lines 129..141
        lib/ui/src/components/sidebar/mockdata.ts on lines 142..154

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

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

          const templateInputs =
            initialInputs.length > 0 ? ` ${initialInputs.map((i) => `[${i}]="${i}"`).join(' ')}` : '';
        app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.ts on lines 54..57
        app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.ts on lines 130..133

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

        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 firstStory = prepareStory(
                { id, name, args: { a: 1 }, parameters: { passArgsFirst: true } },
                { id, title },
                { render: renderMock }
              );
        Severity: Major
        Found in lib/store/src/csf/prepareStory.test.ts and 1 other location - About 1 hr to fix
        lib/store/src/csf/prepareStory.test.ts on lines 439..443

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

        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

            api.addLoader = (loader: LoaderFunction<TFramework>) => {
              if (hasAdded) throw new Error(`You cannot add a loader after the first story for a kind.`);
        
              meta.loaders.push(loader);
              return api;
        Severity: Major
        Found in lib/client-api/src/ClientApi.ts and 1 other location - About 1 hr to fix
        lib/client-api/src/ClientApi.ts on lines 374..381

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

        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