XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

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

  async xnsReservationFailure<T extends TData>(fields: T | XnsReservationFailureFields) {
    await Promise.all(this.handlers.map(handler => handler.xnsReservationFailure(fields)))
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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 const TokenManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
  locator.register(MemoryBoundWitnessDiviner)
  locator.register(MemoryPayloadDiviner)

  return tokenNodeManifest as PackageManifestPayload
packages/sdk/packages/manifest/src/stories/sentinel/SentinelNode.ts on lines 9..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 65.

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

  async xnsReservationSuccess<T extends TData>(fields: T | XnsReservationSuccessFields) {
    await Promise.all(this.handlers.map(handler => handler.xnsReservationSuccess(fields)))
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

  async xnsReservationAttempted<T extends TData>(fields: T | XnsReservationAttemptedFields) {
    await Promise.all(this.handlers.map(handler => handler.xnsReservationAttempted(fields)))
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

      <IconButton onClick={handleFirstPageButtonClick} disabled={page === 0} aria-label="first page">
        {theme.direction === 'rtl'
          ? <LastPageIcon />
          : <FirstPageIcon />}
      </IconButton>
packages/sdk/packages/payload/packages/table/src/components/DynamicTable/Table.tsx on lines 76..80
packages/sdk/packages/payload/packages/table/src/components/Table/TablePagination.tsx on lines 60..64

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

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

  return (
    <FlexCol alignItems="start">
      <h1>Polling Results from Hook</h1>
      {results
        ? <pre>{JSON.stringify(results, null, 2)}</pre>
packages/sdk/packages/indexed-results/src/stories/manifest/components/UseFreshIndexedResult.tsx on lines 76..83
packages/sdk/packages/indexed-results/src/stories/manifest/components/UseIndexedResultsNoPoll.tsx on lines 46..53

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

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

      <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label="previous page">
        {theme.direction === 'rtl'
          ? <KeyboardArrowRight />
          : <KeyboardArrowLeft />}
      </IconButton>
packages/sdk/packages/payload/packages/table/src/components/DynamicTable/Table.tsx on lines 71..75
packages/sdk/packages/payload/packages/table/src/components/Table/TablePagination.tsx on lines 60..64

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

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

        avatar={(
          <Paper
            elevation={6}
            sx={{ bgcolor: '#fff', p: 1 }}
          >
packages/sdk/packages/node-renderer/src/components/module/graph/Popper.tsx on lines 37..44

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

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 const SentinelManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
  locator.register(TimestampWitness)
  locator.register(AddDayDiviner)

  return sentinelManifest as PackageManifestPayload
packages/sdk/packages/indexed-results/src/stories/manifest/nodes/contract/TokenNode.ts on lines 9..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 65.

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

  async xnsPurchaseFailure<T extends TData>(fields: T | XnsPurchaseFailureFields) {
    await Promise.all(this.handlers.map(handler => handler.xnsPurchaseFailure(fields)))
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

  return (
    <FlexCol alignItems="start">
      <h1>Polling Results from Hook</h1>
      {results
        ? <pre>{JSON.stringify(results, null, 2)}</pre>
packages/sdk/packages/indexed-results/src/stories/manifest/components/UseIndexedResults.tsx on lines 46..53
packages/sdk/packages/indexed-results/src/stories/manifest/components/UseIndexedResultsNoPoll.tsx on lines 46..53

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

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

  async xyoNewsletterSignup<T extends TData>(fields: T | XyoNewsletterSignupFields) {
    await Promise.all(this.handlers.map(handler => handler.xyoNewsletterSignup(fields)))
  }
Severity: Major
Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
packages/sdk/packages/user-events/src/XyoUserEvents.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 65.

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

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

  const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
    setRowsPerPage(Number.parseInt(event.target.value, 10))
    setPage(0)
  }
packages/sdk/packages/payload/packages/table/src/components/Table/Table.tsx on lines 103..106

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

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

  return (
    <FlexCol alignItems="start">
      <h1>Polling Results from Hook</h1>
      {results
        ? <pre>{JSON.stringify(results, null, 2)}</pre>
packages/sdk/packages/indexed-results/src/stories/manifest/components/UseFreshIndexedResult.tsx on lines 76..83
packages/sdk/packages/indexed-results/src/stories/manifest/components/UseIndexedResults.tsx on lines 46..53

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

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

        <IconButton onClick={handleFirstPageButtonClick} disabled={page === 0} aria-label="first page">
          {theme.direction === 'rtl'
            ? <LastPageIcon />
            : <FirstPageIcon />}
        </IconButton>
packages/sdk/packages/payload/packages/table/src/components/DynamicTable/Table.tsx on lines 71..75
packages/sdk/packages/payload/packages/table/src/components/DynamicTable/Table.tsx on lines 76..80

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

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

                  avatar={(
                    <Paper
                      elevation={6}
                      sx={{ bgcolor: '#fff', p: 1 }}
                    >
packages/sdk/packages/node-renderer/src/components/relational/graph/Graph.tsx on lines 60..67

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

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

export const useBoundWitnessClickHandler = () => {
  const mounted = useMounted()
  const {
    hashSelectionHistory, fetchFromHash, addSelection, clearHistory,
  } = usePayloadHashSelectionHistory(false)

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

        {
          payloadData.map(pair => pair.tokens.map(token => (tokenList.includes(token.symbol) ? null : tokenList.push(token.symbol))))
        }
    packages/plugins/packages/crypto-market-uniswap/src/components/Summary/TableCellSummary.tsx on lines 13..15

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

    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

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

        {
          payloadData.map(pair => pair.tokens.map(token => (tokenList.includes(token.symbol) ? null : tokenList.push(token.symbol))))
        }
    packages/plugins/packages/crypto-prices/src/components/Summary/TableCellSummary.tsx on lines 13..15

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

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

    export const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {
      const someType = type as SomeType
      const parts: string[] = []
    
      switch (someType.type) {
      Severity
      Category
      Status
      Source
      Language