polkadot-js/api

View on GitHub

Showing 2,442 of 2,627 total issues

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

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

  getKeys: {
    description: 'Returns the keys with prefix from a child storage, leave empty to get all the keys',
    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 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
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

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

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

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

      formatType(registry, {}, '(AccountId, (Balance, u32), u64)', {
        codecTypes: {},
        definitions: {},
        extrinsicTypes: {},
        genericTypes: {},
Severity: Major
Found in packages/typegen/src/util/formatting.spec.ts and 1 other location - About 1 hr to fix
packages/typegen/src/util/derived.spec.ts on lines 12..24

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

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

export interface PreimageStatusAvailable extends Struct {
  readonly data: Bytes;
  readonly provider: AccountId;
  readonly deposit: Balance;
  readonly since: BlockNumber;
Severity: Major
Found in packages/types/src/interfaces/democracy/types.ts and 5 other locations - About 1 hr to fix
packages/types/src/interfaces/metadata/types.ts on lines 439..445
packages/types/src/interfaces/metadata/types.ts on lines 448..454
packages/types/src/interfaces/metadata/types.ts on lines 460..466
packages/types/src/interfaces/metadata/types.ts on lines 469..475
packages/types/src/interfaces/metadata/types.ts on lines 478..484

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

export interface DispatchResultTo198 extends Result<ITuple<[]>, Text> {
  readonly isErr: boolean;
  readonly asErr: Text;
  readonly isOk: boolean;
  readonly asOk: ITuple<[]>;
Severity: Major
Found in packages/types/src/interfaces/system/types.ts and 3 other locations - About 1 hr to fix
packages/types/src/interfaces/system/types.ts on lines 214..219
packages/types/src/interfaces/system/types.ts on lines 222..227
packages/types/src/interfaces/system/types.ts on lines 230..235

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

export interface StorageEntryMetadataV10 extends Struct {
  readonly name: Text;
  readonly modifier: StorageEntryModifierV10;
  readonly type: StorageEntryTypeV10;
  readonly fallback: Bytes;
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 5 other locations - About 1 hr to fix
packages/types/src/interfaces/democracy/types.ts on lines 58..64
packages/types/src/interfaces/metadata/types.ts on lines 448..454
packages/types/src/interfaces/metadata/types.ts on lines 460..466
packages/types/src/interfaces/metadata/types.ts on lines 469..475
packages/types/src/interfaces/metadata/types.ts on lines 478..484

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

export interface StorageEntryMetadataV11 extends Struct {
  readonly name: Text;
  readonly modifier: StorageEntryModifierV11;
  readonly type: StorageEntryTypeV11;
  readonly fallback: Bytes;
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 5 other locations - About 1 hr to fix
packages/types/src/interfaces/democracy/types.ts on lines 58..64
packages/types/src/interfaces/metadata/types.ts on lines 439..445
packages/types/src/interfaces/metadata/types.ts on lines 460..466
packages/types/src/interfaces/metadata/types.ts on lines 469..475
packages/types/src/interfaces/metadata/types.ts on lines 478..484

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

export interface DispatchOutcomePre6 extends Result<ITuple<[]>, DispatchErrorPre6> {
  readonly isErr: boolean;
  readonly asErr: DispatchErrorPre6;
  readonly isOk: boolean;
  readonly asOk: ITuple<[]>;
Severity: Major
Found in packages/types/src/interfaces/system/types.ts and 3 other locations - About 1 hr to fix
packages/types/src/interfaces/system/types.ts on lines 214..219
packages/types/src/interfaces/system/types.ts on lines 230..235
packages/types/src/interfaces/system/types.ts on lines 241..246

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

export interface StorageEntryMetadataV14 extends Struct {
  readonly name: Text;
  readonly modifier: StorageEntryModifierV14;
  readonly type: StorageEntryTypeV14;
  readonly fallback: Bytes;
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 5 other locations - About 1 hr to fix
packages/types/src/interfaces/democracy/types.ts on lines 58..64
packages/types/src/interfaces/metadata/types.ts on lines 439..445
packages/types/src/interfaces/metadata/types.ts on lines 448..454
packages/types/src/interfaces/metadata/types.ts on lines 460..466
packages/types/src/interfaces/metadata/types.ts on lines 478..484

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

    session: {
      /**
       * New session has happened. Note that the argument is the session index, not the
       * block number as the type might suggest.
       **/
Severity: Major
Found in packages/api-augment/src/polkadot/events.ts and 3 other locations - About 1 hr to fix
packages/api-augment/src/kusama/events.ts on lines 1132..1142
packages/api-augment/src/substrate/events.ts on lines 2007..2017
packages/api-augment/src/substrate/events.ts on lines 2018..2027

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