polkadot-js/api

View on GitHub
packages/types/src/interfaces/evm/types.ts

Summary

Maintainability
D
1 day
Test Coverage

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

export interface ExitReason extends Enum {
  readonly isSucceed: boolean;
  readonly asSucceed: ExitSucceed;
  readonly isError: boolean;
  readonly asError: ExitError;
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 2 other locations - About 3 hrs to fix
packages/types/src/interfaces/babe/types.ts on lines 116..126
packages/types/src/interfaces/eth/types.ts on lines 302..312

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

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

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

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

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

Refactorings

Further Reading

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

export interface EvmWeightInfo extends Struct {
  readonly refTimeLimit: Option<u64>;
  readonly proofSizeLimit: Option<u64>;
  readonly refTimeUsage: Option<u64>;
  readonly proofSizeUsage: Option<u64>;
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 4 other locations - About 2 hrs to fix
packages/types/src/interfaces/contractsAbi/types.ts on lines 57..62
packages/types/src/interfaces/contractsAbi/types.ts on lines 65..70
packages/types/src/interfaces/contractsAbi/types.ts on lines 73..78
packages/types/src/interfaces/contractsAbi/types.ts on lines 81..86

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

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

export interface EvmCreateInfoV2 extends Struct {
  readonly exitReason: ExitReason;
  readonly value: H160;
  readonly usedGas: U256;
  readonly weightInfo: Option<EvmWeightInfo>;
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 5 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 17..23
packages/types/src/interfaces/contractsAbi/types.ts on lines 37..43
packages/types/src/interfaces/eth/types.ts on lines 315..321
packages/types/src/interfaces/evm/types.ts on lines 22..28
packages/types/src/interfaces/runtime/types.ts on lines 359..365

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

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

export interface EvmCallInfoV2 extends Struct {
  readonly exitReason: ExitReason;
  readonly value: Bytes;
  readonly usedGas: U256;
  readonly weightInfo: Option<EvmWeightInfo>;
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 5 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 17..23
packages/types/src/interfaces/contractsAbi/types.ts on lines 37..43
packages/types/src/interfaces/eth/types.ts on lines 315..321
packages/types/src/interfaces/evm/types.ts on lines 39..45
packages/types/src/interfaces/runtime/types.ts on lines 359..365

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

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

export interface EvmCallInfo extends Struct {
  readonly exitReason: ExitReason;
  readonly value: Bytes;
  readonly usedGas: U256;
  readonly logs: Vec<EvmLog>;
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 12 other locations - About 1 hr to fix
packages/types/src/interfaces/beefy/types.ts on lines 25..30
packages/types/src/interfaces/benchmark/types.ts on lines 8..13
packages/types/src/interfaces/contractsAbi/types.ts on lines 134..139
packages/types/src/interfaces/contractsAbi/types.ts on lines 142..147
packages/types/src/interfaces/eth/types.ts on lines 405..410
packages/types/src/interfaces/evm/types.ts on lines 31..36
packages/types/src/interfaces/grandpa/types.ts on lines 59..64
packages/types/src/interfaces/metadata/types.ts on lines 253..258
packages/types/src/interfaces/metadata/types.ts on lines 334..339
packages/types/src/interfaces/parachains/types.ts on lines 262..267
packages/types/src/interfaces/staking/types.ts on lines 287..292
packages/types/src/interfaces/utility/types.ts on lines 8..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 59.

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

export interface EvmCreateInfo extends Struct {
  readonly exitReason: ExitReason;
  readonly value: H160;
  readonly usedGas: U256;
  readonly logs: Vec<EvmLog>;
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 12 other locations - About 1 hr to fix
packages/types/src/interfaces/beefy/types.ts on lines 25..30
packages/types/src/interfaces/benchmark/types.ts on lines 8..13
packages/types/src/interfaces/contractsAbi/types.ts on lines 134..139
packages/types/src/interfaces/contractsAbi/types.ts on lines 142..147
packages/types/src/interfaces/eth/types.ts on lines 405..410
packages/types/src/interfaces/evm/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 59..64
packages/types/src/interfaces/metadata/types.ts on lines 253..258
packages/types/src/interfaces/metadata/types.ts on lines 334..339
packages/types/src/interfaces/parachains/types.ts on lines 262..267
packages/types/src/interfaces/staking/types.ts on lines 287..292
packages/types/src/interfaces/utility/types.ts on lines 8..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 59.

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

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

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

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

Refactorings

Further Reading

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

export interface ExitSucceed extends Enum {
  readonly isStopped: boolean;
  readonly isReturned: boolean;
  readonly isSuicided: boolean;
  readonly type: 'Stopped' | 'Returned' | 'Suicided';
Severity: Minor
Found in packages/types/src/interfaces/evm/types.ts and 1 other location - About 55 mins to fix
packages/types/src/interfaces/elections/types.ts on lines 45..50

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

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

export interface EvmLog extends Struct {
  readonly address: H160;
  readonly topics: Vec<H256>;
  readonly data: Bytes;
}
Severity: Major
Found in packages/types/src/interfaces/evm/types.ts and 6 other locations - About 45 mins to fix
packages/types/src/interfaces/bridges/types.ts on lines 86..90
packages/types/src/interfaces/contractsAbi/types.ts on lines 314..318
packages/types/src/interfaces/parachains/types.ts on lines 68..72
packages/types/src/interfaces/parachains/types.ts on lines 90..94
packages/types/src/interfaces/scaleInfo/types.ts on lines 21..25
packages/types/src/interfaces/session/types.ts on lines 22..26

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

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

There are no issues that match your filters.

Category
Status