fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

const makeContext = (name: string, parameters: any, args: any, extra?: object): StoryContext => ({
  id: `lit-test--${name}`,
  kind: 'js-text',
  name,
  parameters,
addons/docs/src/frameworks/html/sourceDecorator.test.ts on lines 16..25

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

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 {
    babelOptions,
    outputDir = path.join('.', 'public'),
    quiet,
    packageJson,
Severity: Major
Found in lib/builder-webpack4/src/preview/iframe-webpack.config.ts and 1 other location - About 2 hrs to fix
lib/builder-webpack5/src/preview/iframe-webpack.config.ts on lines 57..71

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

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('webpack5 dependency', () => {
      const packageJson = {
        dependencies: { '@storybook/react': '^7.0.0-alpha.0', webpack: '^5.0.0' },
      };
      it('should no-op', async () => {
Severity: Major
Found in lib/cli/src/automigrate/fixes/webpack5.test.ts and 1 other location - About 2 hrs to fix
lib/cli/src/automigrate/fixes/webpack5.test.ts on lines 22..32

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

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('installDependencies', () => {
    it('should run `yarn`', () => {
      const executeCommandSpy = jest.spyOn(yarn1Proxy, 'executeCommand').mockReturnValue('');

      yarn1Proxy.installDependencies();
Severity: Major
Found in lib/cli/src/js-package-manager/Yarn1Proxy.test.ts and 1 other location - About 2 hrs to fix
lib/cli/src/js-package-manager/Yarn2Proxy.test.ts on lines 24..32

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

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('installDependencies', () => {
    it('should run `yarn`', () => {
      const executeCommandSpy = jest.spyOn(yarn2Proxy, 'executeCommand').mockReturnValue('');

      yarn2Proxy.installDependencies();
Severity: Major
Found in lib/cli/src/js-package-manager/Yarn2Proxy.test.ts and 1 other location - About 2 hrs to fix
lib/cli/src/js-package-manager/Yarn1Proxy.test.ts on lines 24..32

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

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

  render() {
    const { data, rootName } = this.state;
    const {
      isCollapsed,
      onDeltaUpdate,
Severity: Major
Found in lib/components/src/controls/react-editable-json-tree/index.tsx - About 2 hrs to fix

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

      const resolve = {
        ...baseConfig.resolve,
        modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
        plugins: [
          new TsconfigPathsPlugin({
    Severity: Major
    Found in app/angular/src/server/angular-cli-webpack-12.2.x.js and 1 other location - About 2 hrs to fix
    app/angular/src/server/angular-cli-webpack-13.x.x.js on lines 71..80

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

    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

      const resolve = {
        ...baseConfig.resolve,
        modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
        plugins: [
          new TsconfigPathsPlugin({
    Severity: Major
    Found in app/angular/src/server/angular-cli-webpack-13.x.x.js and 1 other location - About 2 hrs to fix
    app/angular/src/server/angular-cli-webpack-12.2.x.js on lines 66..75

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

    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 (value instanceof Input) {
          const inputToAdd = {
            propName: propertyName,
            templateName: value.bindingPropertyName ?? propertyName,
          };
    app/angular/src/client/preview/angular-beta/utils/NgComponentAnalyzer.ts on lines 71..84

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

    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 down = useMemo(
        () => ({
          id: 'down',
          title: 'Next component',
          onClick: () => api.jumpToComponent(1),
    Severity: Major
    Found in lib/ui/src/containers/menu.tsx and 1 other location - About 2 hrs to fix
    lib/ui/src/containers/menu.tsx on lines 186..195

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

    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

        expect(mockPresetBarExtendWebpack).toHaveBeenCalledWith(expect.anything(), {
          bar: 'a',
          presetsList: expect.arrayContaining([
            expect.objectContaining({ name: 'preset-foo' }),
            expect.objectContaining({ name: 'preset-bar' }),
    Severity: Major
    Found in lib/core-common/src/presets.test.ts and 1 other location - About 2 hrs to fix
    lib/core-common/src/presets.test.ts on lines 244..251

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

    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 next = useMemo(
        () => ({
          id: 'next',
          title: 'Next story',
          onClick: () => api.jumpToStory(1),
    Severity: Major
    Found in lib/ui/src/containers/menu.tsx and 1 other location - About 2 hrs to fix
    lib/ui/src/containers/menu.tsx on lines 164..173

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

    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

        expect(mockPresetBarExtendBabel).toHaveBeenCalledWith(expect.anything(), {
          bar: 'a',
          presetsList: expect.arrayContaining([
            expect.objectContaining({ name: 'preset-foo' }),
            expect.objectContaining({ name: 'preset-bar' }),
    Severity: Major
    Found in lib/core-common/src/presets.test.ts and 1 other location - About 2 hrs to fix
    lib/core-common/src/presets.test.ts on lines 295..302

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

    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 (value instanceof Output) {
          const outputToAdd = {
            propName: propertyName,
            templateName: value.bindingPropertyName ?? propertyName,
          };
    app/angular/src/client/preview/angular-beta/utils/NgComponentAnalyzer.ts on lines 57..70

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

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

      static get styles() {
        return css`
          section {
            font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            font-size: 14px;
    Severity: Major
    Found in examples/web-components-kitchen-sink/src/components/sb-page.ts - About 2 hrs to fix

      Function buildWebpackConfigOptions has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const buildWebpackConfigOptions = async (
        dirToSearch: string,
        project: workspaces.ProjectDefinition,
        target: workspaces.TargetDefinition,
        confName?: string
      Severity: Major
      Found in app/angular/src/server/angular-devkit-build-webpack.ts - About 2 hrs to fix

        Function extractArgTypesFromData has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const extractArgTypesFromData = (componentData: Class | Directive | Injectable | Pipe) => {
          const sectionToItems: Record<string, ArgType[]> = {};
          const compodocClasses = ['component', 'directive'].includes(componentData.type)
            ? ['propertiesClass', 'methodsClass', 'inputsClass', 'outputsClass']
            : ['properties', 'methods'];
        Severity: Major
        Found in addons/docs/src/frameworks/angular/compodoc.ts - About 2 hrs to fix

          Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { name, value, editEnabled, keyPath, deep } = this.state;
              const {
                handleRemove,
                originalValue,
          Severity: Major
          Found in lib/components/src/controls/react-editable-json-tree/JsonNodes.tsx - About 2 hrs to fix

            Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render: () => {
                return (
                  <Consumer filter={canvasMapper}>
                    {({
                      story,
            Severity: Major
            Found in lib/ui/src/components/preview/preview.tsx - About 2 hrs to fix

              Function getDevCli has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export async function getDevCli(packageJson: {
                version: string;
                name: string;
              }): Promise<CommanderStatic & CLIOptions> {
                process.env.NODE_ENV = process.env.NODE_ENV || 'development';
              Severity: Major
              Found in lib/core-server/src/cli/dev.ts - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language