polkadot-js/api

View on GitHub

Showing 2,442 of 2,627 total issues

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

export interface BabeGenesisConfigurationV1 extends Struct {
  readonly slotDuration: u64;
  readonly epochLength: u64;
  readonly c: ITuple<[u64, u64]>;
  readonly genesisAuthorities: Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>;
Severity: Major
Found in packages/types/src/interfaces/babe/types.ts and 1 other location - About 3 hrs to fix
packages/types/src/interfaces/babe/types.ts on lines 38..45

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

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

export interface FundInfo extends Struct {
  readonly depositor: AccountId;
  readonly verifier: Option<MultiSigner>;
  readonly deposit: Balance;
  readonly raised: Balance;
Severity: Major
Found in packages/types/src/interfaces/crowdloan/types.ts and 1 other location - About 3 hrs to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 3226..3237

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

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

export interface BabeGenesisConfiguration extends Struct {
  readonly slotDuration: u64;
  readonly epochLength: u64;
  readonly c: ITuple<[u64, u64]>;
  readonly genesisAuthorities: Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>;
Severity: Major
Found in packages/types/src/interfaces/babe/types.ts and 1 other location - About 3 hrs to fix
packages/types/src/interfaces/babe/types.ts on lines 48..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 99.

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 AbridgedHostConfiguration extends Struct {
  readonly maxCodeSize: u32;
  readonly maxHeadDataSize: u32;
  readonly maxUpwardQueueCount: u32;
  readonly maxUpwardQueueSize: u32;
Severity: Major
Found in packages/types/src/interfaces/parachains/types.ts and 2 other locations - About 3 hrs to fix
packages/types/src/interfaces/contracts/types.ts on lines 430..440
packages/types/src/interfaces/parachains/types.ts on lines 130..140

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

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 LimitsTo264 extends Struct {
  readonly eventTopics: u32;
  readonly stackHeight: u32;
  readonly globals: u32;
  readonly parameters: u32;
Severity: Major
Found in packages/types/src/interfaces/contracts/types.ts and 2 other locations - About 3 hrs to fix
packages/types/src/interfaces/parachains/types.ts on lines 23..33
packages/types/src/interfaces/parachains/types.ts on lines 130..140

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

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 CandidateDescriptor extends Struct {
  readonly paraId: ParaId;
  readonly relayParent: RelayChainHash;
  readonly collatorId: CollatorId;
  readonly persistedValidationDataHash: Hash;
Severity: Major
Found in packages/types/src/interfaces/parachains/types.ts and 2 other locations - About 3 hrs to fix
packages/types/src/interfaces/contracts/types.ts on lines 430..440
packages/types/src/interfaces/parachains/types.ts on lines 23..33

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

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

    it('constructs via boolean false', (): void => {
      expect(new GenericVote(registry, false).toU8a()).toEqual(new Uint8Array([0]));
      expect(new GenericVote(registry, false).isNay).toBe(true);
      expect(new GenericVote(registry, false).isAye).toBe(false);
    });
Severity: Major
Found in packages/types/src/generic/Vote.spec.ts and 1 other location - About 3 hrs to fix
packages/types/src/generic/Vote.spec.ts on lines 13..17

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

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

export interface ContractMessageSpecV2 extends Struct {
  readonly label: Text;
  readonly selector: ContractSelector;
  readonly mutates: bool;
  readonly payable: bool;
Severity: Major
Found in packages/types/src/interfaces/contractsAbi/types.ts and 1 other location - About 3 hrs to fix
packages/types/src/interfaces/contractsAbi/types.ts on lines 249..257

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

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

export interface ContractMessageSpecV0 extends Struct {
  readonly name: Text;
  readonly selector: ContractSelector;
  readonly mutates: bool;
  readonly payable: bool;
Severity: Major
Found in packages/types/src/interfaces/contractsAbi/types.ts and 1 other location - About 3 hrs to fix
packages/types/src/interfaces/contractsAbi/types.ts on lines 271..279

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

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

    it('constructs via boolean true', (): void => {
      expect(new GenericVote(registry, true).toU8a()).toEqual(new Uint8Array([128]));
      expect(new GenericVote(registry, true).isAye).toBe(true);
      expect(new GenericVote(registry, true).isNay).toBe(false);
    });
Severity: Major
Found in packages/types/src/generic/Vote.spec.ts and 1 other location - About 3 hrs to fix
packages/types/src/generic/Vote.spec.ts on lines 19..23

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

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

      regions: AugmentedQuery<ApiType, (arg: PalletBrokerRegionId | { begin?: any; core?: any; mask?: any } | string | Uint8Array) => Observable<Option<PalletBrokerRegionRecord>>, [PalletBrokerRegionId]> & QueryableStorageEntry<ApiType, [PalletBrokerRegionId]>;
Severity: Major
Found in packages/api-augment/src/substrate/query.ts and 1 other location - About 3 hrs to fix
packages/api-augment/src/substrate/query.ts on lines 422..422

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

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

      instaPoolContribution: AugmentedQuery<ApiType, (arg: PalletBrokerRegionId | { begin?: any; core?: any; mask?: any } | string | Uint8Array) => Observable<Option<PalletBrokerContributionRecord>>, [PalletBrokerRegionId]> & QueryableStorageEntry<ApiType, [PalletBrokerRegionId]>;
Severity: Major
Found in packages/api-augment/src/substrate/query.ts and 1 other location - About 3 hrs to fix
packages/api-augment/src/substrate/query.ts on lines 444..444

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

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

      reportFutureBlockVoting: AugmentedSubmittable<(equivocationProof: SpConsensusBeefyFutureBlockVotingProof | { vote?: any } | string | Uint8Array, keyOwnerProof: SpSessionMembershipProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [SpConsensusBeefyFutureBlockVotingProof, SpSessionMembershipProof]>;
Severity: Major
Found in packages/api-augment/src/substrate/tx.ts and 1 other location - About 3 hrs to fix
packages/api-augment/src/substrate/tx.ts on lines 1037..1037

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

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

      reportFutureBlockVotingUnsigned: AugmentedSubmittable<(equivocationProof: SpConsensusBeefyFutureBlockVotingProof | { vote?: any } | string | Uint8Array, keyOwnerProof: SpSessionMembershipProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [SpConsensusBeefyFutureBlockVotingProof, SpSessionMembershipProof]>;
Severity: Major
Found in packages/api-augment/src/substrate/tx.ts and 1 other location - About 3 hrs to fix
packages/api-augment/src/substrate/tx.ts on lines 1026..1026

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

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

    beefy: {
      /**
       * The maximum number of authorities that can be added.
       **/
      maxAuthorities: u32 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/substrate/consts.ts and 16 other locations - About 3 hrs to fix
packages/api-augment/src/kusama/consts.ts on lines 98..120
packages/api-augment/src/kusama/consts.ts on lines 223..242
packages/api-augment/src/kusama/consts.ts on lines 350..372
packages/api-augment/src/kusama/consts.ts on lines 420..444
packages/api-augment/src/kusama/consts.ts on lines 542..570
packages/api-augment/src/kusama/consts.ts on lines 571..589
packages/api-augment/src/polkadot/consts.ts on lines 94..116
packages/api-augment/src/polkadot/consts.ts on lines 205..224
packages/api-augment/src/polkadot/consts.ts on lines 311..333
packages/api-augment/src/polkadot/consts.ts on lines 413..437
packages/api-augment/src/polkadot/consts.ts on lines 438..466
packages/api-augment/src/substrate/consts.ts on lines 636..658
packages/api-augment/src/substrate/consts.ts on lines 723..742
packages/api-augment/src/substrate/consts.ts on lines 852..876
packages/api-augment/src/substrate/consts.ts on lines 1030..1058
packages/api-augment/src/substrate/consts.ts on lines 1277..1303

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

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

    beefy: {
      /**
       * The maximum number of authorities that can be added.
       **/
      maxAuthorities: u32 & AugmentedConst<ApiType>;
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 16 other locations - About 3 hrs to fix
packages/api-augment/src/kusama/consts.ts on lines 223..242
packages/api-augment/src/kusama/consts.ts on lines 350..372
packages/api-augment/src/kusama/consts.ts on lines 420..444
packages/api-augment/src/kusama/consts.ts on lines 542..570
packages/api-augment/src/kusama/consts.ts on lines 571..589
packages/api-augment/src/polkadot/consts.ts on lines 94..116
packages/api-augment/src/polkadot/consts.ts on lines 205..224
packages/api-augment/src/polkadot/consts.ts on lines 311..333
packages/api-augment/src/polkadot/consts.ts on lines 413..437
packages/api-augment/src/polkadot/consts.ts on lines 438..466
packages/api-augment/src/substrate/consts.ts on lines 188..210
packages/api-augment/src/substrate/consts.ts on lines 636..658
packages/api-augment/src/substrate/consts.ts on lines 723..742
packages/api-augment/src/substrate/consts.ts on lines 852..876
packages/api-augment/src/substrate/consts.ts on lines 1030..1058
packages/api-augment/src/substrate/consts.ts on lines 1277..1303

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

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

    crowdloan: {
      /**
       * The minimum amount that may be contributed into a crowdloan. Should almost certainly be
       * at least `ExistentialDeposit`.
       **/
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 16 other locations - About 3 hrs to fix
packages/api-augment/src/kusama/consts.ts on lines 98..120
packages/api-augment/src/kusama/consts.ts on lines 350..372
packages/api-augment/src/kusama/consts.ts on lines 420..444
packages/api-augment/src/kusama/consts.ts on lines 542..570
packages/api-augment/src/kusama/consts.ts on lines 571..589
packages/api-augment/src/polkadot/consts.ts on lines 94..116
packages/api-augment/src/polkadot/consts.ts on lines 205..224
packages/api-augment/src/polkadot/consts.ts on lines 311..333
packages/api-augment/src/polkadot/consts.ts on lines 413..437
packages/api-augment/src/polkadot/consts.ts on lines 438..466
packages/api-augment/src/substrate/consts.ts on lines 188..210
packages/api-augment/src/substrate/consts.ts on lines 636..658
packages/api-augment/src/substrate/consts.ts on lines 723..742
packages/api-augment/src/substrate/consts.ts on lines 852..876
packages/api-augment/src/substrate/consts.ts on lines 1030..1058
packages/api-augment/src/substrate/consts.ts on lines 1277..1303

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

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

    nominationPools: {
      /**
       * The maximum pool points-to-balance ratio that an `open` pool can have.
       * 
       * This is important in the event slashing takes place and the pool's points-to-balance
Severity: Major
Found in packages/api-augment/src/substrate/consts.ts and 16 other locations - About 3 hrs to fix
packages/api-augment/src/kusama/consts.ts on lines 98..120
packages/api-augment/src/kusama/consts.ts on lines 223..242
packages/api-augment/src/kusama/consts.ts on lines 350..372
packages/api-augment/src/kusama/consts.ts on lines 420..444
packages/api-augment/src/kusama/consts.ts on lines 542..570
packages/api-augment/src/kusama/consts.ts on lines 571..589
packages/api-augment/src/polkadot/consts.ts on lines 94..116
packages/api-augment/src/polkadot/consts.ts on lines 205..224
packages/api-augment/src/polkadot/consts.ts on lines 311..333
packages/api-augment/src/polkadot/consts.ts on lines 413..437
packages/api-augment/src/polkadot/consts.ts on lines 438..466
packages/api-augment/src/substrate/consts.ts on lines 188..210
packages/api-augment/src/substrate/consts.ts on lines 636..658
packages/api-augment/src/substrate/consts.ts on lines 723..742
packages/api-augment/src/substrate/consts.ts on lines 852..876
packages/api-augment/src/substrate/consts.ts on lines 1277..1303

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

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

    salary: {
      /**
       * The total budget per cycle.
       * 
       * This may change over the course of a cycle without any problem.
Severity: Major
Found in packages/api-augment/src/substrate/consts.ts and 16 other locations - About 3 hrs to fix
packages/api-augment/src/kusama/consts.ts on lines 98..120
packages/api-augment/src/kusama/consts.ts on lines 223..242
packages/api-augment/src/kusama/consts.ts on lines 350..372
packages/api-augment/src/kusama/consts.ts on lines 420..444
packages/api-augment/src/kusama/consts.ts on lines 542..570
packages/api-augment/src/kusama/consts.ts on lines 571..589
packages/api-augment/src/polkadot/consts.ts on lines 94..116
packages/api-augment/src/polkadot/consts.ts on lines 205..224
packages/api-augment/src/polkadot/consts.ts on lines 311..333
packages/api-augment/src/polkadot/consts.ts on lines 413..437
packages/api-augment/src/polkadot/consts.ts on lines 438..466
packages/api-augment/src/substrate/consts.ts on lines 188..210
packages/api-augment/src/substrate/consts.ts on lines 636..658
packages/api-augment/src/substrate/consts.ts on lines 723..742
packages/api-augment/src/substrate/consts.ts on lines 852..876
packages/api-augment/src/substrate/consts.ts on lines 1030..1058

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

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

    multisig: {
      /**
       * The base amount of currency needed to reserve for creating a multisig execution or to
       * store a dispatch call for later.
       * 
Severity: Major
Found in packages/api-augment/src/kusama/consts.ts and 16 other locations - About 3 hrs to fix
packages/api-augment/src/kusama/consts.ts on lines 98..120
packages/api-augment/src/kusama/consts.ts on lines 223..242
packages/api-augment/src/kusama/consts.ts on lines 350..372
packages/api-augment/src/kusama/consts.ts on lines 542..570
packages/api-augment/src/kusama/consts.ts on lines 571..589
packages/api-augment/src/polkadot/consts.ts on lines 94..116
packages/api-augment/src/polkadot/consts.ts on lines 205..224
packages/api-augment/src/polkadot/consts.ts on lines 311..333
packages/api-augment/src/polkadot/consts.ts on lines 413..437
packages/api-augment/src/polkadot/consts.ts on lines 438..466
packages/api-augment/src/substrate/consts.ts on lines 188..210
packages/api-augment/src/substrate/consts.ts on lines 636..658
packages/api-augment/src/substrate/consts.ts on lines 723..742
packages/api-augment/src/substrate/consts.ts on lines 852..876
packages/api-augment/src/substrate/consts.ts on lines 1030..1058
packages/api-augment/src/substrate/consts.ts on lines 1277..1303

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

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