polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

  interface PalletAssetsAssetStatus extends Enum {
    readonly isLive: boolean;
    readonly isFrozen: boolean;
    readonly isDestroying: boolean;
    readonly type: 'Live' | 'Frozen' | 'Destroying';
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 14 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 630..635
packages/types-augment/src/lookup/types-substrate.ts on lines 113..118
packages/types-augment/src/lookup/types-substrate.ts on lines 172..177
packages/types-augment/src/lookup/types-substrate.ts on lines 650..655
packages/types-augment/src/lookup/types-substrate.ts on lines 2624..2629
packages/types-augment/src/lookup/types-substrate.ts on lines 4774..4779
packages/types-augment/src/lookup/types-substrate.ts on lines 5482..5487
packages/types-augment/src/lookup/types-substrate.ts on lines 6916..6921
packages/types-augment/src/lookup/types-substrate.ts on lines 7342..7347
packages/types-augment/src/lookup/types-substrate.ts on lines 7435..7440
packages/types-augment/src/lookup/types-substrate.ts on lines 8022..8027
packages/types-augment/src/lookup/types-substrate.ts on lines 8234..8239
packages/types-augment/src/lookup/types-substrate.ts on lines 8517..8522
packages/types-augment/src/lookup/types-substrate.ts on lines 8693..8698

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

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

  interface PalletAssetsAccountStatus extends Enum {
    readonly isLiquid: boolean;
    readonly isFrozen: boolean;
    readonly isBlocked: boolean;
    readonly type: 'Liquid' | 'Frozen' | 'Blocked';
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 14 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 630..635
packages/types-augment/src/lookup/types-substrate.ts on lines 113..118
packages/types-augment/src/lookup/types-substrate.ts on lines 172..177
packages/types-augment/src/lookup/types-substrate.ts on lines 650..655
packages/types-augment/src/lookup/types-substrate.ts on lines 2624..2629
packages/types-augment/src/lookup/types-substrate.ts on lines 4774..4779
packages/types-augment/src/lookup/types-substrate.ts on lines 5482..5487
packages/types-augment/src/lookup/types-substrate.ts on lines 6916..6921
packages/types-augment/src/lookup/types-substrate.ts on lines 7342..7347
packages/types-augment/src/lookup/types-substrate.ts on lines 7435..7440
packages/types-augment/src/lookup/types-substrate.ts on lines 8006..8011
packages/types-augment/src/lookup/types-substrate.ts on lines 8234..8239
packages/types-augment/src/lookup/types-substrate.ts on lines 8517..8522
packages/types-augment/src/lookup/types-substrate.ts on lines 8693..8698

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

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

  interface FrameSupportDispatchDispatchClass extends Enum {
    readonly isNormal: boolean;
    readonly isOperational: boolean;
    readonly isMandatory: boolean;
    readonly type: 'Normal' | 'Operational' | 'Mandatory';
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 14 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 630..635
packages/types-augment/src/lookup/types-substrate.ts on lines 172..177
packages/types-augment/src/lookup/types-substrate.ts on lines 650..655
packages/types-augment/src/lookup/types-substrate.ts on lines 2624..2629
packages/types-augment/src/lookup/types-substrate.ts on lines 4774..4779
packages/types-augment/src/lookup/types-substrate.ts on lines 5482..5487
packages/types-augment/src/lookup/types-substrate.ts on lines 6916..6921
packages/types-augment/src/lookup/types-substrate.ts on lines 7342..7347
packages/types-augment/src/lookup/types-substrate.ts on lines 7435..7440
packages/types-augment/src/lookup/types-substrate.ts on lines 8006..8011
packages/types-augment/src/lookup/types-substrate.ts on lines 8022..8027
packages/types-augment/src/lookup/types-substrate.ts on lines 8234..8239
packages/types-augment/src/lookup/types-substrate.ts on lines 8517..8522
packages/types-augment/src/lookup/types-substrate.ts on lines 8693..8698

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

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

  interface PalletParametersCall extends Enum {
    readonly isSetParameter: boolean;
    readonly asSetParameter: {
      readonly keyValue: KitchensinkRuntimeRuntimeParameters;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 814..820
packages/types-augment/src/lookup/types-polkadot.ts on lines 992..998
packages/types-augment/src/lookup/types-substrate.ts on lines 558..564
packages/types-augment/src/lookup/types-substrate.ts on lines 5125..5131
packages/types-augment/src/lookup/types-substrate.ts on lines 6734..6740

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

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

  interface PolkadotRuntimeParachainsParasInherentPalletCall extends Enum {
    readonly isEnter: boolean;
    readonly asEnter: {
      readonly data: PolkadotPrimitivesV6InherentData;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 5 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 992..998
packages/types-augment/src/lookup/types-substrate.ts on lines 558..564
packages/types-augment/src/lookup/types-substrate.ts on lines 5125..5131
packages/types-augment/src/lookup/types-substrate.ts on lines 5948..5954
packages/types-augment/src/lookup/types-substrate.ts on lines 6734..6740

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

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

  interface PalletSkipFeelessPaymentEvent extends Enum {
    readonly isFeeSkipped: boolean;
    readonly asFeeSkipped: {
      readonly who: AccountId32;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 814..820
packages/types-augment/src/lookup/types-polkadot.ts on lines 992..998
packages/types-augment/src/lookup/types-substrate.ts on lines 558..564
packages/types-augment/src/lookup/types-substrate.ts on lines 5125..5131
packages/types-augment/src/lookup/types-substrate.ts on lines 5948..5954

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

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

  interface PalletRemarkCall extends Enum {
    readonly isStore: boolean;
    readonly asStore: {
      readonly remark: Bytes;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 814..820
packages/types-augment/src/lookup/types-polkadot.ts on lines 992..998
packages/types-augment/src/lookup/types-substrate.ts on lines 558..564
packages/types-augment/src/lookup/types-substrate.ts on lines 5948..5954
packages/types-augment/src/lookup/types-substrate.ts on lines 6734..6740

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

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

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

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

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

Refactorings

Further Reading

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

    expect(
      new (BTreeMap.with(U32TextTuple, U32))(
        registry,
        new (BTreeMap.with(U32TextTuple, U32))(registry, mockU32TupleMap).toJSON()
      ).toJSON()
Severity: Major
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 4 other locations - About 50 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 164..169
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 173..178
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 191..201
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 205..216

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

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

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

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

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

Refactorings

Further Reading

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

    expect(
      new (BTreeMap.with(MockEnum, U32))(
        registry,
        new (BTreeMap.with(MockEnum, U32))(registry, mockU32EnumMap).toJSON()
      ).toJSON()
Severity: Major
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 4 other locations - About 50 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 164..169
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 173..178
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 182..187
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 191..201

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

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

  interface PolkadotRuntimeParachainsInitializerPalletCall extends Enum {
    readonly isForceApprove: boolean;
    readonly asForceApprove: {
      readonly upTo: u32;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 5 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 814..820
packages/types-augment/src/lookup/types-substrate.ts on lines 558..564
packages/types-augment/src/lookup/types-substrate.ts on lines 5125..5131
packages/types-augment/src/lookup/types-substrate.ts on lines 5948..5954
packages/types-augment/src/lookup/types-substrate.ts on lines 6734..6740

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

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

    readonly asAddChildBounty: {
      readonly parentBountyId: Compact<u32>;
      readonly value: Compact<u128>;
      readonly description: Bytes;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 3 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3088..3092
packages/types-augment/src/lookup/types-substrate.ts on lines 5053..5057
packages/types/src/interfaces/metadata/types.ts on lines 582..586

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

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

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

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

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

Refactorings

Further Reading

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

    expect(
      new (BTreeMap.with(MockStruct, U32))(
        registry,
        new (BTreeMap.with(MockStruct, U32))(registry, mockU32StructMap).toJSON()
      ).toJSON()
Severity: Major
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 4 other locations - About 50 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 164..169
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 173..178
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 182..187
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 205..216

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

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

    readonly asSetMembers: {
      readonly newMembers: Vec<AccountId32>;
      readonly prime: Option<AccountId32>;
      readonly oldCount: u32;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 3 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 5030..5034
packages/types-augment/src/lookup/types-substrate.ts on lines 5053..5057
packages/types/src/interfaces/metadata/types.ts on lines 582..586

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

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

  interface PalletSessionEvent extends Enum {
    readonly isNewSession: boolean;
    readonly asNewSession: {
      readonly sessionIndex: u32;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 814..820
packages/types-augment/src/lookup/types-polkadot.ts on lines 992..998
packages/types-augment/src/lookup/types-substrate.ts on lines 5125..5131
packages/types-augment/src/lookup/types-substrate.ts on lines 5948..5954
packages/types-augment/src/lookup/types-substrate.ts on lines 6734..6740

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

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

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

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

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

Refactorings

Further Reading

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

    expect(
      new (BTreeMap.with(Text, U32))(
        registry,
        new (BTreeMap.with(Text, U32))(registry, mockU32TextMap).toJSON()
      ).toJSON()
Severity: Major
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 4 other locations - About 50 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 164..169
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 182..187
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 191..201
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 205..216

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

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

      validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<ValidationCode>>>;
Severity: Major
Found in packages/api-augment/src/polkadot/runtime.ts and 3 other locations - About 50 mins to fix
packages/api-augment/src/kusama/runtime.ts on lines 368..368
packages/api-augment/src/kusama/runtime.ts on lines 424..424
packages/api-augment/src/polkadot/runtime.ts on lines 333..333

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

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

    readonly asAwardChildBounty: {
      readonly parentBountyId: Compact<u32>;
      readonly childBountyId: Compact<u32>;
      readonly beneficiary: MultiAddress;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 3 other locations - About 50 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3088..3092
packages/types-augment/src/lookup/types-substrate.ts on lines 5030..5034
packages/types/src/interfaces/metadata/types.ts on lines 582..586

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

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

  try {
    proposal = api.registry.createType('Call', bytes.toU8a(true));
  } catch (error) {
    console.error(error);
  }
Severity: Minor
Found in packages/api-derive/src/democracy/preimages.ts and 1 other location - About 50 mins to fix
packages/api-derive/src/democracy/preimages.ts on lines 80..84

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

    expect(
      new (BTreeMap.with(I32, U32))(
        registry,
        new (BTreeMap.with(I32, U32))(registry, mockU32I32Map).toJSON()
      ).toJSON()
Severity: Major
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 4 other locations - About 50 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 173..178
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 182..187
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 191..201
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 205..216

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

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

    try {
      proposal = api.registry.createType('Call', bytes.toU8a(true));
    } catch (error) {
      console.error(error);
    }
Severity: Minor
Found in packages/api-derive/src/democracy/preimages.ts and 1 other location - About 50 mins to fix
packages/api-derive/src/democracy/preimages.ts on lines 40..44

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

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