fbredius/storybook

View on GitHub
addons/docs/src/lib/convert/convert.test.ts

Summary

Maintainability
F
5 days
Test Coverage

File convert.test.ts has 792 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import 'jest-specific-snapshot';
import mapValues from 'lodash/mapValues';
import { transformSync } from '@babel/core';
import requireFromString from 'require-from-string';
import fs from 'fs';
Severity: Major
Found in addons/docs/src/lib/convert/convert.test.ts - About 1 day to fix

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

    const transformToModule = (inputCode: string) => {
      const options = {
        presets: [
          [
            '@babel/preset-env',
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 1 other location - About 1 hr to fix
    addons/docs/src/frameworks/react/react-properties.test.ts on lines 21..36

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

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

        it('interfaces', () => {
          const input = readFixture('typescript/interfaces.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('records', () => {
          const input = readFixture('typescript/records.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('unions', () => {
          const input = readFixture('typescript/unions.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('misc', () => {
          const input = readFixture('proptypes/misc.js');
          expect(input).toMatchInlineSnapshot(`
            "import React from 'react';
            import PropTypes from 'prop-types';
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('enums', () => {
          const input = readFixture('proptypes/enums.js');
          expect(input).toMatchInlineSnapshot(`
            "import React from 'react';
            import PropTypes from 'prop-types';
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('functions', () => {
          const input = readFixture('typescript/functions.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('aliases', () => {
          const input = readFixture('typescript/aliases.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('scalars', () => {
          const input = readFixture('proptypes/scalars.js');
          expect(input).toMatchInlineSnapshot(`
            "import React from 'react';
            import PropTypes from 'prop-types';
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('arrays', () => {
          const input = readFixture('proptypes/arrays.js');
          expect(input).toMatchInlineSnapshot(`
            "import React from 'react';
            import PropTypes from 'prop-types';
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('intersections', () => {
          const input = readFixture('typescript/intersections.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('objects', () => {
          const input = readFixture('proptypes/objects.js');
          expect(input).toMatchInlineSnapshot(`
            "import React from 'react';
            import PropTypes from 'prop-types';
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('enums', () => {
          const input = readFixture('typescript/enums.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('react', () => {
          const input = readFixture('proptypes/react.js');
          expect(input).toMatchInlineSnapshot(`
            "import React from 'react';
            import PropTypes from 'prop-types';
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743

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

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

        it('tuples', () => {
          const input = readFixture('typescript/tuples.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('arrays', () => {
          const input = readFixture('typescript/arrays.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 17..60
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

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

        it('scalars', () => {
          const input = readFixture('typescript/functions.tsx');
          expect(input).toMatchInlineSnapshot(`
            "import React, { FC } from 'react';
    
    
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 15 other locations - About 1 hr to fix
    addons/docs/src/lib/convert/convert.test.ts on lines 61..104
    addons/docs/src/lib/convert/convert.test.ts on lines 105..149
    addons/docs/src/lib/convert/convert.test.ts on lines 150..221
    addons/docs/src/lib/convert/convert.test.ts on lines 222..279
    addons/docs/src/lib/convert/convert.test.ts on lines 280..353
    addons/docs/src/lib/convert/convert.test.ts on lines 354..386
    addons/docs/src/lib/convert/convert.test.ts on lines 387..417
    addons/docs/src/lib/convert/convert.test.ts on lines 418..475
    addons/docs/src/lib/convert/convert.test.ts on lines 476..506
    addons/docs/src/lib/convert/convert.test.ts on lines 509..544
    addons/docs/src/lib/convert/convert.test.ts on lines 545..587
    addons/docs/src/lib/convert/convert.test.ts on lines 588..638
    addons/docs/src/lib/convert/convert.test.ts on lines 639..686
    addons/docs/src/lib/convert/convert.test.ts on lines 687..743
    addons/docs/src/lib/convert/convert.test.ts on lines 744..778

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

    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

    expect.addSnapshotSerializer({
      print: (val: any) => JSON.stringify(val, null, 2),
      test: (val) => typeof val !== 'string',
    });
    Severity: Major
    Found in addons/docs/src/lib/convert/convert.test.ts and 2 other locations - About 45 mins to fix
    addons/docs/src/frameworks/common/enhanceArgTypes.test.ts on lines 5..8
    lib/core-common/src/utils/__tests__/normalize-stories.test.ts on lines 5..8

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

    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

    There are no issues that match your filters.

    Category
    Status