trufflesuite/truffle

View on GitHub

Showing 716 of 1,401 total issues

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

        Codec.Ast.Utils.typeClass(baseExpression) !== "struct" ||
        (Codec.Ast.Utils.isReference(node)
          ? Codec.Ast.Utils.referenceType(baseExpression) !== "storage"
          : !Codec.Ast.Utils.isMapping(node))
Severity: Major
Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 2 hrs to fix
packages/debugger/lib/data/sagas/index.js on lines 525..528

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

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 async function forArtifactAt(
  artifact: Artifact,
  address: string,
  settings: EncoderSettings = {}
): Promise<ContractInstanceEncoder> {
Severity: Major
Found in packages/encoder/lib/index.ts and 1 other location - About 2 hrs to fix
packages/decoder/lib/index.ts on lines 335..343

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

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

  resolveDependencyPath(importPath: string, dependencyPath: string) {
    if (
      !(dependencyPath.startsWith("./") || dependencyPath.startsWith("../"))
    ) {
      //if it's *not* a relative path, return it unchanged
Severity: Major
Found in packages/resolver/lib/sources/globalnpm.ts and 1 other location - About 2 hrs to fix
packages/resolver/lib/sources/npm.ts on lines 87..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 85.

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 async function forContractAt(
  contract: ContractConstructorObject,
  address: string,
  settings: DecoderSettings = {}
): Promise<ContractInstanceDecoder> {
Severity: Major
Found in packages/decoder/lib/index.ts and 1 other location - About 2 hrs to fix
packages/encoder/lib/index.ts on lines 333..341

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

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

  let summaryElement = (
    <Box>
      <Box paddingLeft={1} paddingRight={1}>
        <Text color="green">
          <Spinner />
Severity: Major
Found in packages/db-kit/src/cli/decodeAddress/Result.tsx and 2 other locations - About 2 hrs to fix
packages/db-kit/src/cli/decodeAddress/Result.tsx on lines 83..92
packages/db-kit/src/cli/decodeTransaction/Result.tsx on lines 39..48

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

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

  let summaryElement = (
    <Box>
      <Box paddingLeft={1} paddingRight={1}>
        <Text color="green">
          <Spinner />
Severity: Major
Found in packages/db-kit/src/cli/decodeTransaction/Result.tsx and 2 other locations - About 2 hrs to fix
packages/db-kit/src/cli/decodeAddress/Result.tsx on lines 33..42
packages/db-kit/src/cli/decodeAddress/Result.tsx on lines 83..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 84.

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

  let variablesElement = (
    <Box>
      <Box paddingLeft={1} paddingRight={1}>
        <Text color="green">
          <Spinner />
Severity: Major
Found in packages/db-kit/src/cli/decodeAddress/Result.tsx and 2 other locations - About 2 hrs to fix
packages/db-kit/src/cli/decodeAddress/Result.tsx on lines 33..42
packages/db-kit/src/cli/decodeTransaction/Result.tsx on lines 39..48

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

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

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

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

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

Refactorings

Further Reading

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

export interface UseCompilationsOptions {
  config: TruffleConfig;
  db: Db;
  project: Resources.IdObject<"projects">;
  network: Pick<Resources.Input<"networks">, "name">;
Severity: Major
Found in packages/db-kit/src/cli/hooks/useCompilations.ts and 1 other location - About 2 hrs to fix
packages/db-kit/src/cli/hooks/useDecoder.ts on lines 9..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 83.

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

  getBlockByNumber(
    blockNumber: string,
    provider: Provider,
    callback: Callback<JsonRPCResponse>
  ) {
Severity: Major
Found in packages/blockchain-utils/index.ts and 1 other location - About 2 hrs to fix
packages/blockchain-utils/index.ts on lines 22..37

Duplicated Code

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

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

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

Tuning

This issue has a mass of 83.

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

  getBlockByHash(
    blockHash: string,
    provider: Provider,
    callback: Callback<JsonRPCResponse>
  ) {
Severity: Major
Found in packages/blockchain-utils/index.ts and 1 other location - About 2 hrs to fix
packages/blockchain-utils/index.ts on lines 5..20

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

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

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

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

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

Refactorings

Further Reading

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

export interface UseDecoderOptions {
  config: TruffleConfig;
  db: Db;
  project: Resources.IdObject<"projects">;
  network: Pick<Resources.Input<"networks">, "name">;
Severity: Major
Found in packages/db-kit/src/cli/hooks/useDecoder.ts and 1 other location - About 2 hrs to fix
packages/db-kit/src/cli/hooks/useCompilations.ts on lines 7..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 83.

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

    "compile:infos": [
      function ({ infos }) {
        if (this.quiet) return;
        this.logger.log("> Compilation notices encountered:");
        this.logger.log(`${OS.EOL}    ${infos.join()}`);
Severity: Major
Found in packages/events/defaultSubscribers/compile.js and 1 other location - About 2 hrs to fix
packages/events/defaultSubscribers/compile.js on lines 49..55

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

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

    "compile:warnings": [
      function ({ warnings }) {
        if (this.quiet) return;
        this.logger.log("> Compilation warnings encountered:");
        this.logger.log(`${OS.EOL}    ${warnings.join()}`);
Severity: Major
Found in packages/events/defaultSubscribers/compile.js and 1 other location - About 2 hrs to fix
packages/events/defaultSubscribers/compile.js on lines 56..62

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

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

export const Out = () => {
  return (
    <svg
      width="25"
      height="25"
packages/dashboard/src/components/composed/Debugger/Controls/icons/Into.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Next.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Over.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Reset.tsx on lines 1..18

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

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

export const Over = () => {
  return (
    <svg
      width="25"
      height="25"
packages/dashboard/src/components/composed/Debugger/Controls/icons/Into.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Next.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Out.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Reset.tsx on lines 1..18

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

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

export const Next = () => {
  return (
    <svg
      width="25"
      height="25"
packages/dashboard/src/components/composed/Debugger/Controls/icons/Into.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Out.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Over.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Reset.tsx on lines 1..18

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

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

export const Into = () => {
  return (
    <svg
      width="25"
      height="25"
packages/dashboard/src/components/composed/Debugger/Controls/icons/Next.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Out.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Over.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Reset.tsx on lines 1..18

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

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

export const Reset = () => {
  return (
    <svg
      width="25"
      height="25"
packages/dashboard/src/components/composed/Debugger/Controls/icons/Into.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Next.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Out.tsx on lines 1..18
packages/dashboard/src/components/composed/Debugger/Controls/icons/Over.tsx on lines 1..18

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

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 { TupleErrorResult } = createCodecComponent(
  "TupleErrorResult",
  ({ error }: Format.Errors.TupleErrorResult) =>
    isTupleError(error) ? (
      <TupleError 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.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

Severity
Category
Status
Source
Language