trufflesuite/truffle

View on GitHub

Showing 716 of 1,401 total issues

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

export const { OverlongArraysAndStringsNotImplementedError } =
  createCodecComponent(
    "OverlongArraysAndStringsNotImplementedError",
    ({
      kind,
packages/codec-components/src/react/components/codec/format.errors.bool-out-of-range-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.overlarge-pointers-not-implemented-error.tsx on lines 6..14
packages/codec-components/src/react/components/codec/format.errors.overlong-array-or-string-strict-mode-error.tsx on lines 6..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 77.

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 { BoolOutOfRangeError } = createCodecComponent(
  "BoolOutOfRangeError",
  ({ kind, rawAsBN }: Format.Errors.BoolOutOfRangeError) => (
    <CodecError kind={kind}>{rawAsBN.toString()}</CodecError>
  )
packages/codec-components/src/react/components/codec/format.errors.overlarge-pointers-not-implemented-error.tsx on lines 6..14
packages/codec-components/src/react/components/codec/format.errors.overlong-array-or-string-strict-mode-error.tsx on lines 6..14
packages/codec-components/src/react/components/codec/format.errors.overlong-arrays-and-strings-not-implemented-error.tsx on lines 6..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 77.

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

  private async interpretDeadlinedMulticall(
    decoding: Codec.CalldataDecoding,
    transaction: DecoderTypes.Transaction,
    additionalContexts: Contexts.Contexts = {},
    additionalAllocations?: {
Severity: Major
Found in packages/decoder/lib/decoders.ts and 4 other locations - About 2 hrs to fix
packages/decoder/lib/decoders.ts on lines 998..1034
packages/decoder/lib/decoders.ts on lines 1060..1159
packages/decoder/lib/decoders.ts on lines 1230..1280
packages/decoder/lib/decoders.ts on lines 1326..1368

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

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

  private async interpretAggregate(
    decoding: Codec.CalldataDecoding,
    transaction: DecoderTypes.Transaction,
    additionalContexts: Contexts.Contexts = {},
    additionalAllocations?: {
Severity: Major
Found in packages/decoder/lib/decoders.ts and 4 other locations - About 2 hrs to fix
packages/decoder/lib/decoders.ts on lines 998..1034
packages/decoder/lib/decoders.ts on lines 1230..1280
packages/decoder/lib/decoders.ts on lines 1282..1324
packages/decoder/lib/decoders.ts on lines 1326..1368

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

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 { OverlongArrayOrStringStrictModeError } = createCodecComponent(
  "OverlongArrayOrStringStrictModeError",
  ({
    kind,
    lengthAsBN
packages/codec-components/src/react/components/codec/format.errors.bool-out-of-range-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.overlarge-pointers-not-implemented-error.tsx on lines 6..14
packages/codec-components/src/react/components/codec/format.errors.overlong-arrays-and-strings-not-implemented-error.tsx on lines 6..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 77.

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

  private async interpretBlockhashedMulticall(
    decoding: Codec.CalldataDecoding,
    transaction: DecoderTypes.Transaction,
    additionalContexts: Contexts.Contexts = {},
    additionalAllocations?: {
Severity: Major
Found in packages/decoder/lib/decoders.ts and 4 other locations - About 2 hrs to fix
packages/decoder/lib/decoders.ts on lines 998..1034
packages/decoder/lib/decoders.ts on lines 1060..1159
packages/decoder/lib/decoders.ts on lines 1230..1280
packages/decoder/lib/decoders.ts on lines 1282..1324

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

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

  private async interpretTryAggregate(
    decoding: Codec.CalldataDecoding,
    transaction: DecoderTypes.Transaction,
    additionalContexts: Contexts.Contexts = {},
    additionalAllocations?: {
Severity: Major
Found in packages/decoder/lib/decoders.ts and 4 other locations - About 2 hrs to fix
packages/decoder/lib/decoders.ts on lines 998..1034
packages/decoder/lib/decoders.ts on lines 1060..1159
packages/decoder/lib/decoders.ts on lines 1282..1324
packages/decoder/lib/decoders.ts on lines 1326..1368

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

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 { OverlargePointersNotImplementedError } = createCodecComponent(
  "OverlargePointersNotImplementedError",
  ({
    kind,
    pointerAsBN
packages/codec-components/src/react/components/codec/format.errors.bool-out-of-range-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.overlong-array-or-string-strict-mode-error.tsx on lines 6..14
packages/codec-components/src/react/components/codec/format.errors.overlong-arrays-and-strings-not-implemented-error.tsx on lines 6..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 77.

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

    web3.eth.getTransaction.method.outputFormatter = (tx: EvmTransaction) => {
      const _oldGas = tx.gas;

      tx.gas = "0x0";

Severity: Major
Found in packages/interface-adapter/lib/shim/overloads/quorum.ts and 1 other location - About 2 hrs to fix
packages/interface-adapter/lib/shim/overloads/quorum.ts on lines 88..104

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

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

        if (reporter.subscriber.config.describeJson) {
          output +=
            self.migrationStatus({
              status: "reusing",
              data: {
Severity: Major
Found in packages/events/defaultSubscribers/migrate/Messages.js and 1 other location - About 2 hrs to fix
packages/events/defaultSubscribers/migrate/Messages.js on lines 182..191

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

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

  {
    type: "codec-interface",
    name: "AnonymousDecoding",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 5 other locations - About 2 hrs to fix
packages/codec-components/src/docs/content.tsx on lines 36..46
packages/codec-components/src/docs/content.tsx on lines 173..185
packages/codec-components/src/docs/content.tsx on lines 186..196
packages/codec-components/src/docs/content.tsx on lines 197..209
packages/codec-components/src/docs/content.tsx on lines 389..403

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

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

  {
    type: "codec-interface",
    name: "UnknownCreationDecoding",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 5 other locations - About 2 hrs to fix
packages/codec-components/src/docs/content.tsx on lines 25..35
packages/codec-components/src/docs/content.tsx on lines 36..46
packages/codec-components/src/docs/content.tsx on lines 173..185
packages/codec-components/src/docs/content.tsx on lines 186..196
packages/codec-components/src/docs/content.tsx on lines 389..403

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

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

    web3.eth.getTransactionReceipt.method.outputFormatter = (receipt: any) => {
      const _oldGasUsed = receipt.gasUsed;

      receipt.gasUsed = "0x0";

Severity: Major
Found in packages/interface-adapter/lib/shim/overloads/quorum.ts and 1 other location - About 2 hrs to fix
packages/interface-adapter/lib/shim/overloads/quorum.ts on lines 63..79

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

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

        if (reporter.subscriber.config.describeJson) {
          output +=
            self.migrationStatus({
              status: "replacing",
              data: {
Severity: Major
Found in packages/events/defaultSubscribers/migrate/Messages.js and 1 other location - About 2 hrs to fix
packages/events/defaultSubscribers/migrate/Messages.js on lines 201..210

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

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

  {
    type: "codec-interface",
    name: "BytecodeDecoding",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 5 other locations - About 2 hrs to fix
packages/codec-components/src/docs/content.tsx on lines 25..35
packages/codec-components/src/docs/content.tsx on lines 173..185
packages/codec-components/src/docs/content.tsx on lines 186..196
packages/codec-components/src/docs/content.tsx on lines 197..209
packages/codec-components/src/docs/content.tsx on lines 389..403

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

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

  {
    type: "codec-interface",
    name: "Format.Values.StringValueInfoMalformed",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 5 other locations - About 2 hrs to fix
packages/codec-components/src/docs/content.tsx on lines 25..35
packages/codec-components/src/docs/content.tsx on lines 36..46
packages/codec-components/src/docs/content.tsx on lines 173..185
packages/codec-components/src/docs/content.tsx on lines 186..196
packages/codec-components/src/docs/content.tsx on lines 197..209

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

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

  {
    type: "codec-interface",
    name: "UnknownCallDecoding",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 5 other locations - About 2 hrs to fix
packages/codec-components/src/docs/content.tsx on lines 25..35
packages/codec-components/src/docs/content.tsx on lines 36..46
packages/codec-components/src/docs/content.tsx on lines 173..185
packages/codec-components/src/docs/content.tsx on lines 197..209
packages/codec-components/src/docs/content.tsx on lines 389..403

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

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

  {
    type: "codec-interface",
    name: "UnknownBytecodeDecoding",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 5 other locations - About 2 hrs to fix
packages/codec-components/src/docs/content.tsx on lines 25..35
packages/codec-components/src/docs/content.tsx on lines 36..46
packages/codec-components/src/docs/content.tsx on lines 186..196
packages/codec-components/src/docs/content.tsx on lines 197..209
packages/codec-components/src/docs/content.tsx on lines 389..403

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

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

export const { TypeValue } = createCodecComponent(
  "TypeValue",
  (data: Format.Values.TypeValue) =>
    isTypeValueContract(data) ? (
      <TypeValueContract data={data} />
packages/codec-components/src/react/components/codec/format.errors.bool-error.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.dynamic-data-implementation-error.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.error-for-throwing.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.address-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.array-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bool-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-dynamic-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-static-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-value.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.contract-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.contract-value-info.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.enum-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.fixed-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.function-external-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.function-internal-raw-info.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.function-internal-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.int-result.tsx on lines 8..12
packages/codec-components/src/react/components/codec/format.values.magic-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.mapping-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.options-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.string-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.string-value-info.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.struct-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.tuple-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.type-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.ufixed-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.uint-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.user-defined-value-type-result.tsx on lines 8..16

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

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

export const { ErrorForThrowing } = createCodecComponent(
  "ErrorForThrowing",
  (data: Format.Errors.ErrorForThrowing) =>
    isUserDefinedTypeNotFoundError(data) ? (
      <UserDefinedTypeNotFoundError data={data} />
packages/codec-components/src/react/components/codec/format.errors.bool-error.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.dynamic-data-implementation-error.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.address-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.array-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bool-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-dynamic-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-static-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.bytes-value.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.contract-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.contract-value-info.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.enum-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.fixed-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.function-external-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.function-internal-raw-info.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.function-internal-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.int-result.tsx on lines 8..12
packages/codec-components/src/react/components/codec/format.values.magic-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.mapping-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.options-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.string-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.string-value-info.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.struct-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.tuple-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.type-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.type-value.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.ufixed-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.uint-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.values.user-defined-value-type-result.tsx on lines 8..16

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

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