trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

type Eip1193Provider = {
  request: (options: {
    method: string;
    params?: unknown[] | object;
  }) => Promise<any>;
Severity: Minor
Found in packages/hdwallet-provider/src/constructor/types.ts and 1 other location - About 40 mins to fix
packages/encoder/lib/adapter.ts on lines 33..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

export function isEthersBigNumber(input: any): input is EthersBigNumber {
  return EthersBigNumber.isBigNumber(input) && Boolean(input.toHexString);
}
Severity: Minor
Found in packages/encoder/lib/utils.ts and 1 other location - About 40 mins to fix
packages/encoder/lib/utils.ts on lines 13..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

export interface StructErrorResult {
  type: Types.StructType;
  kind: "error";
  error: GenericError | StructError;
}
Severity: Major
Found in packages/codec/lib/format/errors.ts and 15 other locations - About 40 mins to fix
packages/codec/lib/format/errors.ts on lines 142..146
packages/codec/lib/format/errors.ts on lines 174..178
packages/codec/lib/format/errors.ts on lines 206..210
packages/codec/lib/format/errors.ts on lines 248..252
packages/codec/lib/format/errors.ts on lines 280..284
packages/codec/lib/format/errors.ts on lines 298..302
packages/codec/lib/format/errors.ts on lines 330..334
packages/codec/lib/format/errors.ts on lines 348..352
packages/codec/lib/format/errors.ts on lines 358..362
packages/codec/lib/format/errors.ts on lines 473..477
packages/codec/lib/format/errors.ts on lines 502..506
packages/codec/lib/format/errors.ts on lines 556..560
packages/codec/lib/format/errors.ts on lines 592..596
packages/codec/lib/format/errors.ts on lines 610..614
packages/codec/lib/format/errors.ts on lines 628..632

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

      borderColor:
        colorScheme === "dark"
          ? fn.rgba(colors["truffle-brown"][5], 0.65)
          : fn.rgba(colors["truffle-beige"][5], 0.65)
packages/dashboard/src/components/composed/Sidebar/Middle/NavButton.tsx on lines 28..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

export function* reset() {
  let guard = yield select(
    sourcemapping.transaction.bottomStackframeRequiresPhantomFrame
  );
  yield put(actions.reset(guard));
Severity: Minor
Found in packages/debugger/lib/sourcemapping/sagas/index.js and 1 other location - About 40 mins to fix
packages/debugger/lib/sourcemapping/sagas/index.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

export interface BoolErrorResult {
  type: Types.BoolType;
  kind: "error";
  error: GenericError | BoolError;
}
Severity: Major
Found in packages/codec/lib/format/errors.ts and 15 other locations - About 40 mins to fix
packages/codec/lib/format/errors.ts on lines 142..146
packages/codec/lib/format/errors.ts on lines 174..178
packages/codec/lib/format/errors.ts on lines 248..252
packages/codec/lib/format/errors.ts on lines 280..284
packages/codec/lib/format/errors.ts on lines 298..302
packages/codec/lib/format/errors.ts on lines 330..334
packages/codec/lib/format/errors.ts on lines 348..352
packages/codec/lib/format/errors.ts on lines 358..362
packages/codec/lib/format/errors.ts on lines 473..477
packages/codec/lib/format/errors.ts on lines 502..506
packages/codec/lib/format/errors.ts on lines 556..560
packages/codec/lib/format/errors.ts on lines 574..578
packages/codec/lib/format/errors.ts on lines 592..596
packages/codec/lib/format/errors.ts on lines 610..614
packages/codec/lib/format/errors.ts on lines 628..632

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

export interface BytesStaticErrorResult {
  type: Types.BytesTypeStatic;
  kind: "error";
  error: GenericError | BytesStaticError;
}
Severity: Major
Found in packages/codec/lib/format/errors.ts and 15 other locations - About 40 mins to fix
packages/codec/lib/format/errors.ts on lines 142..146
packages/codec/lib/format/errors.ts on lines 174..178
packages/codec/lib/format/errors.ts on lines 206..210
packages/codec/lib/format/errors.ts on lines 280..284
packages/codec/lib/format/errors.ts on lines 298..302
packages/codec/lib/format/errors.ts on lines 330..334
packages/codec/lib/format/errors.ts on lines 348..352
packages/codec/lib/format/errors.ts on lines 358..362
packages/codec/lib/format/errors.ts on lines 473..477
packages/codec/lib/format/errors.ts on lines 502..506
packages/codec/lib/format/errors.ts on lines 556..560
packages/codec/lib/format/errors.ts on lines 574..578
packages/codec/lib/format/errors.ts on lines 592..596
packages/codec/lib/format/errors.ts on lines 610..614
packages/codec/lib/format/errors.ts on lines 628..632

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

export interface FixedErrorResult {
  type: Types.FixedType;
  kind: "error";
  error: GenericError | FixedError;
}
Severity: Major
Found in packages/codec/lib/format/errors.ts and 15 other locations - About 40 mins to fix
packages/codec/lib/format/errors.ts on lines 142..146
packages/codec/lib/format/errors.ts on lines 174..178
packages/codec/lib/format/errors.ts on lines 206..210
packages/codec/lib/format/errors.ts on lines 248..252
packages/codec/lib/format/errors.ts on lines 280..284
packages/codec/lib/format/errors.ts on lines 298..302
packages/codec/lib/format/errors.ts on lines 330..334
packages/codec/lib/format/errors.ts on lines 358..362
packages/codec/lib/format/errors.ts on lines 473..477
packages/codec/lib/format/errors.ts on lines 502..506
packages/codec/lib/format/errors.ts on lines 556..560
packages/codec/lib/format/errors.ts on lines 574..578
packages/codec/lib/format/errors.ts on lines 592..596
packages/codec/lib/format/errors.ts on lines 610..614
packages/codec/lib/format/errors.ts on lines 628..632

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

      ancestors: {
        async resolve(network, options, context) {
          debug("Resolving Network.ancestors...");
          const result = await resolveAncestors(network, options, context);
          debug("Resolved Network.ancestors.");
Severity: Major
Found in packages/db/src/resources/networks/index.ts and 3 other locations - About 40 mins to fix
packages/db/src/resources/networks/index.ts on lines 119..126
packages/db/src/resources/networks/index.ts on lines 128..139
packages/db/src/resources/networks/index.ts on lines 141..152

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

    if (
      !this.compilation.unreliableSourceOrder &&
      !viaIR &&
      this.contract.deployedSourceMap &&
      compiler.name === "solc" &&
Severity: Major
Found in packages/decoder/lib/decoders.ts - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

      } else if (typeof options === "object") {
        return {
          name: options.name || "default",
          unsafeCleanup: options.unsafeCleanup || false,
          setGracefulCleanup: options.setGracefulCleanup || false,
    Severity: Major
    Found in packages/box/box.ts - About 40 mins to fix

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

      export const { MagicError } = createCodecComponent(
        "MagicError",
        (_data: Format.Errors.MagicError) => {
          throw new ComponentDataTypeIsNeverError("Codec.Format.Errors.MagicError");
        }
      packages/codec-components/src/react/components/codec/format.errors.mapping-error.tsx on lines 5..10
      packages/codec-components/src/react/components/codec/format.errors.options-error.tsx on lines 5..10
      packages/codec-components/src/react/components/codec/format.errors.type-error-union.tsx on lines 5..12

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

      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 { OptionsError } = createCodecComponent(
        "OptionsError",
        (_data: Format.Errors.OptionsError) => {
          throw new ComponentDataTypeIsNeverError("Codec.Format.Errors.OptionsError");
        }
      packages/codec-components/src/react/components/codec/format.errors.magic-error.tsx on lines 5..10
      packages/codec-components/src/react/components/codec/format.errors.mapping-error.tsx on lines 5..10
      packages/codec-components/src/react/components/codec/format.errors.type-error-union.tsx on lines 5..12

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

      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 { TypeErrorUnion } = createCodecComponent(
        "TypeErrorUnion",
        (_data: Format.Errors.TypeErrorUnion) => {
          throw new ComponentDataTypeIsNeverError(
            "Codec.Format.Errors.TypeErrorUnion"
      packages/codec-components/src/react/components/codec/format.errors.magic-error.tsx on lines 5..10
      packages/codec-components/src/react/components/codec/format.errors.mapping-error.tsx on lines 5..10
      packages/codec-components/src/react/components/codec/format.errors.options-error.tsx on lines 5..10

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 48.

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

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

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

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

      Refactorings

      Further Reading

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

              const inputs = allocation.arguments.map(
                input => ({ type: input.type, name: input.name || undefined }) //convert "" to undefined
              );
      Severity: Minor
      Found in packages/encoder/lib/encoders.ts and 1 other location - About 40 mins to fix
      packages/encoder/lib/encoders.ts on lines 1439..1441

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

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

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

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

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

      Refactorings

      Further Reading

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

          const inputs = allocation.arguments.map(
            input => ({ type: input.type, name: input.name || undefined }) //convert "" to undefined
          );
      Severity: Minor
      Found in packages/encoder/lib/encoders.ts and 1 other location - About 40 mins to fix
      packages/encoder/lib/encoders.ts on lines 1404..1406

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

      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

          transform: function (value) {
            if (value && value.indexOf("0x") !== 0) {
              value = "0x" + value;
            }
            return value;
      Severity: Minor
      Found in packages/contract-schema/index.js and 1 other location - About 40 mins to fix
      packages/contract-schema/index.js on lines 99..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 48.

      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

          transform: function (value) {
            if (value && value.indexOf("0x") !== 0) {
              value = "0x" + value;
            }
            return value;
      Severity: Minor
      Found in packages/contract-schema/index.js and 1 other location - About 40 mins to fix
      packages/contract-schema/index.js on lines 86..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 48.

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

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

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

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

      Refactorings

      Further Reading

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

        export const Ufixed = () =>
          Numerics.Precision().map(([m, n]) => `ufixed${m}x${n}`);
      Severity: Minor
      Found in packages/abi-utils/lib/arbitrary.ts and 1 other location - About 40 mins to fix
      packages/abi-utils/lib/arbitrary.ts on lines 217..218

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

      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 decodeTransaction(
          transaction: DecoderTypes.Transaction
        ): Promise<CalldataDecoding> {
          return await this.decodeTransactionWithAdditionalContexts(transaction);
        }
      Severity: Minor
      Found in packages/decoder/lib/decoders.ts and 1 other location - About 40 mins to fix
      packages/encoder/lib/encoders.ts on lines 554..558

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

      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