XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

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

  async xyoNewsletterSignup(fields: XyoNewsletterSignupFields | T) {
    await this.events.custom('XyoNewsletterSignup').send(fields as T)
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoEventHandler.ts and 8 other locations - About 50 mins to fix
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 86..88

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

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

  async xnsReservationAttempted(fields: XnsReservationAttemptedFields | T) {
    await this.events.custom('XnsReservationAttempted').send(fields as T)
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoEventHandler.ts and 8 other locations - About 50 mins to fix
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 90..92

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

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

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

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

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

Refactorings

Further Reading

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

  const [describe] = usePromise(async () => {
    const state = await mod?.state()
    return state?.find<ModuleDescriptionPayload>(isPayloadOfSchemaType(ModuleDescriptionSchema))
  }, [mod])
packages/modules/packages/node/src/hooks/useNodeDescription.ts on lines 11..14

Duplicated Code

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

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

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

Tuning

This issue has a mass of 51.

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

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

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

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

Refactorings

Further Reading

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

export interface ColorGradientLegendProps {
  endColor: string
  endLabel: string
  heading: string
  startColor: string
Severity: Minor
Found in packages/sdk/packages/map/src/Colors/MapColorProps.ts and 1 other location - About 50 mins to fix
packages/sdk/packages/shared/src/components/TokenData/TokenData.ts on lines 3..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 51.

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

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

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

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

Refactorings

Further Reading

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

export interface TokenData {
  coinmarketcapLink: string
  etherscanLink: string
  icon: string
  readableName: string
packages/sdk/packages/map/src/Colors/MapColorProps.ts on lines 10..17

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

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

  async xnsPurchaseFailure(fields: XnsPurchaseFailureFields | T) {
    await this.events.custom('XnsPurchaseFailure').send(fields as T)
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoEventHandler.ts and 8 other locations - About 50 mins to fix
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 90..92

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

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

  async xnsEstimateSuccess(fields: XnsEstimateSuccessFields | T) {
    await this.events.custom('XnsEstimateSuccess').send(fields as T)
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoEventHandler.ts and 8 other locations - About 50 mins to fix
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 90..92

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

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

  async xnsReservationFailure(fields: XnsReservationFailureFields | T) {
    await this.events.custom('XnsReservationFailure').send(fields as T)
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoEventHandler.ts and 8 other locations - About 50 mins to fix
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoEventHandler.ts on lines 90..92

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

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

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

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

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

Refactorings

Further Reading

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

  const [description, error] = usePromise(async () => {
    const state = await activeNode?.state()
    return state?.find<ModuleDescriptionPayload>(isPayloadOfSchemaType(ModuleDescriptionSchema))
  }, [activeNode])
Severity: Minor
Found in packages/modules/packages/node/src/hooks/useNodeDescription.ts and 1 other location - About 50 mins to fix
packages/sdk/packages/powered-by-xyo/src/components/ModuleDetails.tsx on lines 27..30

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

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

export const useTriggerFreshIndexedResult = (indexedResultsConfig?: IndexedResultsConfig, trigger?: boolean) => {
  const { processIndexedResults, refresh } = indexedResultsConfig ?? {}

  const freshResult = useCallback(async () => {
    if (refresh && trigger) {

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

export const UniswapPairsTableView: React.FC<UniswapPairsRendererProps> = ({ payload, ...props }) => {
  const [order, setOrder] = useState<Order>('asc')
  const [orderBy, setOrderBy] = useState<string>('symbol')
  const [page, setPage] = useState(0)
  const [rowsPerPage, setRowsPerPage] = useState(20)

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

export const ModuleHoverPopper: React.FC<ModuleHoverPopperProps> = ({
  anchorEl, onClose, onModuleDetails, onModuleExplore, node, ...props
}) => {
  const { address, name } = node?.data() ?? {}
  return (

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

        {
          price: {
            label: 'standard',
            value: payload.gasPrice?.standard,
          },
packages/plugins/packages/ethereum-gas/packages/eth-gas-station/src/components/hooks/getEthgasstationTransformer.tsx on lines 26..35
packages/plugins/packages/ethereum-gas/packages/eth-gas-station/src/components/hooks/getEthgasstationTransformer.tsx on lines 36..45

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

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

      detachedListener = mod.on('moduleDetached', async () => {
        const newElements = (await CytoscapeElements.buildElements(mod)) ?? []
        setElements(newElements)
      })
packages/sdk/packages/node-renderer/src/hooks/cytoscape/elements/useCytoscapeElements.ts on lines 30..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

Function ConnectedWalletState has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const ConnectedWalletState: React.FC<ConnectedWalletTableCellProps> = ({
  connected, walletRdns, tableCellProps,
}) => {
  const {
    disableWallet, enableWallet, wallets,

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

        {
          price: {
            label: 'instant',
            value: payload.gasPrice?.instant,
          },
packages/plugins/packages/ethereum-gas/packages/eth-gas-station/src/components/hooks/getEthgasstationTransformer.tsx on lines 16..25
packages/plugins/packages/ethereum-gas/packages/eth-gas-station/src/components/hooks/getEthgasstationTransformer.tsx on lines 26..35

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

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

      attachedListener = mod.on('moduleAttached', async () => {
        const newElements = (await CytoscapeElements.buildElements(mod)) ?? []
        setElements(newElements)
      })
packages/sdk/packages/node-renderer/src/hooks/cytoscape/elements/useCytoscapeElements.ts on lines 34..37

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

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

        {
          price: {
            label: 'fast',
            value: payload.gasPrice?.fast,
          },
packages/plugins/packages/ethereum-gas/packages/eth-gas-station/src/components/hooks/getEthgasstationTransformer.tsx on lines 16..25
packages/plugins/packages/ethereum-gas/packages/eth-gas-station/src/components/hooks/getEthgasstationTransformer.tsx on lines 36..45

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

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

export const DetailsBox: React.FC<PayloadRenderProps & FlexBoxProps> = (props) => {
  return <PayloadDetails {...props} />
}
Severity: Major
Found in packages/plugins/packages/pointer/src/Details.tsx and 2 other locations - About 40 mins to fix
packages/plugins/packages/schema/src/Details.tsx on lines 6..8
packages/sdk/packages/payload/packages/plugin/src/components/PayloadEditorBox.tsx on lines 7..9

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

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

export const PayloadEditorBox: React.FC<PayloadEditorRenderProps & FlexBoxProps> = (props) => {
  return <PayloadDetails {...props} />
}
packages/plugins/packages/pointer/src/Details.tsx on lines 6..8
packages/plugins/packages/schema/src/Details.tsx on lines 6..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 49.

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