polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

    slots: {
      /**
       * The number of blocks to offset each lease period by.
       **/
      leaseOffset: u32 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/polkadot/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    coretime: {
      /**
       * The ParaId of the coretime chain.
       **/
      brokerId: u32 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    scheduler: {
      /**
       * The maximum weight that may be scheduled per block for any dispatchables.
       **/
      maximumWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/polkadot/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    slots: {
      /**
       * The number of blocks to offset each lease period by.
       **/
      leaseOffset: u32 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    coreFellowship: {
      /**
       * The maximum size in bytes submitted evidence is allowed to be.
       **/
      evidenceSize: u32 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/substrate/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    scheduler: {
      /**
       * The maximum weight that may be scheduled per block for any dispatchables.
       **/
      maximumWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/substrate/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851

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

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

    registrar: {
      /**
       * The deposit to be paid per byte stored on chain.
       **/
      dataDepositPerByte: u128 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/polkadot/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    registrar: {
      /**
       * The deposit to be paid per byte stored on chain.
       **/
      dataDepositPerByte: u128 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    convictionVoting: {
      /**
       * The maximum number of concurrent votes an account may have.
       * 
       * Also used to compute weight, an overly large value can lead to extrinsics with large
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 280..293
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

    childBounties: {
      /**
       * Minimum value for a child-bounty.
       **/
      childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/substrate/consts.ts and 15 other locations - About 1 hr to fix
packages/api-augment/src/kusama/consts.ts on lines 168..181
packages/api-augment/src/kusama/consts.ts on lines 189..208
packages/api-augment/src/kusama/consts.ts on lines 209..222
packages/api-augment/src/kusama/consts.ts on lines 709..723
packages/api-augment/src/kusama/consts.ts on lines 724..741
packages/api-augment/src/kusama/consts.ts on lines 742..755
packages/api-augment/src/polkadot/consts.ts on lines 164..177
packages/api-augment/src/polkadot/consts.ts on lines 185..204
packages/api-augment/src/polkadot/consts.ts on lines 546..560
packages/api-augment/src/polkadot/consts.ts on lines 561..578
packages/api-augment/src/polkadot/consts.ts on lines 579..592
packages/api-augment/src/substrate/consts.ts on lines 382..401
packages/api-augment/src/substrate/consts.ts on lines 402..417
packages/api-augment/src/substrate/consts.ts on lines 832..851
packages/api-augment/src/substrate/consts.ts on lines 1304..1321

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

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

  return memo(instanceId, (accountId?: AccountId | Uint8Array | string): Observable<[Option<ITuple<[PalletIdentityRegistration, Option<Bytes>]>> | Option<PalletIdentityRegistration> | undefined, Option<ITuple<[AccountId, Data]>> | undefined]> =>
Severity: Major
Found in packages/api-derive/src/accounts/identity.ts and 1 other location - About 1 hr to fix
packages/api-derive/src/accounts/identity.ts on lines 115..115

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

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 function _identity (instanceId: string, api: DeriveApi): (accountId?: AccountId | Uint8Array | string) => Observable<[Option<ITuple<[PalletIdentityRegistration, Option<Bytes>]>> | Option<PalletIdentityRegistration> | undefined, Option<ITuple<[AccountId, Data]>> | undefined]> {
Severity: Major
Found in packages/api-derive/src/accounts/identity.ts and 1 other location - About 1 hr to fix
packages/api-derive/src/accounts/identity.ts on lines 116..116

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

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

    expect(
      registry.hash(u8aToU8a('abc')).toU8a()
    ).toEqual(
      new Uint8Array([189, 221, 129, 60, 99, 66, 57, 114, 49, 113, 239, 63, 238, 152, 87, 155, 148, 150, 78, 59, 177, 203, 62, 66, 114, 98, 200, 192, 104, 213, 35, 25])
    );
Severity: Major
Found in packages/types/src/create/registry.spec.ts and 1 other location - About 1 hr to fix
packages/types/src/create/registry.spec.ts on lines 180..184

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

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

    expect(
      registry.hash(u8aToU8a('abc')).toU8a()
    ).toEqual(
      new Uint8Array([189, 221, 129, 60, 99, 66, 57, 114, 49, 113, 239, 63, 238, 152, 87, 155, 148, 150, 78, 59, 177, 203, 62, 66, 114, 98, 200, 192, 104, 213, 35, 25])
    );
Severity: Major
Found in packages/types/src/create/registry.spec.ts and 1 other location - About 1 hr to fix
packages/types/src/create/registry.spec.ts on lines 164..168

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

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

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

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

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

Refactorings

Further Reading

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

    {
      methods: {
        validate_transaction: {
          description: 'Validate the transaction.',
          params: [
Severity: Major
Found in packages/types/src/interfaces/txqueue/runtime.ts and 2 other locations - About 1 hr to fix
packages/types/src/interfaces/nimbus/runtime.ts on lines 9..31
packages/types/src/interfaces/nimbus/runtime.ts on lines 53..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 71.

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

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

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

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

Refactorings

Further Reading

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

  EthReceipt: {
    transactionHash: 'Option<H256>',
    transactionIndex: 'Option<U256>',
    blockHash: 'Option<H256>',
    from: 'Option<EthAddress>',
Severity: Major
Found in packages/types/src/interfaces/eth/definitions.ts and 2 other locations - About 1 hr to fix
packages/types/src/interfaces/parachains/definitions.ts on lines 477..491
packages/types/src/interfaces/system/definitions.ts on lines 77..91

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

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

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

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

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

Refactorings

Further Reading

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

    SessionInfo: {
      activeValidatorIndices: 'Vec<ParaValidatorIndex>',
      randomSeed: '[u8; 32]',
      disputePeriod: 'SessionIndex',
      validators: 'Vec<ValidatorId>',
Severity: Major
Found in packages/types/src/interfaces/parachains/definitions.ts and 2 other locations - About 1 hr to fix
packages/types/src/interfaces/eth/definitions.ts on lines 246..260
packages/types/src/interfaces/system/definitions.ts on lines 77..91

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

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

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

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

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

Refactorings

Further Reading

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

export interface Bounty extends Struct {
  readonly proposer: AccountId;
  readonly value: Balance;
  readonly fee: Balance;
  readonly curatorDeposit: Balance;
Severity: Major
Found in packages/types/src/interfaces/treasury/types.ts and 2 other locations - About 1 hr to fix
packages/types/src/interfaces/contracts/types.ts on lines 321..328
packages/types/src/interfaces/parachains/types.ts on lines 424..431

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

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

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

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

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

Refactorings

Further Reading

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

    {
      methods: {
        can_author: {
          description: 'The runtime api used to predict whether a Nimbus author will be eligible in the given slot',
          params: [
Severity: Major
Found in packages/types/src/interfaces/nimbus/runtime.ts and 2 other locations - About 1 hr to fix
packages/types/src/interfaces/nimbus/runtime.ts on lines 9..31
packages/types/src/interfaces/txqueue/runtime.ts on lines 8..30

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

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

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

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

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

Refactorings

Further Reading

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

export interface Si1Field extends Struct {
  readonly name: Option<Text>;
  readonly type: Si1LookupTypeId;
  readonly typeName: Option<Text>;
  readonly docs: Vec<Text>;
Severity: Major
Found in packages/types/src/interfaces/scaleInfo/types.ts and 2 other locations - About 1 hr to fix
packages/types/src/interfaces/contractsAbi/types.ts on lines 21..26
packages/types/src/interfaces/scaleInfo/types.ts on lines 7..12

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

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