fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

export const InitialCanvas = ({ props }: { props: MobileProps }) => (
  <Mobile {...props} options={{ ...props.options, initialActive: ActiveTabs.CANVAS }} />
);
Severity: Major
Found in lib/ui/src/components/layout/mobile.stories.tsx and 2 other locations - About 1 hr to fix
lib/ui/src/components/layout/mobile.stories.tsx on lines 26..28
lib/ui/src/components/layout/mobile.stories.tsx on lines 32..34

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

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

        preview.onStoriesChanged({
          importFn: newImportFn,
          storyIndex: {
            v: 3,
            stories: {
Severity: Major
Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 1 hr to fix
lib/preview-web/src/PreviewWeb.test.ts on lines 329..343

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

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('builds addresses with a specified host', () => {
    const { address, networkAddress } = getServerAddresses(9009, '192.168.89.89', 'http');
    expect(address).toEqual('http://localhost:9009/');
    expect(networkAddress).toEqual('http://192.168.89.89:9009/');
  });
Severity: Major
Found in lib/core-server/src/utils/__tests__/server-address.test.ts and 1 other location - About 1 hr to fix
lib/core-server/src/utils/__tests__/server-address.test.ts on lines 18..22

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

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

export function stringifyObject(object: any, level = 0, excludeOuterParams = false): string {
  if (typeof object === 'string') {
    return JSON.stringify(object);
  }
  const indent = '  '.repeat(level);
Severity: Minor
Found in app/server/src/lib/compiler/stringifier.ts - About 1 hr 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

Function cleanup has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

async function cleanup() {
  // remove files after babel --copy-files output
  // --copy-files option doesn't work with --ignore
  // https://github.com/babel/babel/issues/6226
  if (await fs.pathExists(path.join(process.cwd(), 'dist'))) {
Severity: Minor
Found in scripts/prepare.js - About 1 hr 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

Function renderSelection has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  async renderSelection({ persistedArgs }: { persistedArgs?: Args } = {}) {
    const { selection } = this.urlStore;
    if (!selection) {
      throw new Error('Cannot render story as no selection was made');
    }
Severity: Minor
Found in lib/preview-web/src/PreviewWeb.tsx - About 1 hr 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

Function prepareStory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function prepareStory<TFramework extends AnyFramework>(
  storyAnnotations: NormalizedStoryAnnotations<TFramework>,
  componentAnnotations: NormalizedComponentAnnotations<TFramework>,
  projectAnnotations: NormalizedProjectAnnotations<TFramework>
): Story<TFramework> {
Severity: Minor
Found in lib/store/src/csf/prepareStory.ts - About 1 hr 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

Function buildDev has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export async function buildDev(loadOptions: LoadOptions) {
  const cliOptions = await getDevCli(loadOptions.packageJson);

  try {
    await buildDevStandalone({
Severity: Minor
Found in lib/core-server/src/build-dev.ts - About 1 hr 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

Function extractTypeName has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function extractTypeName(type: doctrine.Type): string {
  if (type.type === 'NameExpression') {
    return type.name;
  }

Severity: Minor
Found in addons/docs/src/lib/jsdocParser.ts - About 1 hr to fix

    Function createType has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function createType(extractedProp: ExtractedProp): PropType {
      const { type } = extractedProp.docgenInfo;
    
      // A type could be null if a defaultProp has been provided without a type definition.
      if (type == null) {
    Severity: Minor
    Found in addons/docs/src/frameworks/react/propTypes/createType.ts - About 1 hr to fix

      Function buildDev has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function buildDev(loadOptions: LoadOptions) {
        const cliOptions = await getDevCli(loadOptions.packageJson);
      
        try {
          await buildDevStandalone({
      Severity: Minor
      Found in lib/core-server/src/build-dev.ts - About 1 hr to fix

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

          it('should return a signature with a single arg when there is a @param tag with a name', () => {
            const { params, returns } = parseJsDoc('@param event').extractedTags;
            const result = generateFuncSignature(params, returns);
        
            expect(result).toBe('(event)');
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

          it('should support @param of union type', () => {
            const { params, returns } = parseJsDoc('@param {(number|boolean)} event').extractedTags;
            const result = generateFuncSignature(params, returns);
        
            expect(result).toBe('(event: (number|boolean))');
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

          it('should support @param with a non nullable type', () => {
            const { params, returns } = parseJsDoc('@param {!number} event').extractedTags;
            const result = generateFuncSignature(params, returns);
        
            expect(result).toBe('(event: number)');
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

          it('should return ( ... ) => returnsType when there is @params and a @returns', () => {
            const { params, returns } = parseJsDoc('@param event\n@returns {string}').extractedTags;
            const result = generateShortFuncSignature(params, returns);
        
            expect(result).toBe('( ... ) => string');
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

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

        export const IsEmpty = () => (
          <Ref
            {...refs.empty}
            isLoading={false}
            isBrowsing
        Severity: Major
        Found in lib/ui/src/components/sidebar/Refs.stories.tsx and 9 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 119..128
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 139..148
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 149..158
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 159..168
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 169..178
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 179..188
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 189..198
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 199..208
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 209..218

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

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

          it('should return () => returnsType when there is only a @returns', () => {
            const { params, returns } = parseJsDoc('@returns {string}').extractedTags;
            const result = generateShortFuncSignature(params, returns);
        
            expect(result).toBe('() => string');
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 127..132
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179

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

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

        export const Versions = () => (
          <Ref
            {...refs.versions}
            isLoading={false}
            isBrowsing
        Severity: Major
        Found in lib/ui/src/components/sidebar/Refs.stories.tsx and 9 other locations - About 1 hr to fix
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 119..128
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 129..138
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 139..148
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 149..158
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 159..168
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 179..188
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 189..198
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 199..208
        lib/ui/src/components/sidebar/Refs.stories.tsx on lines 209..218

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

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

                  expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith(
                    expect.objectContaining({
                      forceRemount: true,
                      storyContext: expect.objectContaining({
                        id: 'component-one--b',
        Severity: Major
        Found in lib/preview-web/src/PreviewWeb.test.ts and 4 other locations - About 1 hr to fix
        lib/preview-web/src/PreviewWeb.test.ts on lines 1102..1111
        lib/preview-web/src/PreviewWeb.test.ts on lines 1592..1601
        lib/preview-web/src/PreviewWeb.test.ts on lines 1617..1626
        lib/preview-web/src/PreviewWeb.test.ts on lines 1648..1657

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

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

          it('should support @returns type any', () => {
            const { params, returns } = parseJsDoc('@returns {*}').extractedTags;
            const result = generateFuncSignature(params, returns);
        
            expect(result).toBe('() => any');
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 11..16
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 18..23
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 25..32
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 34..39
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 41..46
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 48..53
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 55..60
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 62..67
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 69..74
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 76..81
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 83..88
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 90..97
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 99..104
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 106..111
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 113..118
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 120..125
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 134..139
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 141..148
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 150..157
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 167..172
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 174..179
        addons/docs/src/frameworks/react/propTypes/generateFuncSignature.test.ts on lines 181..186

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

        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