fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

      it('should support non nullable type', () => {
        const { extractedTags } = parseJsDoc('@param {!number} event');

        expect(extractedTags.params[0].getTypeName()).toBe('number');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support untyped array type', () => {
        const { extractedTags } = parseJsDoc('@param {[]} event');

        expect(extractedTags.params[0].getTypeName()).toBe('[]');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should return @param name', () => {
        const { extractedTags } = parseJsDoc('@param {SyntheticEvent} event - React event');

        expect(extractedTags.params[0].getPrettyName()).toBe('event');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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 Button = () => {
  const btn = document.createElement('button');
  btn.innerHTML = 'Hello Button';
  btn.addEventListener('click', action('Click'));
  return btn;
Severity: Major
Found in examples/html-kitchen-sink/stories/button.stories.js and 1 other location - About 1 hr to fix
lib/codemod/src/transforms/__testfixtures__/csf-to-mdx/story-function.input.js on lines 9..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 60.

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

  () => (
    <div>
      <Button label="The Button" onClick={action('onClick')} />
      <br />
      <p>
lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js on lines 13..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

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

      it('should fix missing space between the @param name and the description separator', () => {
        const { extractedTags } = parseJsDoc('@param {SyntheticEvent} event- React event');

        expect(extractedTags.params[0].getPrettyName()).toBe('event');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support record type with a field having only a name', () => {
        const { extractedTags } = parseJsDoc('@param {{a}} event');

        expect(extractedTags.params[0].getTypeName()).toBe('({a})');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support array type', () => {
        const { extractedTags } = parseJsDoc('@param {number[]} event');

        expect(extractedTags.params[0].getTypeName()).toBe('number[]');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support nullable type', () => {
        const { extractedTags } = parseJsDoc('@param {?number} event');

        expect(extractedTags.params[0].getTypeName()).toBe('number');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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 functionStory = () => {
  const btn = document.createElement('button');
  btn.innerHTML = 'Hello Button';
  btn.addEventListener('click', action('Click'));
  return btn;
examples/html-kitchen-sink/stories/button.stories.js on lines 15..20

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

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

      it('should fix @param name ending with . followed by a @returns tag', () => {
        const { extractedTags } = parseJsDoc('@param {SyntheticEvent} event.\n');

        expect(extractedTags.params[0].getPrettyName()).toBe('event');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215

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

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

  () => (
    <div>
      <Button label="The Button" onClick={action('onClick')} />
      <br />
      <p>
lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js on lines 104..112

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

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

      it('should support optional param with []', () => {
        const { extractedTags } = parseJsDoc('@param {number} [event]');

        expect(extractedTags.params[0].getTypeName()).toBe('number');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support record type with multiple fields', () => {
        const { extractedTags } = parseJsDoc('@param {{a: number, b: string}} event');

        expect(extractedTags.params[0].getTypeName()).toBe('({a: number, b: string})');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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 ImportedPropsButton = ({ disabled, label, onClick }) => (
  <button type="button" disabled={disabled} onClick={onClick}>
    {label}
  </button>
);
examples/official-storybook/components/DocgenButton.js on lines 29..33

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

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

      it('should support optional param with =', () => {
        const { extractedTags } = parseJsDoc('@param {number=} event');

        expect(extractedTags.params[0].getTypeName()).toBe('number');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support record type with a single field', () => {
        const { extractedTags } = parseJsDoc('@param {{a: number}} event');

        expect(extractedTags.params[0].getTypeName()).toBe('({a: number})');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support union type', () => {
        const { extractedTags } = parseJsDoc('@param {(number|boolean)} event');

        expect(extractedTags.params[0].getTypeName()).toBe('(number|boolean)');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 197..201
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

      it('should support any type', () => {
        const { extractedTags } = parseJsDoc('@param {*} event');

        expect(extractedTags.params[0].getTypeName()).toBe('any');
      });
Severity: Major
Found in addons/docs/src/lib/jsdocParser.test.ts and 13 other locations - About 1 hr to fix
addons/docs/src/lib/jsdocParser.test.ts on lines 137..141
addons/docs/src/lib/jsdocParser.test.ts on lines 143..147
addons/docs/src/lib/jsdocParser.test.ts on lines 149..153
addons/docs/src/lib/jsdocParser.test.ts on lines 155..159
addons/docs/src/lib/jsdocParser.test.ts on lines 161..165
addons/docs/src/lib/jsdocParser.test.ts on lines 167..171
addons/docs/src/lib/jsdocParser.test.ts on lines 173..177
addons/docs/src/lib/jsdocParser.test.ts on lines 179..183
addons/docs/src/lib/jsdocParser.test.ts on lines 185..189
addons/docs/src/lib/jsdocParser.test.ts on lines 191..195
addons/docs/src/lib/jsdocParser.test.ts on lines 205..209
addons/docs/src/lib/jsdocParser.test.ts on lines 211..215
addons/docs/src/lib/jsdocParser.test.ts on lines 217..221

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

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

  addons.add(PANEL_ID, {
    title: '',
    type: types.TOOL,
    match: ({ viewMode }) => viewMode === 'story',
    render: () => <VisionSimulator />,
Severity: Major
Found in addons/a11y/src/register.tsx and 1 other location - About 1 hr to fix
addons/viewport/src/register.tsx on lines 9..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 60.

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