fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

            <WithTooltip hasChrome={false} tooltip={<Note note="Go back" />}>
              <StyledIconButton containsIcon onClick={controls.back} disabled={!controlStates.back}>
                <Icons icon="playback" />
              </StyledIconButton>
            </WithTooltip>
Severity: Major
Found in addons/interactions/src/components/Subnav/Subnav.tsx and 3 other locations - About 2 hrs to fix
addons/interactions/src/components/Subnav/Subnav.tsx on lines 115..119
addons/interactions/src/components/Subnav/Subnav.tsx on lines 127..131
addons/interactions/src/components/Subnav/Subnav.tsx on lines 133..137

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

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

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

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

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

Refactorings

Further Reading

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

            <WithTooltip hasChrome={false} tooltip={<Note note="Go forward" />}>
              <StyledIconButton containsIcon onClick={controls.next} disabled={!controlStates.next}>
                <Icons icon="playnext" />
              </StyledIconButton>
            </WithTooltip>
Severity: Major
Found in addons/interactions/src/components/Subnav/Subnav.tsx and 3 other locations - About 2 hrs to fix
addons/interactions/src/components/Subnav/Subnav.tsx on lines 115..119
addons/interactions/src/components/Subnav/Subnav.tsx on lines 121..125
addons/interactions/src/components/Subnav/Subnav.tsx on lines 133..137

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

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

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

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

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

Refactorings

Further Reading

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

            <WithTooltip hasChrome={false} tooltip={<Note note="Go to start" />}>
              <RewindButton containsIcon onClick={controls.start} disabled={!controlStates.start}>
                <Icons icon="rewind" />
              </RewindButton>
            </WithTooltip>
Severity: Major
Found in addons/interactions/src/components/Subnav/Subnav.tsx and 3 other locations - About 2 hrs to fix
addons/interactions/src/components/Subnav/Subnav.tsx on lines 121..125
addons/interactions/src/components/Subnav/Subnav.tsx on lines 127..131
addons/interactions/src/components/Subnav/Subnav.tsx on lines 133..137

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

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

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

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

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

Refactorings

Further Reading

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

            <WithTooltip hasChrome={false} tooltip={<Note note="Go to end" />}>
              <StyledIconButton containsIcon onClick={controls.end} disabled={!controlStates.end}>
                <Icons icon="fastforward" />
              </StyledIconButton>
            </WithTooltip>
Severity: Major
Found in addons/interactions/src/components/Subnav/Subnav.tsx and 3 other locations - About 2 hrs to fix
addons/interactions/src/components/Subnav/Subnav.tsx on lines 115..119
addons/interactions/src/components/Subnav/Subnav.tsx on lines 121..125
addons/interactions/src/components/Subnav/Subnav.tsx on lines 127..131

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

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

      plugins: [
        getBabelOutputPlugin({
          presets: [
            [
              '@babel/preset-env',
Severity: Major
Found in scripts/bundle-package.ts and 1 other location - About 2 hrs to fix
scripts/bundle-package.ts on lines 92..108

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

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

storiesOf('Basics/Spaced', module)
  .add('row', () => (
    <div>
      <PlaceholderBlock color="silver" />
      <Spaced row={1}>
Severity: Major
Found in lib/components/src/spaced/Spaced.stories.tsx and 1 other location - About 2 hrs to fix
lib/components/src/spaced/Spaced.stories.tsx on lines 17..72

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

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

      plugins: [
        getBabelOutputPlugin({
          presets: [
            [
              '@babel/preset-env',
Severity: Major
Found in scripts/bundle-package.ts and 1 other location - About 2 hrs to fix
scripts/bundle-package.ts on lines 50..66

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

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

File ConfigFile.test.ts has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import dedent from 'ts-dedent';
import { formatConfig, loadConfig } from './ConfigFile';

expect.addSnapshotSerializer({
  print: (val: any) => val,
Severity: Minor
Found in lib/csf-tools/src/ConfigFile.test.ts - About 2 hrs to fix

    Function createDefaultWebpackConfig has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export async function createDefaultWebpackConfig(storybookBaseConfig: any, options: Options) {
      if (
        options.presetsList.some((preset) =>
          /@storybook(\/|\\)preset-create-react-app/.test(presetName(preset))
        )
    Severity: Major
    Found in lib/builder-webpack4/src/preview/base-webpack.config.ts - About 2 hrs to fix

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

        two: PropTypes.objectOf(
          PropTypes.shape({
            /**
             *  Just an internal propType for a shape.
             *  It's also required, and as you can see it supports multi-line comments!
      Severity: Major
      Found in examples/official-storybook/components/DocgenButton.js and 1 other location - About 2 hrs to fix
      examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/prop-types.js on lines 302..325

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

      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

        objectOfComplexShape: PropTypes.objectOf(
          PropTypes.shape({
            /**
             *  Just an internal propType for a shape.
             *  It's also required, and as you can see it supports multi-line comments!
      examples/official-storybook/components/DocgenButton.js on lines 83..106

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

      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 ReadDocsMessage: FunctionComponent = () => (
        <Message href="https://storybook.js.org" target="_blank">
          <GreenIcon icon="document" />
          <div>
            <MessageTitle>Read Composition docs</MessageTitle>
      Severity: Major
      Found in lib/ui/src/components/sidebar/RefIndicator.tsx and 1 other location - About 2 hrs to fix
      lib/ui/src/components/sidebar/RefIndicator.tsx on lines 308..316

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

      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 PerformanceDegradedMessage: FunctionComponent = () => (
        <Message href="https://storybook.js.org/docs" target="_blank">
          <YellowIcon icon="lightning" />
          <div>
            <MessageTitle>Reduce lag</MessageTitle>
      Severity: Major
      Found in lib/ui/src/components/sidebar/RefIndicator.tsx and 1 other location - About 2 hrs to fix
      lib/ui/src/components/sidebar/RefIndicator.tsx on lines 278..286

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

      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 object = {
        minus: {
          color: 'red',
        },
        plus: {
      lib/components/src/controls/react-editable-json-tree/utils/styles.ts on lines 23..43

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

      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 array = {
        minus: {
          color: 'red',
        },
        plus: {
      lib/components/src/controls/react-editable-json-tree/utils/styles.ts on lines 1..21

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

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

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

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

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

      Refactorings

      Further Reading

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

            it('should not have deep object in summary', () => {
              const component = createTestComponent({
                type: {
                  name: 'arrayOf',
                  value: {
      addons/docs/src/frameworks/react/propTypes/handleProp.test.tsx on lines 626..640

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

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

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

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

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

      Refactorings

      Further Reading

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

            it('should not have deep object in summary', () => {
              const component = createTestComponent({
                type: {
                  name: 'objectOf',
                  value: {
      addons/docs/src/frameworks/react/propTypes/handleProp.test.tsx on lines 834..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 88.

      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

      File Panel.tsx has 275 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { Fragment } from 'react';
      import { styled, themes, convert } from '@storybook/theming';
      import { ScrollArea, TabsState, Link, Placeholder } from '@storybook/components';
      import { SizeMe } from 'react-sizeme';
      import Result from './Result';
      Severity: Minor
      Found in addons/jest/src/components/Panel.tsx - About 2 hrs to fix

        Function createContent has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const createContent = (deployables) => {
          return `
            <style>
              body {
                background: black;
        Severity: Major
        Found in scripts/build-storybooks.js - About 2 hrs to fix

          Function testStorySnapshots has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function testStorySnapshots(options: StoryshotsOptions = {}) {
            if (typeof describe !== 'function') {
              throw new Error('testStorySnapshots is intended only to be used inside jest');
            }
          
          
          Severity: Major
          Found in addons/storyshots/storyshots-core/src/api/index.ts - About 2 hrs to fix
            Severity
            Category
            Status
            Source
            Language