polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

      classAccount: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
Severity: Major
Found in packages/api-augment/src/substrate/query.ts and 2 other locations - About 2 hrs to fix
packages/api-augment/src/substrate/query.ts on lines 1223..1223
packages/api-augment/src/substrate/query.ts on lines 1685..1685

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

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

  [
    21460051,
    1014000,
    [
      [
Severity: Major
Found in packages/types-known/src/upgrades/e2e/westend.ts and 1 other location - About 2 hrs to fix
packages/types-known/src/upgrades/e2e/westend.ts on lines 5862..5955

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

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

  [
    21925427,
    1015000,
    [
      [
Severity: Major
Found in packages/types-known/src/upgrades/e2e/westend.ts and 1 other location - About 2 hrs to fix
packages/types-known/src/upgrades/e2e/westend.ts on lines 5768..5861

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

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 DeriveContractFees {
  callBaseFee: BN;
  contractFee: BN;
  creationFee: BN;
  rentByteFee: BN;
Severity: Major
Found in packages/api-derive/src/types.ts and 2 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 8165..8176
packages/types/src/interfaces/uniques/types.ts on lines 8..19

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

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 ClassDetails extends Struct {
  readonly owner: AccountId;
  readonly issuer: AccountId;
  readonly admin: AccountId;
  readonly freezer: AccountId;
Severity: Major
Found in packages/types/src/interfaces/uniques/types.ts and 2 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 8165..8176
packages/api-derive/src/types.ts on lines 28..39

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

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

  interface PalletUniquesCollectionDetails extends Struct {
    readonly owner: AccountId32;
    readonly issuer: AccountId32;
    readonly admin: AccountId32;
    readonly freezer: AccountId32;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 2 other locations - About 2 hrs to fix
packages/types/src/interfaces/uniques/types.ts on lines 8..19
packages/api-derive/src/types.ts on lines 28..39

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

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

  interface PalletBeefyError extends Enum {
    readonly isInvalidKeyOwnershipProof: boolean;
    readonly isInvalidDoubleVotingProof: boolean;
    readonly isInvalidForkVotingProof: boolean;
    readonly isInvalidFutureBlockVotingProof: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PalletSafeModeError extends Enum {
    readonly isEntered: boolean;
    readonly isExited: boolean;
    readonly isNotConfigured: boolean;
    readonly isNoDeposit: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836

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

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

  interface PalletLotteryError extends Enum {
    readonly isNotConfigured: boolean;
    readonly isInProgress: boolean;
    readonly isAlreadyEnded: boolean;
    readonly isInvalidCall: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PolkadotRuntimeCommonAuctionsPalletError extends Enum {
    readonly isAuctionInProgress: boolean;
    readonly isLeasePeriodInPast: boolean;
    readonly isParaNotRegistered: boolean;
    readonly isNotCurrentAuction: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PalletTipsError extends Enum {
    readonly isReasonTooBig: boolean;
    readonly isAlreadyKnown: boolean;
    readonly isUnknownTip: boolean;
    readonly isMaxTipAmountExceeded: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PalletConvictionVotingConviction extends Enum {
    readonly isNone: boolean;
    readonly isLocked1x: boolean;
    readonly isLocked2x: boolean;
    readonly isLocked3x: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PalletDemocracyConviction extends Enum {
    readonly isNone: boolean;
    readonly isLocked1x: boolean;
    readonly isLocked2x: boolean;
    readonly isLocked3x: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PalletNominationPoolsDefensiveError extends Enum {
    readonly isNotEnoughSpaceInUnbondPool: boolean;
    readonly isPoolNotFound: boolean;
    readonly isRewardPoolNotFound: boolean;
    readonly isSubPoolsNotFound: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PolkadotRuntimeParachainsParasParaLifecycle extends Enum {
    readonly isOnboarding: boolean;
    readonly isParathread: boolean;
    readonly isParachain: boolean;
    readonly isUpgradingParathread: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7375..7384
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  interface PalletGrandpaError extends Enum {
    readonly isPauseFailed: boolean;
    readonly isResumeFailed: boolean;
    readonly isChangePending: boolean;
    readonly isTooSoon: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 9 other locations - About 2 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 2992..3001
packages/types-augment/src/lookup/types-polkadot.ts on lines 3214..3223
packages/types-augment/src/lookup/types-substrate.ts on lines 3074..3083
packages/types-augment/src/lookup/types-substrate.ts on lines 5202..5211
packages/types-augment/src/lookup/types-substrate.ts on lines 7978..7987
packages/types-augment/src/lookup/types-substrate.ts on lines 8083..8092
packages/types-augment/src/lookup/types-substrate.ts on lines 8111..8120
packages/types-augment/src/lookup/types-substrate.ts on lines 8827..8836
packages/types-augment/src/lookup/types-substrate.ts on lines 8991..9000

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

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

  getChildStorage: {
    description: 'Retrieves the child storage for a key',
    params: [
      {
        name: 'childStorageKey',
Severity: Major
Found in packages/types/src/interfaces/state/rpc.ts and 3 other locations - About 2 hrs to fix
packages/types/src/interfaces/state/rpc.ts on lines 28..55
packages/types/src/interfaces/state/rpc.ts on lines 104..131
packages/types/src/interfaces/state/rpc.ts on lines 132..159

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

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

      exposure.others.forEach(({ who }, validatorIndex): void => {
        const nominatorId = who.toString();

        nominators[nominatorId] = nominators[nominatorId] || [];
        nominators[nominatorId].push({ validatorId, validatorIndex });
Severity: Major
Found in packages/api-derive/src/staking/erasExposure.ts and 1 other location - About 2 hrs to fix
packages/api-derive/src/staking/erasExposure.ts on lines 30..35

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

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

  getChildKeys: {
    description: 'Retrieves the keys with prefix of a specific child storage',
    params: [
      {
        name: 'childStorageKey',
Severity: Major
Found in packages/types/src/interfaces/state/rpc.ts and 3 other locations - About 2 hrs to fix
packages/types/src/interfaces/state/rpc.ts on lines 76..103
packages/types/src/interfaces/state/rpc.ts on lines 104..131
packages/types/src/interfaces/state/rpc.ts on lines 132..159

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

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

  getChildStorageHash: {
    description: 'Retrieves the child storage hash',
    params: [
      {
        name: 'childStorageKey',
Severity: Major
Found in packages/types/src/interfaces/state/rpc.ts and 3 other locations - About 2 hrs to fix
packages/types/src/interfaces/state/rpc.ts on lines 28..55
packages/types/src/interfaces/state/rpc.ts on lines 76..103
packages/types/src/interfaces/state/rpc.ts on lines 132..159

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

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