polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

export interface XcmPaymentApiError extends Enum {
  readonly isUnimplemented: boolean;
  readonly isVersionedConversionFailed: boolean;
  readonly isWeightNotComputable: boolean;
  readonly isUnhandledXcmVersion: boolean;
Severity: Major
Found in packages/types/src/interfaces/xcmPaymentApi/types.ts and 1 other location - About 1 hr to fix
packages/types/src/interfaces/metadata/types.ts on lines 661..668

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

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 StorageHasherV9 extends Enum {
  readonly isBlake2128: boolean;
  readonly isBlake2256: boolean;
  readonly isTwox128: boolean;
  readonly isTwox256: boolean;
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 1 other location - About 1 hr to fix
packages/types/src/interfaces/xcmPaymentApi/types.ts on lines 7..14

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

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

    expect(
      registry.createType('Extrinsic', tx['timestamp']['set'](63)).toU8a()
    ).toEqual(
      new Uint8Array([
        // length (encoded)
Severity: Major
Found in packages/types/src/metadata/decorate/index.spec.ts and 1 other location - About 1 hr to fix
packages/types/src/metadata/decorate/extrinsics/index.spec.ts on lines 68..81

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

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

  interface StagingKusamaRuntimeSessionKeys extends Struct {
    readonly grandpa: SpConsensusGrandpaAppPublic;
    readonly babe: SpConsensusBabeAppPublic;
    readonly paraValidator: PolkadotPrimitivesV7ValidatorAppPublic;
    readonly paraAssignment: PolkadotPrimitivesV7AssignmentAppPublic;
Severity: Major
Found in packages/types-augment/src/lookup/types-kusama.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

  interface PalletBountiesBounty extends Struct {
    readonly proposer: AccountId32;
    readonly value: u128;
    readonly fee: u128;
    readonly curatorDeposit: u128;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

  interface PolkadotRuntimeSessionKeys extends Struct {
    readonly grandpa: SpConsensusGrandpaAppPublic;
    readonly babe: SpConsensusBabeAppPublic;
    readonly paraValidator: PolkadotPrimitivesV6ValidatorAppPublic;
    readonly paraAssignment: PolkadotPrimitivesV6AssignmentAppPublic;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

  interface PalletTreasurySpendStatus extends Struct {
    readonly assetKind: u32;
    readonly amount: u128;
    readonly beneficiary: AccountId32;
    readonly validFrom: u32;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

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

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

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

Refactorings

Further Reading

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

  afterEach(async () => {
    global.WebSocket = globalWs;

    if (mock) {
      await mock.done();
Severity: Major
Found in packages/rpc-provider/src/ws/send.spec.ts and 2 other locations - About 1 hr to fix
packages/rpc-provider/src/ws/subscribe.spec.ts on lines 36..47
packages/rpc-provider/src/ws/unsubscribe.spec.ts on lines 36..47

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

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

  interface KitchensinkRuntimeSessionKeys extends Struct {
    readonly grandpa: SpConsensusGrandpaAppPublic;
    readonly babe: SpConsensusBabeAppPublic;
    readonly imOnline: PalletImOnlineSr25519AppSr25519Public;
    readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

  interface PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest extends Struct {
    readonly confirmed: bool;
    readonly age: u32;
    readonly senderDeposit: u128;
    readonly maxMessageSize: u32;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

  interface PalletNftsCollectionDetails extends Struct {
    readonly owner: AccountId32;
    readonly ownerDeposit: u128;
    readonly items: u32;
    readonly itemMetadatas: u32;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

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

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

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

Refactorings

Further Reading

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

  afterEach(async () => {
    global.WebSocket = globalWs;

    if (mock) {
      await mock.done();
Severity: Major
Found in packages/rpc-provider/src/ws/unsubscribe.spec.ts and 2 other locations - About 1 hr to fix
packages/rpc-provider/src/ws/send.spec.ts on lines 36..47
packages/rpc-provider/src/ws/subscribe.spec.ts on lines 36..47

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

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

  interface PalletContractsEnvironment extends Struct {
    readonly accountId: PalletContractsEnvironmentTypeAccountId32;
    readonly balance: PalletContractsEnvironmentTypeU128;
    readonly hash_: PalletContractsEnvironmentTypeH256;
    readonly hasher: PalletContractsEnvironmentTypeBlakeTwo256;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231
packages/types-augment/src/lookup/types-substrate.ts on lines 8958..8965

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

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

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

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

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

Refactorings

Further Reading

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

  afterEach(async () => {
    global.WebSocket = globalWs;

    if (mock) {
      await mock.done();
Severity: Major
Found in packages/rpc-provider/src/ws/subscribe.spec.ts and 2 other locations - About 1 hr to fix
packages/rpc-provider/src/ws/send.spec.ts on lines 36..47
packages/rpc-provider/src/ws/unsubscribe.spec.ts on lines 36..47

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

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

  getStorage: {
    description: 'Returns a child storage entry at a specific block state',
    params: [
      {
        name: 'childKey',
Severity: Major
Found in packages/types/src/interfaces/childstate/rpc.ts and 6 other locations - About 1 hr to fix
packages/types/src/interfaces/childstate/rpc.ts on lines 7..26
packages/types/src/interfaces/childstate/rpc.ts on lines 77..96
packages/types/src/interfaces/childstate/rpc.ts on lines 97..116
packages/types/src/interfaces/childstate/rpc.ts on lines 117..136
packages/types/src/interfaces/eth/rpc.ts on lines 247..266
packages/types/src/interfaces/state/rpc.ts on lines 56..75

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

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

  getStorageAt: {
    description: 'Returns content of the storage at given address.',
    params: [
      {
        name: 'address',
Severity: Major
Found in packages/types/src/interfaces/eth/rpc.ts and 6 other locations - About 1 hr to fix
packages/types/src/interfaces/childstate/rpc.ts on lines 7..26
packages/types/src/interfaces/childstate/rpc.ts on lines 57..76
packages/types/src/interfaces/childstate/rpc.ts on lines 77..96
packages/types/src/interfaces/childstate/rpc.ts on lines 97..116
packages/types/src/interfaces/childstate/rpc.ts on lines 117..136
packages/types/src/interfaces/state/rpc.ts on lines 56..75

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

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

  getStorageEntries: {
    description: 'Returns child storage entries for multiple keys at a specific block state',
    params: [
      {
        name: 'childKey',
Severity: Major
Found in packages/types/src/interfaces/childstate/rpc.ts and 6 other locations - About 1 hr to fix
packages/types/src/interfaces/childstate/rpc.ts on lines 7..26
packages/types/src/interfaces/childstate/rpc.ts on lines 57..76
packages/types/src/interfaces/childstate/rpc.ts on lines 97..116
packages/types/src/interfaces/childstate/rpc.ts on lines 117..136
packages/types/src/interfaces/eth/rpc.ts on lines 247..266
packages/types/src/interfaces/state/rpc.ts on lines 56..75

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

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

  getChildReadProof: {
    description: 'Returns proof of storage for child key entries at a specific block state.',
    params: [
      {
        name: 'childStorageKey',
Severity: Major
Found in packages/types/src/interfaces/state/rpc.ts and 6 other locations - About 1 hr to fix
packages/types/src/interfaces/childstate/rpc.ts on lines 7..26
packages/types/src/interfaces/childstate/rpc.ts on lines 57..76
packages/types/src/interfaces/childstate/rpc.ts on lines 77..96
packages/types/src/interfaces/childstate/rpc.ts on lines 97..116
packages/types/src/interfaces/childstate/rpc.ts on lines 117..136
packages/types/src/interfaces/eth/rpc.ts on lines 247..266

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

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

  interface PalletMessageQueuePage extends Struct {
    readonly remaining: u32;
    readonly remainingSize: u32;
    readonly firstIndex: u32;
    readonly first: u32;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 14..21
packages/types-augment/src/lookup/types-polkadot.ts on lines 414..421
packages/types-augment/src/lookup/types-polkadot.ts on lines 3066..3073
packages/types-augment/src/lookup/types-substrate.ts on lines 2971..2978
packages/types-augment/src/lookup/types-substrate.ts on lines 7395..7402
packages/types-augment/src/lookup/types-substrate.ts on lines 7490..7497
packages/types-augment/src/lookup/types-substrate.ts on lines 7918..7925
packages/types-augment/src/lookup/types-substrate.ts on lines 8224..8231

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

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

  getStorageSize: {
    description: 'Returns the size of a child storage entry at a block state',
    params: [
      {
        name: 'childKey',
Severity: Major
Found in packages/types/src/interfaces/childstate/rpc.ts and 6 other locations - About 1 hr to fix
packages/types/src/interfaces/childstate/rpc.ts on lines 7..26
packages/types/src/interfaces/childstate/rpc.ts on lines 57..76
packages/types/src/interfaces/childstate/rpc.ts on lines 77..96
packages/types/src/interfaces/childstate/rpc.ts on lines 97..116
packages/types/src/interfaces/eth/rpc.ts on lines 247..266
packages/types/src/interfaces/state/rpc.ts on lines 56..75

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

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