trufflesuite/truffle

View on GitHub

Showing 716 of 1,401 total issues

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

      nameRecord: {
        resolve: async ({ nameRecord: { id } }, _, { workspace }) => {
          debug("Resolving ProjectName.nameRecord...");

          const result = await workspace.get("nameRecords", id);
Severity: Major
Found in packages/db/src/resources/projectNames.ts and 4 other locations - About 1 hr to fix
packages/db/src/resources/compilations.ts on lines 154..163
packages/db/src/resources/contractInstances.ts on lines 88..97
packages/db/src/resources/contractInstances.ts on lines 98..106
packages/db/src/resources/projectNames.ts on lines 55..64

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

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

      contract: {
        resolve: async ({ contract: { id } }, _, { workspace }) => {
          debug("Resolving ContractInstance.contract...");
          const result = await workspace.get("contracts", id);

Severity: Major
Found in packages/db/src/resources/contractInstances.ts and 4 other locations - About 1 hr to fix
packages/db/src/resources/compilations.ts on lines 154..163
packages/db/src/resources/contractInstances.ts on lines 88..97
packages/db/src/resources/projectNames.ts on lines 55..64
packages/db/src/resources/projectNames.ts on lines 65..74

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

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

      source: {
        resolve: async ({ source: { id } }, _, { workspace }) => {
          debug("Resolving ProcessedSource.source...");

          const result = await workspace.get("sources", id);
Severity: Major
Found in packages/db/src/resources/compilations.ts and 4 other locations - About 1 hr to fix
packages/db/src/resources/contractInstances.ts on lines 88..97
packages/db/src/resources/contractInstances.ts on lines 98..106
packages/db/src/resources/projectNames.ts on lines 55..64
packages/db/src/resources/projectNames.ts on lines 65..74

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

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

      network: {
        resolve: async ({ network: { id } }, _, { workspace }) => {
          debug("Resolving ContractInstance.network...");

          const result = await workspace.get("networks", id);
Severity: Major
Found in packages/db/src/resources/contractInstances.ts and 4 other locations - About 1 hr to fix
packages/db/src/resources/compilations.ts on lines 154..163
packages/db/src/resources/contractInstances.ts on lines 98..106
packages/db/src/resources/projectNames.ts on lines 55..64
packages/db/src/resources/projectNames.ts on lines 65..74

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

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

      project: {
        resolve: async ({ project: { id } }, _, { workspace }) => {
          debug("Resolving ProjectName.project...");

          const result = await workspace.get("projects", id);
Severity: Major
Found in packages/db/src/resources/projectNames.ts and 4 other locations - About 1 hr to fix
packages/db/src/resources/compilations.ts on lines 154..163
packages/db/src/resources/contractInstances.ts on lines 88..97
packages/db/src/resources/contractInstances.ts on lines 98..106
packages/db/src/resources/projectNames.ts on lines 65..74

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

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

        state.filter(
          breakpoint =>
            breakpoint.sourceId === action.breakpoint.sourceId &&
            breakpoint.line === action.breakpoint.line &&
            breakpoint.node === action.breakpoint.node //may be undefined
Severity: Major
Found in packages/debugger/lib/controller/reducers.js and 1 other location - About 1 hr to fix
packages/debugger/lib/controller/reducers.js on lines 29..34

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

      return state.filter(
        breakpoint =>
          breakpoint.sourceId !== action.breakpoint.sourceId ||
          breakpoint.line !== action.breakpoint.line ||
          breakpoint.node !== action.breakpoint.node //may be undefined
Severity: Major
Found in packages/debugger/lib/controller/reducers.js and 1 other location - About 1 hr to fix
packages/debugger/lib/controller/reducers.js on lines 13..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 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 [
  isUserDefinedValueTypeValue,
  isUserDefinedValueTypeErrorResult,
  isUserDefinedValueTypeResult,
  userDefinedValueTypeGuards
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/uint.ts on lines 4..9

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 [isMagicValue, isMagicErrorResult, isMagicResult, magicGuards] =
  valueAndResultTypeGuardHelper<
    Format.Values.MagicValue,
    Format.Errors.MagicErrorResult,
    Format.Values.MagicResult
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/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 [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

Severity
Category
Status
Source
Language