fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

              {section.ungrouped.map((row) => (
                <ArgRow key={row.key} row={row} arg={args && args[row.key]} {...common} />
              ))}
Severity: Major
Found in lib/components/src/blocks/ArgsTable/ArgsTable.tsx and 1 other location - About 1 hr to fix
lib/components/src/blocks/ArgsTable/ArgsTable.tsx on lines 464..466

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

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('adds "./" to a hidden folder', () => {
    const filename = path.join('.storybook', 'Comp.story.js');
    expect(normalizeStoryPath(filename)).toEqual(`.${path.sep}${filename}`);
  });
Severity: Major
Found in lib/core-common/src/utils/__tests__/paths.test.ts and 1 other location - About 1 hr to fix
lib/core-common/src/utils/__tests__/paths.test.ts on lines 25..28

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

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 sourceDecorator has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const sourceDecorator = (storyFn: any, context: StoryContext<VueFramework>) => {
  const story = storyFn();

  // See ../react/jsxDecorator.tsx
  if (skipSourceRender(context)) {
Severity: Minor
Found in addons/docs/src/frameworks/vue/sourceDecorator.ts - About 1 hr to fix

    Function extractJsDocTags has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function extractJsDocTags(ast: doctrine.Annotation): ExtractedJsDoc {
      const extractedTags: ExtractedJsDoc = {
        params: null,
        returns: null,
        ignore: false,
    Severity: Minor
    Found in addons/docs/src/lib/jsdocParser.ts - About 1 hr to fix

      Function loadFromPath has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function loadFromPath(babelConfigPath: string): TransformOptions {
        let config: TransformOptions;
        const error: {
          js?: Error;
          json?: Error;
      Severity: Minor
      Found in lib/core-common/src/utils/load-custom-babel-config.ts - About 1 hr to fix

        Function validateOptions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const validateOptions = (args: Args, argTypes: ArgTypes): Args => {
          return Object.entries(argTypes).reduce((acc, [key, { options }]) => {
            if (!options) {
              if (key in args) {
                acc[key] = args[key];
        Severity: Minor
        Found in lib/store/src/args.ts - About 1 hr to fix

          Function useStoriesJson has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function useStoriesJson(
            router: Router,
            serverChannel: ServerChannel,
            options: Options,
            workingDir: string = process.cwd()
          Severity: Minor
          Found in lib/core-server/src/utils/stories-json.ts - About 1 hr to fix

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

                dev: createTask({
                  name: `Run build in watch mode ${chalk.gray('(dev)')}`,
                  defaultValue: false,
                  option: '--dev',
                  command: () => {
            Severity: Major
            Found in scripts/bootstrap.js and 2 other locations - About 1 hr to fix
            scripts/bootstrap.js on lines 113..121
            scripts/bootstrap.js on lines 122..130

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

            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

                    <tr>
                      <td style={{ textAlign: 'right' }}>engine</td>
                      <td style={{ textAlign: 'right' }}>
                        engine to be used for processing templates. Handlebars is the default.
                      </td>
            Severity: Major
            Found in lib/components/src/typography/DocumentWrapper.stories.tsx and 3 other locations - About 1 hr to fix
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 141..144
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 147..152
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 159..162

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

            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

                    <tr>
                      <td style={{ textAlign: 'right' }}>data</td>
                      <td style={{ textAlign: 'right' }}>
                        path to data files to supply the data that will be passed into templates.
                      </td>
            Severity: Major
            Found in lib/components/src/typography/DocumentWrapper.stories.tsx and 3 other locations - About 1 hr to fix
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 141..144
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 153..158
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 159..162

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

            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

                registry: createTask({
                  name: `Run local registry ${chalk.gray('(reg)')}`,
                  defaultValue: false,
                  option: '--reg',
                  command: () => {
            Severity: Major
            Found in scripts/bootstrap.js and 2 other locations - About 1 hr to fix
            scripts/bootstrap.js on lines 113..121
            scripts/bootstrap.js on lines 131..139

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

            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

            interface Meta {
              ref?: ComposedRef;
              source?: string;
              sourceType?: 'local' | 'external';
              sourceLocation?: string;
            Severity: Major
            Found in lib/api/src/lib/events.ts and 1 other location - About 1 hr to fix
            lib/api/src/modules/stories.ts on lines 85..93

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

            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

                    <tr>
                      <td style={{ textAlign: 'right' }}>ext</td>
                      <td style={{ textAlign: 'right' }}>extension to be used for dest files.</td>
                    </tr>
            Severity: Major
            Found in lib/components/src/typography/DocumentWrapper.stories.tsx and 3 other locations - About 1 hr to fix
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 141..144
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 147..152
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 153..158

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

            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

                    <tr>
                      <th style={{ textAlign: 'right' }}>Option</th>
                      <th style={{ textAlign: 'right' }}>Description</th>
                    </tr>
            Severity: Major
            Found in lib/components/src/typography/DocumentWrapper.stories.tsx and 3 other locations - About 1 hr to fix
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 147..152
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 153..158
            lib/components/src/typography/DocumentWrapper.stories.tsx on lines 159..162

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

            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

            interface Meta {
              ref?: ComposedRef;
              source?: string;
              sourceType?: 'local' | 'external';
              sourceLocation?: string;
            Severity: Major
            Found in lib/api/src/modules/stories.ts and 1 other location - About 1 hr to fix
            lib/api/src/lib/events.ts on lines 6..14

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

            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

                manager: createTask({
                  name: `Generate prebuilt manager UI ${chalk.gray('(manager)')}`,
                  defaultValue: false,
                  option: '--manager',
                  command: () => {
            Severity: Major
            Found in scripts/bootstrap.js and 2 other locations - About 1 hr to fix
            scripts/bootstrap.js on lines 122..130
            scripts/bootstrap.js on lines 131..139

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

            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 Blockquote = styled.blockquote(withReset, withMargin, ({ theme }) => ({
              borderLeft: `4px solid ${theme.color.medium}`,
              padding: '0 15px',
              color: theme.color.dark,
              '& > :first-of-type': {
            Severity: Major
            Found in lib/components/src/typography/elements/Blockquote.tsx and 1 other location - About 1 hr to fix
            lib/components/src/typography/DocumentWrapper.tsx on lines 164..176

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

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

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

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

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

            Refactorings

            Further Reading

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

                if (!global.FEATURES?.modernInlineRender) {
                  this.channel.on(Events.UPDATE_GLOBALS, render);
                  this.channel.on(Events.UPDATE_STORY_ARGS, render);
                  this.channel.on(Events.RESET_STORY_ARGS, render);
                }
            Severity: Major
            Found in lib/preview-web/src/PreviewWeb.tsx and 1 other location - About 1 hr to fix
            lib/preview-web/src/PreviewWeb.tsx on lines 548..552

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

            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

              blockquote: {
                borderLeft: `4px solid ${theme.color.medium}`,
                padding: '0 15px',
                color: theme.color.dark,
            
            
            Severity: Major
            Found in lib/components/src/typography/DocumentWrapper.tsx and 1 other location - About 1 hr to fix
            lib/components/src/typography/elements/Blockquote.tsx on lines 4..14

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

            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

            function parseObject(objectNode: estree.ObjectExpression): ParsingResult<InspectionObject> {
              return {
                inferredType: { type: InspectionType.OBJECT, depth: calculateNodeDepth(objectNode) },
                ast: objectNode,
              };
            addons/docs/src/frameworks/react/lib/inspection/acornParser.ts on lines 60..68

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

            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