fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

File ClientApi.ts has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import deprecate from 'util-deprecate';
import dedent from 'ts-dedent';
import global from 'global';
import { logger } from '@storybook/client-logger';
import {
Severity: Minor
Found in lib/client-api/src/ClientApi.ts - About 4 hrs to fix

    File Search.tsx has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { useStorybookApi } from '@storybook/api';
    import { styled } from '@storybook/theming';
    import { Icons } from '@storybook/components';
    import Downshift, { DownshiftState, StateChangeOptions } from 'downshift';
    import Fuse, { FuseOptions } from 'fuse.js';
    Severity: Minor
    Found in lib/ui/src/components/sidebar/Search.tsx - About 4 hrs to fix

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

      const ejectMapper = ({ state }: Combo) => {
        const { storyId, refId, refs } = state;
        const ref = refs[refId];
      
        return {
      Severity: Major
      Found in lib/ui/src/components/preview/tools/eject.tsx and 1 other location - About 3 hrs to fix
      lib/ui/src/components/preview/tools/copy.tsx on lines 10..20

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

      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 copyMapper = ({ state }: Combo) => {
        const { storyId, refId, refs } = state;
        const ref = refs[refId];
      
        return {
      Severity: Major
      Found in lib/ui/src/components/preview/tools/copy.tsx and 1 other location - About 3 hrs to fix
      lib/ui/src/components/preview/tools/eject.tsx on lines 9..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 114.

      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 render has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const { children, bounds, options, theme, viewMode, docsOnly, panelCount } = this.props;
          const { isDragging, resizerNav, resizerPanel } = this.state;
      
          const margin = theme.layoutMargin;
      Severity: Minor
      Found in lib/ui/src/components/layout/container.tsx - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

        describe('with component with multiple selectors starting with attribute', () => {
          @Component({
            selector: 'doc-button[foo], doc-button2',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with attribute selector', () => {
          @Component({
            selector: 'doc-button[foo]',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with attribute only selector', () => {
          @Component({
            selector: '[foo]',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with void element and attribute selector', () => {
          @Component({
            selector: 'input[foo]',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with multiple selectors starting with attribute and value', () => {
          @Component({
            selector: 'doc-button[foo="bar"], doc-button2',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

      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

        describe('getSetStoriesPayload', () => {
          it('maps stories list to payload correctly', async () => {
            const store = new StoryStore();
            store.setProjectAnnotations(projectAnnotations);
            store.initialize({ storyIndex, importFn, cache: false });
      Severity: Major
      Found in lib/store/src/StoryStore.test.ts and 2 other locations - About 3 hrs to fix
      lib/store/src/StoryStore.test.ts on lines 595..718
      lib/store/src/StoryStore.test.ts on lines 913..946

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

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

        describe('with component with attribute and value selector', () => {
          @Component({
            selector: 'doc-button[foo="bar"]',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with class selector', () => {
          @Component({
            selector: 'doc-button.foo',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with attribute and value only selector', () => {
          @Component({
            selector: '[foo="bar"]',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with class only selector', () => {
          @Component({
            selector: '.foo',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

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

        describe('with component with multiple selectors', () => {
          @Component({
            selector: 'doc-button, doc-button2',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 208..222

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

      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

          describe('when angular.json have the target without "configurations" section', () => {
            beforeEach(() => {
              options = {
                angularBrowserTarget: 'no-confs-project:target-build:target-conf',
              } as PresetOptions;
      Severity: Major
      Found in app/angular/src/server/framework-preset-angular-cli.test.ts and 1 other location - About 3 hrs to fix
      app/angular/src/server/framework-preset-angular-cli.test.ts on lines 676..688

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

      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

          describe('in non-back-compat mode', () => {
            it('maps stories list to payload correctly', async () => {
              const store = new StoryStore();
              store.setProjectAnnotations(projectAnnotations);
              store.initialize({ storyIndex, importFn, cache: false });
      Severity: Major
      Found in lib/store/src/StoryStore.test.ts and 2 other locations - About 3 hrs to fix
      lib/store/src/StoryStore.test.ts on lines 595..718
      lib/store/src/StoryStore.test.ts on lines 720..848

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

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

        describe('with component with multiple selectors including 2 attributes and a class', () => {
          @Component({
            selector: 'doc-button, button[foo], .button[foo], button[baz]',
            template: '<button></button>',
          })
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 32..46
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 48..62
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 64..78
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 80..94
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 96..110
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 112..126
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 128..142
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 144..158
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 160..174
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 176..190
      app/angular/src/client/preview/angular-beta/ComputesTemplateFromComponent.test.ts on lines 192..206

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

      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

        describe('raw', () => {
          it('produces an array of stories', async () => {
            const store = new StoryStore();
            store.setProjectAnnotations(projectAnnotations);
            store.initialize({ storyIndex, importFn, cache: false });
      Severity: Major
      Found in lib/store/src/StoryStore.test.ts and 2 other locations - About 3 hrs to fix
      lib/store/src/StoryStore.test.ts on lines 720..848
      lib/store/src/StoryStore.test.ts on lines 913..946

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

      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