fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

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

    it('support shape', () => {
      const result = parse('shape({ foo: string })');
      const inferredType = result.inferredType as InspectionObject;

      expect(inferredType.type).toBe(InspectionType.OBJECT);
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 65..72
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 74..81
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 92..99
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 101..108
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 141..148
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 150..157
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 159..166

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

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

    it('support class', () => {
      const result = parse('class Foo {}');
      const inferredType = result.inferredType as InspectionFunction;

      expect(inferredType.type).toBe(InspectionType.CLASS);
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 15..22
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 24..31
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 42..49
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 168..175

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

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

    it('support React declaration', () => {
      const result = parse('<FunctionalComponent />');
      const inferredType = result.inferredType as InspectionElement;

      expect(inferredType.type).toBe(InspectionType.ELEMENT);
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 15..22
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 42..49
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 168..175
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 221..228

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

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

    it('support named functional React component', () => {
      const result = parse('function NamedFunctionalComponent() { return <div>Hey!</div>; }');
      const inferredType = result.inferredType as InspectionElement;

      expect(inferredType.type).toBe(InspectionType.ELEMENT);
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 15..22
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 24..31
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 168..175
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 221..228

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

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

    it('support object identifier', () => {
      const result = parse('NAMED_OBJECT');
      const inferredType = result.inferredType as InspectionIdentifier;

      expect(inferredType.type).toBe(InspectionType.IDENTIFIER);
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 15..22
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 24..31
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 42..49
addons/docs/src/frameworks/react/lib/inspection/acornParser.test.ts on lines 221..228

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

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

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

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

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

Refactorings

Further Reading

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

      it('should support array of primitive', () => {
        const component = createTestComponent({
          type: {
            name: 'arrayOf',
            value: {
addons/docs/src/frameworks/react/propTypes/handleProp.test.tsx on lines 551..565

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

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('when angular.json have projects without architect.build.options', () => {
    beforeEach(() => {
      initMockWorkspace('without-architect-build-options');
    });
    it('throws error', async () => {
Severity: Major
Found in app/angular/src/server/framework-preset-angular-cli.test.ts and 1 other location - About 3 hrs to fix
app/angular/src/server/framework-preset-angular-cli.test.ts on lines 381..392

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

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

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

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

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

Refactorings

Further Reading

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

      it('should support objectOf primitive', () => {
        const component = createTestComponent({
          type: {
            name: 'objectOf',
            value: {
addons/docs/src/frameworks/react/propTypes/handleProp.test.tsx on lines 757..771

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

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('when angular.json haven\'t "options.tsConfig" config', () => {
    beforeEach(() => {
      initMockWorkspace('without-tsConfig');
    });

Severity: Major
Found in app/angular/src/server/framework-preset-angular-cli.test.ts and 1 other location - About 3 hrs to fix
app/angular/src/server/framework-preset-angular-cli.test.ts on lines 151..161

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

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

export async function buildDevStandalone(options: CLIOptions & LoadOptions & BuilderOptions) {
  const { packageJson, versionUpdates, releaseNotes } = options;
  const { version, name = '' } = packageJson;

  // updateInfo and releaseNotesData are cached, so this is typically pretty fast
Severity: Major
Found in lib/core-server/src/build-dev.ts - About 3 hrs to fix

    Function transformer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function transformer(file, api, options) {
      const LITERAL = ['ts', 'tsx'].includes(options.parser) ? 'StringLiteral' : 'Literal';
    
      const j = api.jscodeshift;
      const root = j(file.source);
    Severity: Minor
    Found in lib/codemod/src/transforms/storiesof-to-csf.js - About 3 hrs 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 convert has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    export const convert = (type: PTType): SBType | any => {
      const { name, raw, computed, value } = type;
      const base: any = {};
      if (typeof raw !== 'undefined') base.raw = raw;
    
    
    Severity: Minor
    Found in addons/docs/src/lib/convert/proptypes/convert.ts - About 3 hrs 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

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

      describe('injectDecorator option is false - angular', () => {
        const mockFilePath = './__mocks__/inject-decorator.angular-stories.txt';
        const source = fs.readFileSync(mockFilePath, 'utf-8');
        const result = injectDecorator(source, path.resolve(__dirname, mockFilePath), {
          injectDecorator: false,
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 121..132
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 147..158
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 160..171

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe('injectDecorator option is false', () => {
        const mockFilePath = './__mocks__/inject-decorator.stories.txt';
        const source = fs.readFileSync(mockFilePath, 'utf-8');
        const result = injectDecorator(source, path.resolve(__dirname, mockFilePath), {
          injectDecorator: false,
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 134..145
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 147..158
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 160..171

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe('injectDecorator option is false - flow', () => {
        const mockFilePath = './__mocks__/inject-decorator.flow-stories.txt';
        const source = fs.readFileSync(mockFilePath, 'utf-8');
        const result = injectDecorator(source, path.resolve(__dirname, mockFilePath), {
          injectDecorator: false,
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 121..132
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 134..145
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 160..171

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe('injectDecorator option is false - ts', () => {
        const mockFilePath = './__mocks__/inject-decorator.ts.txt';
        const source = fs.readFileSync(mockFilePath, 'utf-8');
        const result = injectDecorator(source, path.resolve(__dirname, mockFilePath), {
          injectDecorator: false,
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 121..132
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 134..145
    lib/source-loader/src/abstract-syntax-tree/inject-decorator.test.js on lines 147..158

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 100.

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

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

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

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

    Refactorings

    Further Reading

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

            (s, c) => {
              const story = s({ ...c, k: 3, parameters: { p: 3 } });
              return {
                ...story,
                props: { a: [...story.props.a, c.k], p: [...story.props.p, c.parameters.p] },
    Severity: Major
    Found in app/angular/src/client/preview/decorateStory.test.ts and 2 other locations - About 3 hrs to fix
    app/angular/src/client/preview/decorateStory.test.ts on lines 316..322
    app/angular/src/client/preview/decorateStory.test.ts on lines 323..329

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

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

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

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

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

    Refactorings

    Further Reading

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

            (s, c) => {
              const story = s({ ...c, k: 2, parameters: { p: 2 } });
              return {
                ...story,
                props: { a: [...story.props.a, c.k], p: [...story.props.p, c.parameters.p] },
    Severity: Major
    Found in app/angular/src/client/preview/decorateStory.test.ts and 2 other locations - About 3 hrs to fix
    app/angular/src/client/preview/decorateStory.test.ts on lines 316..322
    app/angular/src/client/preview/decorateStory.test.ts on lines 330..336

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

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

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

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

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

    Refactorings

    Further Reading

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

            (s, c) => {
              const story = s({ ...c, k: 1, parameters: { p: 1 } });
              return {
                ...story,
                props: { a: [...story.props.a, c.k], p: [...story.props.p, c.parameters.p] },
    Severity: Major
    Found in app/angular/src/client/preview/decorateStory.test.ts and 2 other locations - About 3 hrs to fix
    app/angular/src/client/preview/decorateStory.test.ts on lines 323..329
    app/angular/src/client/preview/decorateStory.test.ts on lines 330..336

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

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

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

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

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

    Refactorings

    Further Reading

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

          it(`should support ${x}`, () => {
            const docgenInfo = createDocgenInfo({
              flowType: { name: x },
            });
    
    
    Severity: Major
    Found in addons/docs/src/lib/docgen/flow/createPropDef.test.ts and 1 other location - About 3 hrs to fix
    addons/docs/src/lib/docgen/flow/createPropDef.test.ts on lines 31..40

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

    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