polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

export interface BeefyVersionedFinalityProof extends Enum {
  readonly isV0: boolean;
  readonly isV1: boolean;
  readonly asV1: BeefyCompactSignedCommitment;
  readonly type: 'V0' | 'V1';
Severity: Major
Found in packages/types/src/interfaces/beefy/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/babe/types.ts on lines 84..89
packages/types/src/interfaces/eth/types.ts on lines 294..299
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 37..42
packages/types/src/interfaces/parachains/types.ts on lines 735..740
packages/types/src/interfaces/staking/types.ts on lines 130..135
packages/types/src/interfaces/xcm/types.ts on lines 1590..1595

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

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

export interface Retriable extends Enum {
  readonly isNever: boolean;
  readonly isWithRetries: boolean;
  readonly asWithRetries: u32;
  readonly type: 'Never' | 'WithRetries';
Severity: Major
Found in packages/types/src/interfaces/parachains/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/babe/types.ts on lines 84..89
packages/types/src/interfaces/beefy/types.ts on lines 61..66
packages/types/src/interfaces/eth/types.ts on lines 294..299
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 37..42
packages/types/src/interfaces/staking/types.ts on lines 130..135
packages/types/src/interfaces/xcm/types.ts on lines 1590..1595

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

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

export interface NextConfigDescriptor extends Enum {
  readonly isV0: boolean;
  readonly isV1: boolean;
  readonly asV1: NextConfigDescriptorV1;
  readonly type: 'V0' | 'V1';
Severity: Major
Found in packages/types/src/interfaces/babe/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/beefy/types.ts on lines 61..66
packages/types/src/interfaces/eth/types.ts on lines 294..299
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 37..42
packages/types/src/interfaces/parachains/types.ts on lines 735..740
packages/types/src/interfaces/staking/types.ts on lines 130..135
packages/types/src/interfaces/xcm/types.ts on lines 1590..1595

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

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

export interface EthSubParams extends Enum {
  readonly isNone: boolean;
  readonly isLogs: boolean;
  readonly asLogs: EthFilter;
  readonly type: 'None' | 'Logs';
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/babe/types.ts on lines 84..89
packages/types/src/interfaces/beefy/types.ts on lines 61..66
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 37..42
packages/types/src/interfaces/parachains/types.ts on lines 735..740
packages/types/src/interfaces/staking/types.ts on lines 130..135
packages/types/src/interfaces/xcm/types.ts on lines 1590..1595

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

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

export interface ElectionStatus extends Enum {
  readonly isClose: boolean;
  readonly isOpen: boolean;
  readonly asOpen: BlockNumber;
  readonly type: 'Close' | 'Open';
Severity: Major
Found in packages/types/src/interfaces/staking/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/babe/types.ts on lines 84..89
packages/types/src/interfaces/beefy/types.ts on lines 61..66
packages/types/src/interfaces/eth/types.ts on lines 294..299
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 37..42
packages/types/src/interfaces/parachains/types.ts on lines 735..740
packages/types/src/interfaces/xcm/types.ts on lines 1590..1595

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

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

export interface WeightLimitV3 extends Enum {
  readonly isUnlimited: boolean;
  readonly isLimited: boolean;
  readonly asLimited: WeightV2;
  readonly type: 'Unlimited' | 'Limited';
Severity: Major
Found in packages/types/src/interfaces/xcm/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/babe/types.ts on lines 84..89
packages/types/src/interfaces/beefy/types.ts on lines 61..66
packages/types/src/interfaces/eth/types.ts on lines 294..299
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/grandpa/types.ts on lines 37..42
packages/types/src/interfaces/parachains/types.ts on lines 735..740
packages/types/src/interfaces/staking/types.ts on lines 130..135

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

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 RentProjection extends Enum {
  readonly isEvictionAt: boolean;
  readonly asEvictionAt: BlockNumber;
  readonly isNoEviction: boolean;
  readonly type: 'EvictionAt' | 'NoEviction';
Severity: Major
Found in packages/types/src/interfaces/contracts/types.ts and 5 other locations - About 55 mins to fix
packages/types/src/interfaces/contracts/types.ts on lines 109..114
packages/types/src/interfaces/contracts/types.ts on lines 117..122
packages/types/src/interfaces/eth/types.ts on lines 324..329
packages/types/src/interfaces/eth/types.ts on lines 359..364
packages/types/src/interfaces/parachains/types.ts on lines 222..227

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

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 ContractExecResultTo255 extends Enum {
  readonly isSuccess: boolean;
  readonly asSuccess: ContractExecResultSuccessTo255;
  readonly isError: boolean;
  readonly type: 'Success' | 'Error';
Severity: Major
Found in packages/types/src/interfaces/contracts/types.ts and 5 other locations - About 55 mins to fix
packages/types/src/interfaces/contracts/types.ts on lines 117..122
packages/types/src/interfaces/contracts/types.ts on lines 454..459
packages/types/src/interfaces/eth/types.ts on lines 324..329
packages/types/src/interfaces/eth/types.ts on lines 359..364
packages/types/src/interfaces/parachains/types.ts on lines 222..227

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

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 ContractExecResultTo260 extends Enum {
  readonly isSuccess: boolean;
  readonly asSuccess: ContractExecResultSuccessTo260;
  readonly isError: boolean;
  readonly type: 'Success' | 'Error';
Severity: Major
Found in packages/types/src/interfaces/contracts/types.ts and 5 other locations - About 55 mins to fix
packages/types/src/interfaces/contracts/types.ts on lines 109..114
packages/types/src/interfaces/contracts/types.ts on lines 454..459
packages/types/src/interfaces/eth/types.ts on lines 324..329
packages/types/src/interfaces/eth/types.ts on lines 359..364
packages/types/src/interfaces/parachains/types.ts on lines 222..227

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

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 EthSyncStatus extends Enum {
  readonly isInfo: boolean;
  readonly asInfo: EthSyncInfo;
  readonly isNone: boolean;
  readonly type: 'Info' | 'None';
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 5 other locations - About 55 mins to fix
packages/types/src/interfaces/contracts/types.ts on lines 109..114
packages/types/src/interfaces/contracts/types.ts on lines 117..122
packages/types/src/interfaces/contracts/types.ts on lines 454..459
packages/types/src/interfaces/eth/types.ts on lines 359..364
packages/types/src/interfaces/parachains/types.ts on lines 222..227

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

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

export interface DelayKind extends Enum {
  readonly isFinalized: boolean;
  readonly isBest: boolean;
  readonly asBest: DelayKindBest;
  readonly type: 'Finalized' | 'Best';
Severity: Major
Found in packages/types/src/interfaces/grandpa/types.ts and 7 other locations - About 55 mins to fix
packages/types/src/interfaces/babe/types.ts on lines 84..89
packages/types/src/interfaces/beefy/types.ts on lines 61..66
packages/types/src/interfaces/eth/types.ts on lines 294..299
packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
packages/types/src/interfaces/parachains/types.ts on lines 735..740
packages/types/src/interfaces/staking/types.ts on lines 130..135
packages/types/src/interfaces/xcm/types.ts on lines 1590..1595

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

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 CoreOccupied extends Enum {
  readonly isParathread: boolean;
  readonly asParathread: ParathreadEntry;
  readonly isParachain: boolean;
  readonly type: 'Parathread' | 'Parachain';
Severity: Major
Found in packages/types/src/interfaces/parachains/types.ts and 5 other locations - About 55 mins to fix
packages/types/src/interfaces/contracts/types.ts on lines 109..114
packages/types/src/interfaces/contracts/types.ts on lines 117..122
packages/types/src/interfaces/contracts/types.ts on lines 454..459
packages/types/src/interfaces/eth/types.ts on lines 324..329
packages/types/src/interfaces/eth/types.ts on lines 359..364

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

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 EthTransactionAction extends Enum {
  readonly isCall: boolean;
  readonly asCall: H160;
  readonly isCreate: boolean;
  readonly type: 'Call' | 'Create';
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 5 other locations - About 55 mins to fix
packages/types/src/interfaces/contracts/types.ts on lines 109..114
packages/types/src/interfaces/contracts/types.ts on lines 117..122
packages/types/src/interfaces/contracts/types.ts on lines 454..459
packages/types/src/interfaces/eth/types.ts on lines 324..329
packages/types/src/interfaces/parachains/types.ts on lines 222..227

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

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

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

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

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

Refactorings

Further Reading

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

const CORE_V1_TO_V4: DefinitionsCallEntry['methods'] = {
  execute_block: {
    description: 'Execute the given block.',
    params: [
      {
Severity: Major
Found in packages/types/src/interfaces/runtime/runtime.ts and 3 other locations - About 55 mins to fix
packages/types/src/interfaces/blockbuilder/runtime.ts on lines 15..26
packages/types/src/interfaces/parachains/runtime.ts on lines 189..200
packages/types/src/interfaces/runtime/runtime.ts on lines 27..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

    withPrefs
      ? combineLatest(stashIds.map((s) => api.query.staking.validators(s)))
      : of(stashIds.map(() => emptyPrefs)),
Severity: Major
Found in packages/api-derive/src/staking/query.ts and 2 other locations - About 55 mins to fix
packages/api-derive/src/staking/query.ts on lines 144..146
packages/api-derive/src/staking/query.ts on lines 147..149

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

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

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

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

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

Refactorings

Further Reading

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

    withDestination
      ? combineLatest(stashIds.map((s) => api.query.staking.payee(s)))
      : of(stashIds.map(() => emptyRewa)),
Severity: Major
Found in packages/api-derive/src/staking/query.ts and 2 other locations - About 55 mins to fix
packages/api-derive/src/staking/query.ts on lines 144..146
packages/api-derive/src/staking/query.ts on lines 150..152

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

const PH_V4: DefinitionsCallEntry['methods'] = {
  session_executor_params: {
    description: 'Returns execution parameters for the session.',
    params: [
      {
Severity: Major
Found in packages/types/src/interfaces/parachains/runtime.ts and 3 other locations - About 55 mins to fix
packages/types/src/interfaces/blockbuilder/runtime.ts on lines 15..26
packages/types/src/interfaces/runtime/runtime.ts on lines 6..17
packages/types/src/interfaces/runtime/runtime.ts on lines 27..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

const CORE_V2_TO_V4: DefinitionsCallEntry['methods'] = {
  initialize_block: {
    description: 'Initialize a block with the given header.',
    params: [
      {
Severity: Major
Found in packages/types/src/interfaces/runtime/runtime.ts and 3 other locations - About 55 mins to fix
packages/types/src/interfaces/blockbuilder/runtime.ts on lines 15..26
packages/types/src/interfaces/parachains/runtime.ts on lines 189..200
packages/types/src/interfaces/runtime/runtime.ts on lines 6..17

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

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

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

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

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

Refactorings

Further Reading

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

const BB_V2_TO_V5: DefinitionsCallEntry['methods'] = {
  apply_extrinsic: {
    description: 'Apply the given extrinsic.',
    params: [
      {
Severity: Major
Found in packages/types/src/interfaces/blockbuilder/runtime.ts and 3 other locations - About 55 mins to fix
packages/types/src/interfaces/parachains/runtime.ts on lines 189..200
packages/types/src/interfaces/runtime/runtime.ts on lines 6..17
packages/types/src/interfaces/runtime/runtime.ts on lines 27..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

    withNominations
      ? combineLatest(stashIds.map((s) => api.query.staking.nominators(s)))
      : of(stashIds.map(() => emptyNoms)),
Severity: Major
Found in packages/api-derive/src/staking/query.ts and 2 other locations - About 55 mins to fix
packages/api-derive/src/staking/query.ts on lines 147..149
packages/api-derive/src/staking/query.ts on lines 150..152

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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