trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

export const [isEnumValue, isEnumErrorResult, isEnumResult, enumGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.EnumValue,
    Format.Errors.EnumErrorResult,
    Format.Values.EnumResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

    "deployment:failed": [
      async function (data) {
        const message = await this.reporter.deployFailed(data);
        if (!this.config.quiet) {
          this.logger.log(message);
Severity: Major
Found in packages/events/defaultSubscribers/migrate/index.js and 1 other location - About 1 hr to fix
packages/events/defaultSubscribers/migrate/index.js on lines 76..84

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

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

export const [isTupleValue, isTupleErrorResult, isTupleResult, tupleGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.TupleValue,
    Format.Errors.TupleErrorResult,
    Format.Values.TupleResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isTypeValue, isTypeErrorResult, isTypeResult, typeGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.TypeValue,
    Format.Errors.TypeErrorResult,
    Format.Values.TypeResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isBytesValue, isBytesErrorResult, isBytesResult, bytesGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.BytesValue,
    Format.Errors.BytesErrorResult,
    Format.Values.BytesResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [
  isMappingValue,
  isMappingErrorResult,
  isMappingResult,
  mappingGuards
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isIntValue, isIntErrorResult, isIntResult, intGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.IntValue,
    Format.Errors.IntErrorResult,
    Format.Values.IntResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [
  isUfixedValue,
  isUfixedErrorResult,
  isUfixedResult,
  ufixedGuards
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [
  isOptionsValue,
  isOptionsErrorResult,
  isOptionsResult,
  optionsGuards
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [
  isStructValue,
  isStructErrorResult,
  isStructResult,
  structGuards
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

    "deployment:error": [
      async function (data) {
        const message = await this.reporter.error(data);
        if (!this.config.quiet) {
          this.logger.error(message);
Severity: Major
Found in packages/events/defaultSubscribers/migrate/index.js and 1 other location - About 1 hr to fix
packages/events/defaultSubscribers/migrate/index.js on lines 85..93

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

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

export const [
  isAddressValue,
  isAddressErrorResult,
  isAddressResult,
  addressGuards
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isBoolValue, isBoolErrorResult, isBoolResult, boolGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.BoolValue,
    Format.Errors.BoolErrorResult,
    Format.Values.BoolResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [
  isStringValue,
  isStringErrorResult,
  isStringResult,
  stringGuards
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isUintValue, isUintErrorResult, isUintResult, uintGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.UintValue,
    Format.Errors.UintErrorResult,
    Format.Values.UintResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isArrayValue, isArrayErrorResult, isArrayResult, arrayGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.ArrayValue,
    Format.Errors.ArrayErrorResult,
    Format.Values.ArrayResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [isFixedValue, isFixedErrorResult, isFixedResult, fixedGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.FixedValue,
    Format.Errors.FixedErrorResult,
    Format.Values.FixedResult
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/contract.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

export const [
  isContractValue,
  isContractErrorResult,
  isContractResult,
  contractGuards
packages/codec-components/src/utils/type-guards/value-and-result/address.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/array.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bool.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/bytes.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/enum.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/fixed.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/int.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/magic.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/mapping.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/options.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/string.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/struct.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/tuple.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/type.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/ufixed.ts on lines 4..13
packages/codec-components/src/utils/type-guards/value-and-result/uint.ts on lines 4..9
packages/codec-components/src/utils/type-guards/value-and-result/user-defined-value-type.ts on lines 4..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 71.

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

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

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

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

Refactorings

Further Reading

Function fetchTx has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function* fetchTx(txHash, loadOptions) {
  let result = yield* web3.inspectTransaction(txHash);
  debug("result %o", result);

  if (result.error) {
Severity: Minor
Found in packages/debugger/lib/session/sagas/index.js - About 1 hr to fix

    Function provision has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      provision() {
        let files = [];
        let jsonBlobs = [];
        try {
          files = fse.readdirSync(this.options.contracts_build_directory);
    Severity: Minor
    Found in packages/core/lib/console.js - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language