polkadot-js/api

View on GitHub

Showing 2,327 of 2,507 total issues

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

    readonly asAttempted: {
      readonly registered: Option<u128>;
      readonly id: Null;
      readonly amount: u128;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3669..3673
packages/types-augment/src/lookup/types-substrate.ts on lines 4019..4023
packages/types-augment/src/lookup/types-substrate.ts on lines 4154..4158
packages/types/src/interfaces/metadata/types.ts on lines 595..599
packages/types/src/interfaces/xcm/types.ts on lines 874..878

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

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

    readonly asVote: {
      readonly proposal: H256;
      readonly index: Compact<u32>;
      readonly approve: bool;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1354..1358
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 390..394
packages/types-augment/src/lookup/types-substrate.ts on lines 1809..1813
packages/types-augment/src/lookup/types-substrate.ts on lines 3093..3097
packages/types-augment/src/lookup/types-substrate.ts on lines 3847..3851
packages/types-augment/src/lookup/types-substrate.ts on lines 4398..4402
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925

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

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

    readonly asForceCancelApproval: {
      readonly id: Compact<u32>;
      readonly owner: MultiAddress;
      readonly delegate: MultiAddress;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3669..3673
packages/types-augment/src/lookup/types-substrate.ts on lines 4019..4023
packages/types-augment/src/lookup/types-substrate.ts on lines 8401..8405
packages/types/src/interfaces/metadata/types.ts on lines 595..599
packages/types/src/interfaces/xcm/types.ts on lines 874..878

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

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

export interface WeightLimitV2 extends Enum {
  readonly isUnlimited: boolean;
  readonly isLimited: boolean;
  readonly asLimited: Compact<u64>;
  readonly type: 'Unlimited' | 'Limited';
Severity: Minor
Found in packages/types/src/interfaces/xcm/types.ts and 1 other location - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1580..1585

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

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

    readonly asVote: {
      readonly proposal: H256;
      readonly index: Compact<u32>;
      readonly approve: bool;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1354..1358
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 390..394
packages/types-augment/src/lookup/types-substrate.ts on lines 1809..1813
packages/types-augment/src/lookup/types-substrate.ts on lines 3847..3851
packages/types-augment/src/lookup/types-substrate.ts on lines 4398..4402
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925
packages/types-augment/src/lookup/types-substrate.ts on lines 5180..5184

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

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

  readonly asQueryHolding: {
    readonly queryId: Compact<u64>;
    readonly dest: MultiLocationV1;
    readonly assets: MultiAssetFilterV1;
  } & Struct;
Severity: Major
Found in packages/types/src/interfaces/xcm/types.ts and 5 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3669..3673
packages/types-augment/src/lookup/types-substrate.ts on lines 4019..4023
packages/types-augment/src/lookup/types-substrate.ts on lines 4154..4158
packages/types-augment/src/lookup/types-substrate.ts on lines 8401..8405
packages/types/src/interfaces/metadata/types.ts on lines 595..599

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

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

    readonly asAttributeCleared: {
      readonly collection: u32;
      readonly maybeItem: Option<u32>;
      readonly key: Bytes;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1354..1358
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 390..394
packages/types-augment/src/lookup/types-substrate.ts on lines 3093..3097
packages/types-augment/src/lookup/types-substrate.ts on lines 3847..3851
packages/types-augment/src/lookup/types-substrate.ts on lines 4398..4402
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925
packages/types-augment/src/lookup/types-substrate.ts on lines 5180..5184

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

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

    readonly asClearAttribute: {
      readonly collection: u32;
      readonly maybeItem: Option<u32>;
      readonly key: Bytes;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1354..1358
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 390..394
packages/types-augment/src/lookup/types-substrate.ts on lines 1809..1813
packages/types-augment/src/lookup/types-substrate.ts on lines 3093..3097
packages/types-augment/src/lookup/types-substrate.ts on lines 3847..3851
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925
packages/types-augment/src/lookup/types-substrate.ts on lines 5180..5184

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

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

    readonly asCreate: {
      readonly id: Compact<u32>;
      readonly admin: MultiAddress;
      readonly minBalance: u128;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3669..3673
packages/types-augment/src/lookup/types-substrate.ts on lines 4154..4158
packages/types-augment/src/lookup/types-substrate.ts on lines 8401..8405
packages/types/src/interfaces/metadata/types.ts on lines 595..599
packages/types/src/interfaces/xcm/types.ts on lines 874..878

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

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

  readonly asMap: {
    readonly hashers: Vec<StorageHasherV14>;
    readonly key: SiLookupTypeId;
    readonly value: SiLookupTypeId;
  } & Struct;
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 5 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 3669..3673
packages/types-augment/src/lookup/types-substrate.ts on lines 4019..4023
packages/types-augment/src/lookup/types-substrate.ts on lines 4154..4158
packages/types-augment/src/lookup/types-substrate.ts on lines 8401..8405
packages/types/src/interfaces/xcm/types.ts on lines 874..878

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

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

    readonly asCreateRecovery: {
      readonly friends: Vec<AccountId32>;
      readonly threshold: u16;
      readonly delayPeriod: u32;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 5 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 4019..4023
packages/types-augment/src/lookup/types-substrate.ts on lines 4154..4158
packages/types-augment/src/lookup/types-substrate.ts on lines 8401..8405
packages/types/src/interfaces/metadata/types.ts on lines 595..599
packages/types/src/interfaces/xcm/types.ts on lines 874..878

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

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

    readonly asProxy: {
      readonly real: MultiAddress;
      readonly forceProxyType: Option<KitchensinkRuntimeProxyType>;
      readonly call: Call;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1354..1358
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 390..394
packages/types-augment/src/lookup/types-substrate.ts on lines 1809..1813
packages/types-augment/src/lookup/types-substrate.ts on lines 3093..3097
packages/types-augment/src/lookup/types-substrate.ts on lines 4398..4402
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925
packages/types-augment/src/lookup/types-substrate.ts on lines 5180..5184

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

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

    readonly asTransact: {
      readonly originType: XcmV2OriginKind;
      readonly requireWeightAtMost: Compact<u64>;
      readonly call: XcmDoubleEncoded;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 390..394
packages/types-augment/src/lookup/types-substrate.ts on lines 1809..1813
packages/types-augment/src/lookup/types-substrate.ts on lines 3093..3097
packages/types-augment/src/lookup/types-substrate.ts on lines 3847..3851
packages/types-augment/src/lookup/types-substrate.ts on lines 4398..4402
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925
packages/types-augment/src/lookup/types-substrate.ts on lines 5180..5184

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

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

function singleParamNotation (registry: Registry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
  const sub = (typeDef.sub as TypeDef);

  setImports(definitions, imports, [wrapper, sub.lookupName]);

Severity: Minor
Found in packages/typegen/src/util/formatting.ts and 1 other location - About 35 mins to fix
packages/typegen/src/util/formatting.ts on lines 125..134

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

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

    readonly asSolutionStored: {
      readonly compute: PalletElectionProviderMultiPhaseElectionCompute;
      readonly origin: Option<AccountId32>;
      readonly prevEjected: bool;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 8 other locations - About 35 mins to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1354..1358
packages/types-augment/src/lookup/types-polkadot.ts on lines 1385..1389
packages/types-augment/src/lookup/types-substrate.ts on lines 1809..1813
packages/types-augment/src/lookup/types-substrate.ts on lines 3093..3097
packages/types-augment/src/lookup/types-substrate.ts on lines 3847..3851
packages/types-augment/src/lookup/types-substrate.ts on lines 4398..4402
packages/types-augment/src/lookup/types-substrate.ts on lines 4921..4925
packages/types-augment/src/lookup/types-substrate.ts on lines 5180..5184

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

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

function dualParamsNotation (registry: Registry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
  const [a, b] = (typeDef.sub as TypeDef[]);

  setImports(definitions, imports, [wrapper, a.lookupName, b.lookupName]);

Severity: Minor
Found in packages/typegen/src/util/formatting.ts and 1 other location - About 35 mins to fix
packages/typegen/src/util/formatting.ts on lines 117..123

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

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

  interface XcmV2WeightLimit extends Enum {
    readonly isUnlimited: boolean;
    readonly isLimited: boolean;
    readonly asLimited: Compact<u64>;
    readonly type: 'Unlimited' | 'Limited';
Severity: Minor
Found in packages/types-augment/src/lookup/types-polkadot.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/xcm/types.ts on lines 622..627

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

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

      methods: {
        authorities: {
          description: 'Return the current set of authorities.',
          params: [],
          type: 'Vec<AuthorityId>'
Severity: Minor
Found in packages/types/src/interfaces/aura/runtime.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/beefy/runtime.ts on lines 47..58

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

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

mockU32EnumMap.set(new MockEnum(registry, { Key1: new MockStruct(registry, { int: -1, text: 'b' }) }), new U32(registry, 69));
Severity: Minor
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 1 other location - About 35 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 55..55

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

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

const BEEFY_MMR_V1: Record<string, DefinitionCall> = {
  authority_set_proof: {
    description: 'Return the currently active BEEFY authority set proof.',
    params: [],
    type: 'BeefyAuthoritySet'
Severity: Minor
Found in packages/types/src/interfaces/beefy/runtime.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/aura/runtime.ts on lines 9..20

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

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