xylabs/sdk-react

View on GitHub
packages/flexbox/src/components/FlexRow.stories.tsx

Summary

Maintainability
B
5 hrs
Test Coverage

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

const testColumns = {
  border: 'solid 1px gray',
  children: (
    <>
      <FlexCol margin={1} padding={1} bgcolor="gray">
Severity: Major
Found in packages/flexbox/src/components/FlexRow.stories.tsx and 1 other location - About 4 hrs to fix
packages/flexbox/src/components/FlexCol.stories.tsx on lines 16..31

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

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

const StorybookEntry = {
  argTypes: {},
  component: FlexRow,
  parameters: { docs: { page: null } },
  title: 'flexbox/FlexRow',
Severity: Major
Found in packages/flexbox/src/components/FlexRow.stories.tsx and 35 other locations - About 55 mins to fix
packages/appbar/src/AppBar/Application.stories.tsx on lines 10..15
packages/appbar/src/AppBarEx.stories.tsx on lines 9..14
packages/appbar/src/SiteMenu/MenuListItem/MenuListItemContainer.stories.tsx on lines 10..15
packages/appbar/src/Toolbar/Context/ContextToolbar.stories.tsx on lines 7..12
packages/base-page/src/components/BasePage/BasePage.stories.tsx on lines 7..12
packages/button/src/components/ButtonEx.stories.tsx on lines 8..13
packages/common/src/components/Breadcrumbs/BreadcrumbsEx.stories.tsx on lines 7..12
packages/cookie-consent/src/components/CookieConsent.stories.tsx on lines 49..54
packages/crypto/src/components/EthAccount/EthAccountBox.stories.tsx on lines 10..15
packages/crypto/src/components/EthAccount/EthAccountButton.stories.tsx on lines 8..13
packages/crypto/src/components/TokenAmount/TokenAmount.stories.tsx on lines 19..24
packages/crypto/src/wallets/third-party/Coinbase/Coinbase.stories.tsx on lines 12..17
packages/crypto/src/wallets/third-party/MetaMask/MetaMask.stories.tsx on lines 12..17
packages/crypto/src/wallets/third-party/Phantom/Phantom.stories.tsx on lines 12..17
packages/crypto/src/wallets/third-party/Trust/Trust.stories.tsx on lines 12..17
packages/dialogs/src/ErrorDialog.stories.tsx on lines 7..12
packages/dialogs/src/MessageDialog.stories.tsx on lines 6..11
packages/error/src/components/Errors/ErrorViewer.stories.tsx on lines 6..11
packages/error/src/components/Errors/ErrorsViewer.stories.tsx on lines 7..12
packages/error/src/contexts/ErrorReporter/Provider.stories.tsx on lines 9..14
packages/experiments/src/components/Experiments.stories.tsx on lines 7..12
packages/experiments/src/components/ExperimentsDebugger.stories.tsx on lines 6..11
packages/experiments/src/hooks/useExperiments.stories.tsx on lines 42..47
packages/flexbox/src/components/BusyBox/BusyBox.stories.tsx on lines 7..12
packages/flexbox/src/components/FlexCol.stories.tsx on lines 7..12
packages/hooks/src/useResetState.stories.tsx on lines 66..71
packages/invertible-theme/src/InvertibleMuiThemeProvider/InvertibleMuiThemeProvider.stories.tsx on lines 12..17
packages/invertible-theme/src/InvertibleThemeProvider.stories.tsx on lines 9..14
packages/link/src/LinkEx.stories.tsx on lines 8..13
packages/number-status/src/NumberStatus.stories.tsx on lines 7..12
packages/pixel-debugger/src/components/PixelDebugger.stories.tsx on lines 10..15
packages/quick-tip-button/src/QuickTipButton.stories.tsx on lines 9..14
packages/shared/src/hooks/useLocalStorage.stories.tsx on lines 43..48
packages/webapp/src/components/Chrome.stories.tsx on lines 13..18
packages/webapp/src/components/NotFoundPage/Page.stories.tsx on lines 5..10

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

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