fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

Function ngAfterViewInit has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ngAfterViewInit(): void {
      // Bind properties to component, if the story have component
      if (this.storyComponentElementRef) {
        const ngComponentInputsOutputs = getComponentInputsOutputs(storyComponent);

    Function navigateTree has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const navigateTree = throttle((event: KeyboardEvent) => {
          const highlightedItemId =
            highlightedRef.current?.refId === refId && highlightedRef.current?.itemId;
          if (!isBrowsing || !containerRef.current || !highlightedItemId || event.repeat) return;
          if (!matchesModifiers(false, event)) return;
    Severity: Minor
    Found in lib/ui/src/components/sidebar/useExpanded.ts - About 1 hr to fix

      Function generator has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const generator = async (
        packageManager: JsPackageManager,
        npmOptions: NpmOptions,
        installServer: boolean
      ): Promise<void> => {
      Severity: Minor
      Found in lib/cli/src/generators/REACT_NATIVE/index.ts - About 1 hr to fix

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

          public get classes(): string[] {
            return [this.appearance, this.size]
              .filter((_class) => !!_class)
              .map((_class) => `btn-${_class}`);
          }
        addons/docs/src/frameworks/angular/__testfixtures__/doc-button/input.ts on lines 131..135

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

        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

          public get classes(): string[] {
            return [this.appearance, this.size]
              .filter((_class) => !!_class)
              .map((_class) => `btn-${_class}`);
          }
        examples/angular-cli/src/stories/addons/docs/doc-button/doc-button.component.ts on lines 163..167

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

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

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

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

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

        Refactorings

        Further Reading

        Function webpack has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function webpack(config: Configuration): Configuration {
          return {
            ...config,
            plugins: [
              ...config.plugins,
        Severity: Minor
        Found in app/vue3/src/server/framework-preset-vue3.ts - About 1 hr to fix

          Function initiate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function initiate(options: CommandOptions, pkg: Package): Promise<void> {
            const welcomeMessage = 'sb init - the simplest way to add a Storybook to your project.';
            logger.log(chalk.inverse(`\n ${welcomeMessage} \n`));
          
            // Update notify code.
          Severity: Minor
          Found in lib/cli/src/initiate.ts - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  parent.type === 'Program' &&
                  callee.type === 'MemberExpression' &&
                  callee.object.type === 'Identifier' &&
                  callee.property.type === 'Identifier' &&
            Severity: Critical
            Found in lib/source-loader/src/abstract-syntax-tree/parse-helpers.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                  if (
                    t.isProgram(parent) &&
                    t.isMemberExpression(callee) &&
                    t.isIdentifier(callee.object) &&
                    t.isIdentifier(callee.property) &&
              Severity: Critical
              Found in lib/csf-tools/src/CsfFile.ts - About 1 hr to fix

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

                    it('scalars', () => {
                      const input = readFixture('proptypes/scalars.js');
                      expect(input).toMatchInlineSnapshot(`
                        "import React from 'react';
                        import PropTypes from 'prop-types';
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('functions', () => {
                      const input = readFixture('typescript/functions.tsx');
                      expect(input).toMatchInlineSnapshot(`
                        "import React, { FC } from 'react';
                
                
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('objects', () => {
                      const input = readFixture('proptypes/objects.js');
                      expect(input).toMatchInlineSnapshot(`
                        "import React from 'react';
                        import PropTypes from 'prop-types';
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('scalars', () => {
                      const input = readFixture('typescript/functions.tsx');
                      expect(input).toMatchInlineSnapshot(`
                        "import React, { FC } from 'react';
                
                
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('react', () => {
                      const input = readFixture('proptypes/react.js');
                      expect(input).toMatchInlineSnapshot(`
                        "import React from 'react';
                        import PropTypes from 'prop-types';
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743

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

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

                    it('aliases', () => {
                      const input = readFixture('typescript/aliases.tsx');
                      expect(input).toMatchInlineSnapshot(`
                        "import React, { FC } from 'react';
                
                
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('unions', () => {
                      const input = readFixture('typescript/unions.tsx');
                      expect(input).toMatchInlineSnapshot(`
                        "import React, { FC } from 'react';
                
                
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('enums', () => {
                      const input = readFixture('proptypes/enums.js');
                      expect(input).toMatchInlineSnapshot(`
                        "import React from 'react';
                        import PropTypes from 'prop-types';
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('records', () => {
                      const input = readFixture('typescript/records.tsx');
                      expect(input).toMatchInlineSnapshot(`
                        "import React, { FC } from 'react';
                
                
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('arrays', () => {
                      const input = readFixture('proptypes/arrays.js');
                      expect(input).toMatchInlineSnapshot(`
                        "import React from 'react';
                        import PropTypes from 'prop-types';
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 280..353
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

                    it('arrays', () => {
                      const input = readFixture('typescript/arrays.tsx');
                      expect(input).toMatchInlineSnapshot(`
                        "import React, { FC } from 'react';
                
                
                Severity: Major
                Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
                addons/docs/src/lib/convert/convert.test.ts on lines 17..60
                addons/docs/src/lib/convert/convert.test.ts on lines 61..104
                addons/docs/src/lib/convert/convert.test.ts on lines 105..149
                addons/docs/src/lib/convert/convert.test.ts on lines 150..221
                addons/docs/src/lib/convert/convert.test.ts on lines 222..279
                addons/docs/src/lib/convert/convert.test.ts on lines 354..386
                addons/docs/src/lib/convert/convert.test.ts on lines 387..417
                addons/docs/src/lib/convert/convert.test.ts on lines 418..475
                addons/docs/src/lib/convert/convert.test.ts on lines 476..506
                addons/docs/src/lib/convert/convert.test.ts on lines 509..544
                addons/docs/src/lib/convert/convert.test.ts on lines 545..587
                addons/docs/src/lib/convert/convert.test.ts on lines 588..638
                addons/docs/src/lib/convert/convert.test.ts on lines 639..686
                addons/docs/src/lib/convert/convert.test.ts on lines 687..743
                addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

                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