polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

  interface XcmV2OriginKind extends Enum {
    readonly isNative: boolean;
    readonly isSovereignAccount: boolean;
    readonly isSuperuser: boolean;
    readonly isXcm: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-polkadot.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface PalletBagsListListListError extends Enum {
    readonly isDuplicate: boolean;
    readonly isNotHeavier: boolean;
    readonly isNotInSameBag: boolean;
    readonly isNodeNotFound: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface PalletStakingForcing extends Enum {
    readonly isNotForcing: boolean;
    readonly isForceNew: boolean;
    readonly isForceNone: boolean;
    readonly isForceAlways: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface KitchensinkRuntimeProxyType extends Enum {
    readonly isAny: boolean;
    readonly isNonTransfer: boolean;
    readonly isGovernance: boolean;
    readonly isStaking: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface PalletTxPauseError extends Enum {
    readonly isIsPaused: boolean;
    readonly isIsUnpaused: boolean;
    readonly isUnpausable: boolean;
    readonly isNotFound: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface PalletNftsPalletFeature extends Enum {
    readonly isTrading: boolean;
    readonly isAttributes: boolean;
    readonly isApprovals: boolean;
    readonly isSwaps: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface PalletNftFractionalizationError extends Enum {
    readonly isIncorrectAssetId: boolean;
    readonly isNoPermission: boolean;
    readonly isNftNotFound: boolean;
    readonly isNftNotFractionalized: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

  interface PalletAssetConversionOpsError extends Enum {
    readonly isInvalidAssetPair: boolean;
    readonly isPoolNotFound: boolean;
    readonly isZeroBalance: boolean;
    readonly isPartialTransfer: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-kusama.ts on lines 385..391
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988

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

  interface XcmV3OriginKind extends Enum {
    readonly isNative: boolean;
    readonly isSovereignAccount: boolean;
    readonly isSuperuser: boolean;
    readonly isXcm: boolean;
Severity: Major
Found in packages/types-augment/src/lookup/types-kusama.ts and 10 other locations - About 1 hr to fix
packages/types-augment/src/lookup/types-polkadot.ts on lines 1570..1576
packages/types-augment/src/lookup/types-substrate.ts on lines 549..555
packages/types-augment/src/lookup/types-substrate.ts on lines 1350..1356
packages/types-augment/src/lookup/types-substrate.ts on lines 5526..5532
packages/types-augment/src/lookup/types-substrate.ts on lines 6890..6896
packages/types-augment/src/lookup/types-substrate.ts on lines 8287..8293
packages/types-augment/src/lookup/types-substrate.ts on lines 8354..8360
packages/types-augment/src/lookup/types-substrate.ts on lines 8479..8485
packages/types-augment/src/lookup/types-substrate.ts on lines 8982..8988
packages/types-augment/src/lookup/types-substrate.ts on lines 9125..9131

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

export interface AssetDestroyWitness extends Struct {
  readonly accounts: Compact<u32>;
  readonly sufficients: Compact<u32>;
  readonly approvals: Compact<u32>;
}
Severity: Major
Found in packages/types/src/interfaces/assets/types.ts and 4 other locations - About 1 hr to fix
packages/types/src/interfaces/babe/types.ts on lines 71..75
packages/types/src/interfaces/staking/types.ts on lines 159..163
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

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

          if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
            // eslint-disable-next-line jest/no-conditional-expect
            expect(constructFn).toThrow();
          } else {
            // eslint-disable-next-line jest/no-conditional-expect
Severity: Major
Found in packages/types/src/index.spec.ts and 1 other location - About 1 hr to fix
packages/types/src/index.spec.ts on lines 40..46

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

  BodyIdV2: {
    _enum: {
      Unit: 'Null',
      Named: 'Bytes',
      Index: 'Compact<u32>',
Severity: Major
Found in packages/types/src/interfaces/xcm/v2.ts and 3 other locations - About 1 hr to fix
packages/types/src/interfaces/author/definitions.ts on lines 20..33
packages/types/src/interfaces/system/definitions.ts on lines 93..106
packages/types/src/interfaces/xcm/v3.ts on lines 16..29

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

    DispatchErrorPre6: {
      _enum: {
        Other: 'Null',
        CannotLookup: 'Null',
        BadOrigin: 'Null',
Severity: Major
Found in packages/types/src/interfaces/system/definitions.ts and 3 other locations - About 1 hr to fix
packages/types/src/interfaces/author/definitions.ts on lines 20..33
packages/types/src/interfaces/xcm/v2.ts on lines 27..40
packages/types/src/interfaces/xcm/v3.ts on lines 16..29

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

export interface DestroyWitness extends Struct {
  readonly instances: Compact<u32>;
  readonly instanceMetadatas: Compact<u32>;
  readonly attributes: Compact<u32>;
}
Severity: Major
Found in packages/types/src/interfaces/uniques/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/staking/types.ts on lines 159..163
packages/types/src/interfaces/system/types.ts on lines 332..336

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

  BodyIdV3: {
    _enum: {
      Unit: 'Null',
      Moniker: '[u8;4]',
      Index: 'Compact<u32>',
Severity: Major
Found in packages/types/src/interfaces/xcm/v3.ts and 3 other locations - About 1 hr to fix
packages/types/src/interfaces/author/definitions.ts on lines 20..33
packages/types/src/interfaces/system/definitions.ts on lines 93..106
packages/types/src/interfaces/xcm/v2.ts on lines 27..40

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

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

          if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
            // eslint-disable-next-line jest/no-conditional-expect
            expect(constructFn).toThrow();
          } else {
            // eslint-disable-next-line jest/no-conditional-expect
Severity: Major
Found in packages/types/src/index.spec.ts and 1 other location - About 1 hr to fix
packages/types/src/index.spec.ts on lines 57..63

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

export interface NotConnectedPeer extends Struct {
  readonly knownAddresses: Vec<Text>;
  readonly latestPingTime: Option<PeerPing>;
  readonly versionString: Option<Text>;
}
Severity: Major
Found in packages/types/src/interfaces/system/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/staking/types.ts on lines 159..163
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 5 locations. Consider refactoring.
Open

export interface EpochAuthorship extends Struct {
  readonly primary: Vec<u64>;
  readonly secondary: Vec<u64>;
  readonly secondary_vrf: Vec<u64>;
}
Severity: Major
Found in packages/types/src/interfaces/babe/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/staking/types.ts on lines 159..163
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 4 locations. Consider refactoring.
Open

    ExtrinsicStatus: {
      _enum: {
        Future: 'Null',
        Ready: 'Null',
        Broadcast: 'Vec<Text>',
Severity: Major
Found in packages/types/src/interfaces/author/definitions.ts and 3 other locations - About 1 hr to fix
packages/types/src/interfaces/system/definitions.ts on lines 93..106
packages/types/src/interfaces/xcm/v2.ts on lines 27..40
packages/types/src/interfaces/xcm/v3.ts on lines 16..29

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

Severity
Category
Status
Source
Language