polkadot-js/api

View on GitHub
packages/types/src/interfaces/staking/types.ts

Summary

Maintainability
F
3 days
Test Coverage

File types.ts has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */

import type { BTreeMap, Compact, Enum, Option, Struct, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
Severity: Minor
Found in packages/types/src/interfaces/staking/types.ts - About 2 hrs to fix

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

    export interface StakingLedger extends Struct {
      readonly stash: AccountId;
      readonly total: Compact<Balance>;
      readonly active: Compact<Balance>;
      readonly unlocking: Vec<UnlockChunk>;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 2 other locations - About 2 hrs to fix
    packages/types/src/interfaces/scaleInfo/types.ts on lines 115..121
    packages/types/src/interfaces/staking/types.ts on lines 350..356

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

    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 StakingLedgerTo240 extends Struct {
      readonly stash: AccountId;
      readonly total: Compact<Balance>;
      readonly active: Compact<Balance>;
      readonly unlocking: Vec<UnlockChunk>;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 2 other locations - About 2 hrs to fix
    packages/types/src/interfaces/scaleInfo/types.ts on lines 115..121
    packages/types/src/interfaces/staking/types.ts on lines 333..339

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

    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 UnappliedSlash extends Struct {
      readonly validator: AccountId;
      readonly own: Balance;
      readonly others: Vec<UnappliedSlashOther>;
      readonly reporters: Vec<AccountId>;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 1 other location - About 1 hr to fix
    packages/types/src/interfaces/collective/types.ts on lines 24..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 74.

    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 ElectionPhase extends Enum {
      readonly isOff: boolean;
      readonly isSigned: boolean;
      readonly isUnsigned: boolean;
      readonly asUnsigned: ITuple<[bool, BlockNumber]>;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 1 other location - About 1 hr to fix
    packages/types-augment/src/lookup/types-substrate.ts on lines 438..445

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

    export interface Forcing extends Enum {
      readonly isNotForcing: boolean;
      readonly isForceNew: boolean;
      readonly isForceNone: boolean;
      readonly isForceAlways: boolean;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 4 other locations - About 1 hr to fix
    packages/types/src/interfaces/eth/types.ts on lines 285..291
    packages/types/src/interfaces/mixnet/types.ts on lines 24..30
    packages/types/src/interfaces/xcm/types.ts on lines 463..469
    packages/types/src/interfaces/xcm/types.ts on lines 901..907

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

    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 StakingLedgerTo223 extends Struct {
      readonly stash: AccountId;
      readonly total: Compact<Balance>;
      readonly active: Compact<Balance>;
      readonly unlocking: Vec<UnlockChunk>;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 1 other location - About 1 hr to fix
    packages/types/src/interfaces/system/types.ts on lines 469..474

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

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

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

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

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

    Refactorings

    Further Reading

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

    export interface Exposure extends Struct {
      readonly total: Compact<Balance>;
      readonly own: Compact<Balance>;
      readonly others: Vec<IndividualExposure>;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 4 other locations - About 1 hr to fix
    packages/types/src/interfaces/assets/types.ts on lines 27..31
    packages/types/src/interfaces/babe/types.ts on lines 71..75
    packages/types/src/interfaces/system/types.ts on lines 332..336
    packages/types/src/interfaces/uniques/types.ts on lines 38..42

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

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

    export interface SlashingSpans extends Struct {
      readonly spanIndex: SpanIndex;
      readonly lastStart: EraIndex;
      readonly lastNonzeroSlash: EraIndex;
      readonly prior: Vec<EraIndex>;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 12 other locations - About 1 hr to fix
    packages/types/src/interfaces/beefy/types.ts on lines 25..30
    packages/types/src/interfaces/benchmark/types.ts on lines 8..13
    packages/types/src/interfaces/contractsAbi/types.ts on lines 134..139
    packages/types/src/interfaces/contractsAbi/types.ts on lines 142..147
    packages/types/src/interfaces/eth/types.ts on lines 405..410
    packages/types/src/interfaces/evm/types.ts on lines 14..19
    packages/types/src/interfaces/evm/types.ts on lines 31..36
    packages/types/src/interfaces/grandpa/types.ts on lines 59..64
    packages/types/src/interfaces/metadata/types.ts on lines 253..258
    packages/types/src/interfaces/metadata/types.ts on lines 334..339
    packages/types/src/interfaces/parachains/types.ts on lines 262..267
    packages/types/src/interfaces/utility/types.ts on lines 8..13

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

    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

    export interface ElectionCompute extends Enum {
      readonly isOnChain: boolean;
      readonly isSigned: boolean;
      readonly isUnsigned: boolean;
      readonly type: 'OnChain' | 'Signed' | 'Unsigned';
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 15 other locations - About 1 hr to fix
    packages/types/src/interfaces/babe/types.ts on lines 10..15
    packages/types/src/interfaces/balances/types.ts on lines 38..43
    packages/types/src/interfaces/bridges/types.ts on lines 102..107
    packages/types/src/interfaces/contractsAbi/types.ts on lines 107..112
    packages/types/src/interfaces/metadata/types.ts on lines 505..510
    packages/types/src/interfaces/parachains/types.ts on lines 539..544
    packages/types/src/interfaces/parachains/types.ts on lines 573..578
    packages/types/src/interfaces/society/types.ts on lines 25..30
    packages/types/src/interfaces/society/types.ts on lines 33..38
    packages/types/src/interfaces/statement/types.ts on lines 7..12
    packages/types/src/interfaces/statement/types.ts on lines 15..20
    packages/types/src/interfaces/system/types.ts on lines 64..69
    packages/types/src/interfaces/system/types.ts on lines 103..108
    packages/types/src/interfaces/txqueue/types.ts on lines 9..14
    packages/types/src/interfaces/xcm/types.ts on lines 910..915

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

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

    export interface ElectionStatus extends Enum {
      readonly isClose: boolean;
      readonly isOpen: boolean;
      readonly asOpen: BlockNumber;
      readonly type: 'Close' | 'Open';
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 6 other locations - About 55 mins to fix
    packages/types/src/interfaces/babe/types.ts on lines 84..89
    packages/types/src/interfaces/beefy/types.ts on lines 61..66
    packages/types/src/interfaces/eth/types.ts on lines 294..299
    packages/types/src/interfaces/genericAsset/types.ts on lines 14..19
    packages/types/src/interfaces/grandpa/types.ts on lines 37..42
    packages/types/src/interfaces/parachains/types.ts on lines 735..740

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

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

    export interface SignedSubmission extends Struct {
      readonly who: AccountId;
      readonly deposit: Balance;
      readonly solution: RawSolution;
      readonly reward: Balance;
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 19 other locations - About 55 mins to fix
    packages/types/src/interfaces/babe/types.ts on lines 30..35
    packages/types/src/interfaces/babe/types.ts on lines 129..134
    packages/types/src/interfaces/babe/types.ts on lines 159..164
    packages/types/src/interfaces/balances/types.ts on lines 8..13
    packages/types/src/interfaces/balances/types.ts on lines 23..28
    packages/types/src/interfaces/bridges/types.ts on lines 60..65
    packages/types/src/interfaces/contractsAbi/types.ts on lines 183..188
    packages/types/src/interfaces/contractsAbi/types.ts on lines 374..379
    packages/types/src/interfaces/democracy/types.ts on lines 103..108
    packages/types/src/interfaces/elections/types.ts on lines 37..42
    packages/types/src/interfaces/gilt/types.ts on lines 8..13
    packages/types/src/interfaces/gilt/types.ts on lines 16..21
    packages/types/src/interfaces/imOnline/types.ts on lines 25..30
    packages/types/src/interfaces/parachains/types.ts on lines 211..216
    packages/types/src/interfaces/parachains/types.ts on lines 247..252
    packages/types/src/interfaces/parachains/types.ts on lines 672..677
    packages/types/src/interfaces/parachains/types.ts on lines 680..685
    packages/types/src/interfaces/runtime/types.ts on lines 373..378
    packages/types/src/interfaces/system/types.ts on lines 14..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 53.

    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 RoundSnapshot extends Struct {
      readonly voters: Vec<ITuple<[AccountId, VoteWeight, Vec<AccountId>]>>;
      readonly targets: Vec<AccountId>;
    }
    Severity: Minor
    Found in packages/types/src/interfaces/staking/types.ts and 1 other location - About 55 mins to fix
    packages/types-augment/src/lookup/types-substrate.ts on lines 6974..6977

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

    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

    export interface SlashingSpansTo204 extends Struct {
      readonly spanIndex: SpanIndex;
      readonly lastStart: EraIndex;
      readonly prior: Vec<EraIndex>;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 16 other locations - About 45 mins to fix
    packages/types/src/interfaces/benchmark/types.ts on lines 25..29
    packages/types/src/interfaces/contracts/types.ts on lines 34..38
    packages/types/src/interfaces/contracts/types.ts on lines 356..360
    packages/types/src/interfaces/eth/types.ts on lines 278..282
    packages/types/src/interfaces/grandpa/types.ts on lines 67..71
    packages/types/src/interfaces/grandpa/types.ts on lines 97..101
    packages/types/src/interfaces/grandpa/types.ts on lines 165..169
    packages/types/src/interfaces/metadata/types.ts on lines 96..100
    packages/types/src/interfaces/metadata/types.ts on lines 128..132
    packages/types/src/interfaces/parachains/types.ts on lines 490..494
    packages/types/src/interfaces/parachains/types.ts on lines 930..934
    packages/types/src/interfaces/recovery/types.ts on lines 8..12
    packages/types/src/interfaces/state/types.ts on lines 23..27
    packages/types/src/interfaces/state/types.ts on lines 74..78
    packages/types/src/interfaces/system/types.ts on lines 258..262
    packages/types/src/interfaces/system/types.ts on lines 420..424

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

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

    export interface Nominations extends Struct {
      readonly targets: Vec<AccountId>;
      readonly submittedIn: EraIndex;
      readonly suppressed: bool;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 6 other locations - About 45 mins to fix
    packages/types/src/interfaces/contractsAbi/types.ts on lines 339..343
    packages/types/src/interfaces/contractsAbi/types.ts on lines 346..350
    packages/types/src/interfaces/democracy/types.ts on lines 145..149
    packages/types/src/interfaces/identity/types.ts on lines 73..77
    packages/types/src/interfaces/mixnet/types.ts on lines 7..11
    packages/types/src/interfaces/staking/types.ts on lines 414..418

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

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

    export interface Voter extends Struct {
      readonly votes: Vec<AccountId>;
      readonly stake: Balance;
      readonly deposit: Balance;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 6 other locations - About 45 mins to fix
    packages/types/src/interfaces/contractsAbi/types.ts on lines 339..343
    packages/types/src/interfaces/contractsAbi/types.ts on lines 346..350
    packages/types/src/interfaces/democracy/types.ts on lines 145..149
    packages/types/src/interfaces/identity/types.ts on lines 73..77
    packages/types/src/interfaces/mixnet/types.ts on lines 7..11
    packages/types/src/interfaces/staking/types.ts on lines 190..194

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

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

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

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

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

    Refactorings

    Further Reading

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

    export interface ElectionSize extends Struct {
      readonly validators: Compact<ValidatorIndex>;
      readonly nominators: Compact<NominatorIndex>;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 5 other locations - About 35 mins to fix
    packages/types/src/interfaces/grandpa/types.ts on lines 53..56
    packages/types/src/interfaces/parachains/types.ts on lines 635..638
    packages/types/src/interfaces/staking/types.ts on lines 309..312
    packages/types/src/interfaces/staking/types.ts on lines 377..380
    packages/types/src/interfaces/staking/types.ts on lines 392..395

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

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

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

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

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

    Refactorings

    Further Reading

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

    export interface ValidatorPrefsTo145 extends Struct {
      readonly unstakeThreshold: Compact<u32>;
      readonly validatorPayment: Compact<Balance>;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 5 other locations - About 35 mins to fix
    packages/types/src/interfaces/grandpa/types.ts on lines 53..56
    packages/types/src/interfaces/parachains/types.ts on lines 635..638
    packages/types/src/interfaces/staking/types.ts on lines 124..127
    packages/types/src/interfaces/staking/types.ts on lines 309..312
    packages/types/src/interfaces/staking/types.ts on lines 377..380

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

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

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

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

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

    Refactorings

    Further Reading

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

    export interface UnlockChunk extends Struct {
      readonly value: Compact<Balance>;
      readonly era: Compact<BlockNumber>;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 5 other locations - About 35 mins to fix
    packages/types/src/interfaces/grandpa/types.ts on lines 53..56
    packages/types/src/interfaces/parachains/types.ts on lines 635..638
    packages/types/src/interfaces/staking/types.ts on lines 124..127
    packages/types/src/interfaces/staking/types.ts on lines 309..312
    packages/types/src/interfaces/staking/types.ts on lines 392..395

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

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

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

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

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

    Refactorings

    Further Reading

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

    export interface SolutionOrSnapshotSize extends Struct {
      readonly voters: Compact<u32>;
      readonly targets: Compact<u32>;
    }
    Severity: Major
    Found in packages/types/src/interfaces/staking/types.ts and 5 other locations - About 35 mins to fix
    packages/types/src/interfaces/grandpa/types.ts on lines 53..56
    packages/types/src/interfaces/parachains/types.ts on lines 635..638
    packages/types/src/interfaces/staking/types.ts on lines 124..127
    packages/types/src/interfaces/staking/types.ts on lines 377..380
    packages/types/src/interfaces/staking/types.ts on lines 392..395

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

    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

    There are no issues that match your filters.

    Category
    Status