XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

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

const PointsMapRenderer: React.FC<PointsMapInnerProps> = (props) => {
  return (
    <MapBoxInstanceProvider>
      <PointsMapInner {...props} />
    </MapBoxInstanceProvider>
packages/plugins/packages/location-point-map/src/components/PointMapRenderer.tsx on lines 81..87
packages/sdk/packages/appbar/src/components/MobileSystemControls/SystemControls.tsx on lines 7..13
packages/sdk/packages/node-renderer/src/components/module/graph/GraphFlexBox.tsx on lines 78..84

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

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

const SystemControls: React.FC<SystemControlsUnstyledProps> = (props) => {
  return (
    <FlexCol>
      <SystemControlsRoot {...props} />
    </FlexCol>
packages/plugins/packages/location-point-map/src/components/PointMapRenderer.tsx on lines 81..87
packages/plugins/packages/location-points-map/src/components/PointsMapRenderer.tsx on lines 69..75
packages/sdk/packages/node-renderer/src/components/module/graph/GraphFlexBox.tsx on lines 78..84

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

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

export const ModuleGraphFlexBoxWithProvider: React.FC<ModuleGraphFlexBoxProps> = (props) => {
  return (
    <CytoscapeInstanceProvider>
      <ModuleGraphFlexBox {...props} />
    </CytoscapeInstanceProvider>
packages/plugins/packages/location-point-map/src/components/PointMapRenderer.tsx on lines 81..87
packages/plugins/packages/location-points-map/src/components/PointsMapRenderer.tsx on lines 69..75
packages/sdk/packages/appbar/src/components/MobileSystemControls/SystemControls.tsx on lines 7..13

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

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

export const parseModuleType = (mod?: ModuleInstance): CyNodeModuleTypes => {
  let type: CyNodeModuleTypes = 'module'
  if (mod) {
    if (isArchivistInstance(mod)) {
      type = 'archivist'
Severity: Minor
Found in packages/sdk/packages/node-renderer/src/Cytoscape/lib/parseModuleType.ts - About 55 mins 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 useDefaultPageState has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const useDefaultPageState = <TQueryParams extends PageStateKeys = PageStateKeys>(
  { queryParams }: DefaultPageStateParams<TQueryParams>,
): DefaultPageStateReturn<TQueryParams> => {
  const [searchParams, setSearchParams] = useSearchParams()

Severity: Minor
Found in packages/sdk/packages/advertising/src/utm/hooks/useDefaultPageState.ts - About 55 mins 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 BWActions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const BWActions: React.FC<BWActionsProps> = ({
  additionalActions,
  boundwitness,
  hideJSONButton,
  hideValidation,

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

export const useAccount = ({
  wallet, account, index, required = false,
}: AccountHookParams = {}): [
  AccountInstance | null | undefined,
  Error | undefined,
Severity: Minor
Found in packages/sdk/packages/wallet/src/hooks/useAccount.ts - About 55 mins 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 PointMapInner has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const PointMapInner: React.FC<PointMapInnerProps> = ({
  accessToken, payload, ...props
}) => {
  const theme = useTheme()
  const locationPayload = payload ? (payload as GeographicCoordinateSystemLocationPayload) : undefined

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

export const useWrapperAccount = (
  account?: AccountInstance | null,
): [AccountInstance | null | undefined, Error | undefined, UsePromiseState | undefined] => {
  return usePromise(async () => {
    return await globalWrapperWalletMutex.runExclusive(async () => {
Severity: Minor
Found in packages/sdk/packages/wallet/src/hooks/useWrapperAccount.ts - About 55 mins 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 getEtherchainV2Transformer has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const getEtherchainV2Transformer = (payload?: EthereumGasEtherchainV2Payload): GasPriceWitnessUIBasePayload | undefined => {
  if (payload) {
    return {
      gasPrice: [
        {

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

  ({
    titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false, ...props
  }, ref) => {
    const sizeValueHeight: Record<SizeProp, number> = {
      large: 48,
Severity: Minor
Found in packages/sdk/packages/property/src/components/Property.tsx - About 55 mins 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 FooterLink has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const FooterLink: React.FC<LinkExProps> = ({
  target, to, toOptions, href, margin = 0.5, variant = 'body2', ...props
}) => {
  if (href) {
    const url = new URL(assertEx(href, () => 'href not set'))
Severity: Minor
Found in packages/sdk/packages/footer/src/Link.tsx - About 55 mins 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 10 locations. Consider refactoring.
Open

  {
    $meta: {
      signatures: [
        '03830c7e9345a80390524543eb4ca097530bafa5d109b91a5a328399fcffe5af3a32b3a66658c045d013cf9b4fd598cafc9374bd0004d0c1bb2224ac812b855a',
      ],
Severity: Major
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 9 other locations - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 5..17
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 18..30
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 31..43
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 44..56
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 86..98
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 99..111
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 112..124
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 125..137
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 151..163

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

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

  {
    $meta: {
      signatures: [
        '79960dd5c590a1007bc526729a3ffee3153bb37ace383485ed298b3ba94939fffade54980a02c57119238bd9984d2860b822d29dbb36b04251fab83354b5a7cc',
      ],
Severity: Major
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 9 other locations - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 5..17
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 18..30
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 31..43
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 57..69
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 86..98
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 99..111
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 112..124
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 125..137
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 151..163

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

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

          <FlexGrowCol alignItems="flex-start">
            <Typography variant="h5">30</Typography>
            <Typography variant="body2">Connected Bridges</Typography>
          </FlexGrowCol>
Severity: Major
Found in packages/sdk/packages/os/src/components/Profile/Profile.tsx and 3 other locations - About 55 mins to fix
packages/sdk/packages/address/packages/history/src/components/BoundWitnessesBox/ActiveBoundWitness/NoBlockSelectedBox.tsx on lines 6..9
packages/sdk/packages/os/src/components/Profile/Profile.tsx on lines 41..44
packages/sdk/packages/os/src/components/Profile/Profile.tsx on lines 51..54

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

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

  {
    $meta: {
      signatures: [
        '03830c7e9345a80390524543eb4ca097530bafa5d109b91a5a328399fcffe5af3a32b3a66658c045d013cf9b4fd598cafc9374bd0004d0c1bb2224ac812b855a',
      ],
Severity: Major
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 9 other locations - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 5..17
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 18..30
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 31..43
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 44..56
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 57..69
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 86..98
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 99..111
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 112..124
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 125..137

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

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

  {
    $meta: {
      signatures: [
        '35c4aa262694cdf6c72f473e4e2a4b164b35a5f228a6ed1c8345b8a6b7b0d192d6868fc038a09258f2b7016d04157640d7555109102e3c072556f8c4c002543f',
      ],
Severity: Major
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 9 other locations - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 5..17
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 31..43
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 44..56
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 57..69
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 86..98
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 99..111
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 112..124
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 125..137
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 151..163

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

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

  {
    $meta: {
      signatures: [
        '2ddd7f65ad5ccdce83318f47040db7f45ef76142d2bb9c549241ac59619bf00a671f1ca5755d4e4b0e59fb8eb11c31e1d26c5d376eb57d8eeee7156469ae770b',
      ],
Severity: Minor
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 1 other location - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 138..150

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

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

  {
    $meta: {
      signatures: [
        'f273d8a8587ec2c6c9e91416eec66fdd441156f9ce2fb54e3e78e885aa792017e10ea36af44d9453422ffbafd58732a80387ab57c93ae0618b09aa4847f5e457',
      ],
Severity: Major
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 9 other locations - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 5..17
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 18..30
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 44..56
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 57..69
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 86..98
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 99..111
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 112..124
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 125..137
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 151..163

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

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

  {
    $meta: {
      signatures: [
        'f273d8a8587ec2c6c9e91416eec66fdd441156f9ce2fb54e3e78e885aa792017e10ea36af44d9453422ffbafd58732a80387ab57c93ae0618b09aa4847f5e457',
      ],
Severity: Major
Found in packages/sdk/packages/storybook/src/sampleAddressHistory.ts and 9 other locations - About 55 mins to fix
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 5..17
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 18..30
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 31..43
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 44..56
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 57..69
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 86..98
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 99..111
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 112..124
packages/sdk/packages/storybook/src/sampleAddressHistory.ts on lines 151..163

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

Severity
Category
Status
Source
Language