trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

export const { StructErrorResult } = createCodecComponent(
  "StructErrorResult",
  ({ error }: Format.Errors.StructErrorResult) =>
    isStructError(error) ? (
      <StructError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { FunctionInternalErrorResult } = createCodecComponent(
  "FunctionInternalErrorResult",
  ({ error }: Format.Errors.FunctionInternalErrorResult) =>
    isFunctionInternalError(error) ? (
      <FunctionInternalError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { TypeErrorResult } = createCodecComponent(
  "TypeErrorResult",
  ({ error }: Format.Errors.TypeErrorResult) =>
    isTypeErrorUnion(error) ? (
      <TypeErrorUnion data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { EnumErrorResult } = createCodecComponent(
  "EnumErrorResult",
  ({ error }: Format.Errors.EnumErrorResult) =>
    isEnumError(error) ? (
      <EnumError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { UintErrorResult } = createCodecComponent(
  "UintErrorResult",
  ({ error }: Format.Errors.UintErrorResult) =>
    isUintError(error) ? (
      <UintError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { ArrayErrorResult } = createCodecComponent(
  "ArrayErrorResult",
  ({ error }: Format.Errors.ArrayErrorResult) =>
    isArrayError(error) ? (
      <ArrayError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { StringErrorResult } = createCodecComponent(
  "StringErrorResult",
  ({ error }: Format.Errors.StringErrorResult) =>
    isStringError(error) ? (
      <StringError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { IntErrorResult } = createCodecComponent(
  "IntErrorResult",
  ({ error }: Format.Errors.IntErrorResult) =>
    isIntError(error) ? (
      <IntError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { MagicErrorResult } = createCodecComponent(
  "MagicErrorResult",
  ({ error }: Format.Errors.MagicErrorResult) =>
    isMagicError(error) ? (
      <MagicError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.options-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

export const { OptionsErrorResult } = createCodecComponent(
  "OptionsErrorResult",
  ({ error }: Format.Errors.OptionsErrorResult) =>
    isOptionsError(error) ? (
      <OptionsError data={error} />
packages/codec-components/src/react/components/codec/format.errors.address-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.array-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bool-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.bytes-static-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.contract-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.enum-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.fixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-external-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.function-internal-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.int-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.magic-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.mapping-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.string-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.struct-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.tuple-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.type-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.ufixed-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.uint-error-result.tsx on lines 8..16
packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error-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 81.

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

    if (useDocker) {
      strategy = new Docker(this.strategyOptions);
    } else if (useNative) {
      strategy = new Native();
    } else if (useSpecifiedLocal) {
Severity: Major
Found in packages/compile-solidity/src/compilerSupplier/index.ts and 1 other location - About 2 hrs to fix
packages/compile-solidity/src/compilerSupplier/index.ts on lines 83..91

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

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

  public async getBalance(
    address: string,
    block: BlockSpecifier
  ): Promise<string> {
    return await this.request({
Severity: Major
Found in packages/encoder/lib/adapter.ts and 1 other location - About 2 hrs to fix
packages/encoder/lib/adapter.ts on lines 270..279

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

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

    if (useDocker) {
      strategy = new Docker(this.strategyOptions);
    } else if (useNative) {
      strategy = new Native();
    } else if (useSpecifiedLocal) {
Severity: Major
Found in packages/compile-solidity/src/compilerSupplier/index.ts and 1 other location - About 2 hrs to fix
packages/compile-solidity/src/compilerSupplier/index.ts on lines 44..52

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

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

  public async getTransactionCount(
    address: string,
    block: BlockSpecifier
  ): Promise<string> {
    return await this.request({
Severity: Major
Found in packages/encoder/lib/adapter.ts and 1 other location - About 2 hrs to fix
packages/encoder/lib/adapter.ts on lines 259..268

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

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

File vyper-json.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const debug = require("debug")("compile-vyper:vyper-json");
const execSync = require("child_process").execSync;
const path = require("path");
const semver = require("semver");
const Common = require("@truffle/compile-common");
Severity: Minor
Found in packages/compile-vyper/vyper-json.js - About 2 hrs to fix

    Function PromiEvent has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function PromiEvent(justPromise, bugger = undefined, isDeploy = false) {
      const { resolve, reject, eventEmitter } = new Web3PromiEvent(justPromise);
    
      const originalStackTrace = new Error().stack;
    
    
    Severity: Major
    Found in packages/contract/lib/promievent.js - About 2 hrs to fix

      Function Menu has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const Menu = (props: Props) => {
        const { config, db, project, onDone } = props;
        const [mode, setMode] = useState<"wait" | ModeName<MenuModes>>("wait");
      
        const handleSelect = ({ value }) => {
      Severity: Major
      Found in packages/db-kit/src/cli/menu/Menu.tsx - About 2 hrs to fix

        Function EtherScanApiKeyPrompt has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function EtherScanApiKeyPrompt() {
          const { classes } = useStyles();
        
          const [etherscanApiKey, setEtherscanApiKey, removeEtherscanApiKey] =
            useLocalStorage({

          Function _ has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

                  (scopes, scope, pointer, sourceId, language) => {
                    let variables = {};
                    if (scope !== undefined) {
                      let cur =
                        scope.id !== undefined ? scope.id : makePath(sourceId, pointer);
          Severity: Minor
          Found in packages/debugger/lib/data/selectors/index.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getUserDefinedGlobals has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

            getUserDefinedGlobals({ accounts, interfaceAdapter, web3 }) {
              // exit if feature should be disabled
              if (this.options["require-none"]) return;
          
              // exit if no hydrate options are set
          Severity: Minor
          Found in packages/core/lib/console.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language