polkadot-js/api

View on GitHub

Showing 2,500 of 2,507 total issues

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

mockU32EnumMap.set(new MockEnum(registry, { Key2: new MockStruct(registry, { int: -1, text: 'b' }) }), new U32(registry, 7));
Severity: Minor
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 1 other location - About 35 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 57..57

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

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

    QueryStatus: {
      _enum: {
        Pending: {
          responder: 'VersionedMultiLocation',
          maybeNotify: 'Option<(u8, u8)>',
Severity: Minor
Found in packages/types/src/interfaces/xcm/definitions.ts and 1 other location - About 35 mins to fix
packages/types-augment/src/lookup/substrate.ts on lines 2032..2044

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

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 SessionKeys8 extends ITuple<[AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId]> {}
Severity: Minor
Found in packages/types/src/interfaces/session/types.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/session/types.ts on lines 68..68

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

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

  PolkadotRuntimeParachainsAssignerOnDemandPalletCall: {
    _enum: {
      place_order_allow_death: {
        maxAmount: 'u128',
        paraId: 'u32',
Severity: Minor
Found in packages/types-augment/src/lookup/kusama.ts and 1 other location - About 35 mins to fix
packages/types-augment/src/lookup/substrate.ts on lines 605..616

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

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

      methods: {
        authorities: {
          description: 'Return the current set of authorities.',
          params: [],
          type: 'Vec<AuthorityId>'
Severity: Minor
Found in packages/types/src/interfaces/aura/runtime.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/beefy/runtime.ts on lines 47..58

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

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 SessionKeys8B extends ITuple<[AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey]> {}
Severity: Minor
Found in packages/types/src/interfaces/session/types.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/session/types.ts on lines 65..65

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

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

  PalletBagsListEvent: {
    _enum: {
      Rebagged: {
        who: 'AccountId32',
        from: 'u64',
Severity: Minor
Found in packages/types-augment/src/lookup/substrate.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/xcm/definitions.ts on lines 105..117

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

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

mockU32EnumMap.set(new MockEnum(registry, { Key1: new MockStruct(registry, { int: -1, text: 'b' }) }), new U32(registry, 69));
Severity: Minor
Found in packages/types-codec/src/extended/BTreeMap.spec.ts and 1 other location - About 35 mins to fix
packages/types-codec/src/extended/BTreeMap.spec.ts on lines 55..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 46.

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

const BEEFY_MMR_V1: Record<string, DefinitionCall> = {
  authority_set_proof: {
    description: 'Return the currently active BEEFY authority set proof.',
    params: [],
    type: 'BeefyAuthoritySet'
Severity: Minor
Found in packages/types/src/interfaces/beefy/runtime.ts and 1 other location - About 35 mins to fix
packages/types/src/interfaces/aura/runtime.ts on lines 9..20

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

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

Avoid too many return statements within this function.
Open

      return '(For applications)';
Severity: Major
Found in packages/rpc-provider/src/ws/errors.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return known[code] || '(Unknown)';
    Severity: Major
    Found in packages/rpc-provider/src/ws/errors.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return sortArray(a, b);
      Severity: Major
      Found in packages/types-codec/src/utils/sortValues.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return [...new Set(possibleTypes)];
        Severity: Major
        Found in packages/typegen/src/util/derived.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return sortAsc(a.toU8a(true), b.toU8a(true));
          Severity: Major
          Found in packages/types-codec/src/utils/sortValues.ts - About 30 mins to fix

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

            export interface PvfPrepTimeoutKind extends Enum {
              readonly isPrecheck: boolean;
              readonly isLenient: boolean;
              readonly type: 'Precheck' | 'Lenient';
            }
            Severity: Major
            Found in packages/types/src/interfaces/parachains/types.ts and 17 other locations - About 30 mins to fix
            packages/types/src/interfaces/balances/types.ts on lines 31..35
            packages/types/src/interfaces/bridges/types.ts on lines 44..48
            packages/types/src/interfaces/nompools/types.ts on lines 7..11
            packages/types/src/interfaces/parachains/types.ts on lines 240..244
            packages/types/src/interfaces/parachains/types.ts on lines 255..259
            packages/types/src/interfaces/parachains/types.ts on lines 641..645
            packages/types/src/interfaces/parachains/types.ts on lines 688..692
            packages/types/src/interfaces/parachains/types.ts on lines 749..753
            packages/types/src/interfaces/parachains/types.ts on lines 763..767
            packages/types/src/interfaces/parachains/types.ts on lines 806..810
            packages/types/src/interfaces/parachains/types.ts on lines 896..900
            packages/types/src/interfaces/runtime/types.ts on lines 122..126
            packages/types/src/interfaces/runtime/types.ts on lines 271..275
            packages/types/src/interfaces/system/types.ts on lines 444..448
            packages/types/src/interfaces/xcm/types.ts on lines 119..123
            packages/types/src/interfaces/xcm/types.ts on lines 478..482
            packages/types/src/interfaces/xcm/types.ts on lines 636..640

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

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

            export interface UpgradeGoAhead extends Enum {
              readonly isAbort: boolean;
              readonly isGoAhead: boolean;
              readonly type: 'Abort' | 'GoAhead';
            }
            Severity: Major
            Found in packages/types/src/interfaces/parachains/types.ts and 17 other locations - About 30 mins to fix
            packages/types/src/interfaces/balances/types.ts on lines 31..35
            packages/types/src/interfaces/bridges/types.ts on lines 44..48
            packages/types/src/interfaces/nompools/types.ts on lines 7..11
            packages/types/src/interfaces/parachains/types.ts on lines 240..244
            packages/types/src/interfaces/parachains/types.ts on lines 255..259
            packages/types/src/interfaces/parachains/types.ts on lines 641..645
            packages/types/src/interfaces/parachains/types.ts on lines 688..692
            packages/types/src/interfaces/parachains/types.ts on lines 695..699
            packages/types/src/interfaces/parachains/types.ts on lines 749..753
            packages/types/src/interfaces/parachains/types.ts on lines 763..767
            packages/types/src/interfaces/parachains/types.ts on lines 806..810
            packages/types/src/interfaces/runtime/types.ts on lines 122..126
            packages/types/src/interfaces/runtime/types.ts on lines 271..275
            packages/types/src/interfaces/system/types.ts on lines 444..448
            packages/types/src/interfaces/xcm/types.ts on lines 119..123
            packages/types/src/interfaces/xcm/types.ts on lines 478..482
            packages/types/src/interfaces/xcm/types.ts on lines 636..640

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

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

            export interface OutboundStatus extends Enum {
              readonly isOk: boolean;
              readonly isSuspended: boolean;
              readonly type: 'Ok' | 'Suspended';
            }
            Severity: Major
            Found in packages/types/src/interfaces/xcm/types.ts and 17 other locations - About 30 mins to fix
            packages/types/src/interfaces/balances/types.ts on lines 31..35
            packages/types/src/interfaces/bridges/types.ts on lines 44..48
            packages/types/src/interfaces/nompools/types.ts on lines 7..11
            packages/types/src/interfaces/parachains/types.ts on lines 240..244
            packages/types/src/interfaces/parachains/types.ts on lines 255..259
            packages/types/src/interfaces/parachains/types.ts on lines 641..645
            packages/types/src/interfaces/parachains/types.ts on lines 688..692
            packages/types/src/interfaces/parachains/types.ts on lines 695..699
            packages/types/src/interfaces/parachains/types.ts on lines 749..753
            packages/types/src/interfaces/parachains/types.ts on lines 763..767
            packages/types/src/interfaces/parachains/types.ts on lines 806..810
            packages/types/src/interfaces/parachains/types.ts on lines 896..900
            packages/types/src/interfaces/runtime/types.ts on lines 122..126
            packages/types/src/interfaces/runtime/types.ts on lines 271..275
            packages/types/src/interfaces/system/types.ts on lines 444..448
            packages/types/src/interfaces/xcm/types.ts on lines 119..123
            packages/types/src/interfaces/xcm/types.ts on lines 636..640

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

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

            export interface DisputeResult extends Enum {
              readonly isValid: boolean;
              readonly isInvalid: boolean;
              readonly type: 'Valid' | 'Invalid';
            }
            Severity: Major
            Found in packages/types/src/interfaces/parachains/types.ts and 17 other locations - About 30 mins to fix
            packages/types/src/interfaces/balances/types.ts on lines 31..35
            packages/types/src/interfaces/bridges/types.ts on lines 44..48
            packages/types/src/interfaces/nompools/types.ts on lines 7..11
            packages/types/src/interfaces/parachains/types.ts on lines 240..244
            packages/types/src/interfaces/parachains/types.ts on lines 641..645
            packages/types/src/interfaces/parachains/types.ts on lines 688..692
            packages/types/src/interfaces/parachains/types.ts on lines 695..699
            packages/types/src/interfaces/parachains/types.ts on lines 749..753
            packages/types/src/interfaces/parachains/types.ts on lines 763..767
            packages/types/src/interfaces/parachains/types.ts on lines 806..810
            packages/types/src/interfaces/parachains/types.ts on lines 896..900
            packages/types/src/interfaces/runtime/types.ts on lines 122..126
            packages/types/src/interfaces/runtime/types.ts on lines 271..275
            packages/types/src/interfaces/system/types.ts on lines 444..448
            packages/types/src/interfaces/xcm/types.ts on lines 119..123
            packages/types/src/interfaces/xcm/types.ts on lines 478..482
            packages/types/src/interfaces/xcm/types.ts on lines 636..640

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

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

            export interface ParaScheduling extends Enum {
              readonly isAlways: boolean;
              readonly isDynamic: boolean;
              readonly type: 'Always' | 'Dynamic';
            }
            Severity: Major
            Found in packages/types/src/interfaces/parachains/types.ts and 17 other locations - About 30 mins to fix
            packages/types/src/interfaces/balances/types.ts on lines 31..35
            packages/types/src/interfaces/bridges/types.ts on lines 44..48
            packages/types/src/interfaces/nompools/types.ts on lines 7..11
            packages/types/src/interfaces/parachains/types.ts on lines 240..244
            packages/types/src/interfaces/parachains/types.ts on lines 255..259
            packages/types/src/interfaces/parachains/types.ts on lines 688..692
            packages/types/src/interfaces/parachains/types.ts on lines 695..699
            packages/types/src/interfaces/parachains/types.ts on lines 749..753
            packages/types/src/interfaces/parachains/types.ts on lines 763..767
            packages/types/src/interfaces/parachains/types.ts on lines 806..810
            packages/types/src/interfaces/parachains/types.ts on lines 896..900
            packages/types/src/interfaces/runtime/types.ts on lines 122..126
            packages/types/src/interfaces/runtime/types.ts on lines 271..275
            packages/types/src/interfaces/system/types.ts on lines 444..448
            packages/types/src/interfaces/xcm/types.ts on lines 119..123
            packages/types/src/interfaces/xcm/types.ts on lines 478..482
            packages/types/src/interfaces/xcm/types.ts on lines 636..640

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

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

            export interface Scheduling extends Enum {
              readonly isAlways: boolean;
              readonly isDynamic: boolean;
              readonly type: 'Always' | 'Dynamic';
            }
            Severity: Major
            Found in packages/types/src/interfaces/parachains/types.ts and 17 other locations - About 30 mins to fix
            packages/types/src/interfaces/balances/types.ts on lines 31..35
            packages/types/src/interfaces/bridges/types.ts on lines 44..48
            packages/types/src/interfaces/nompools/types.ts on lines 7..11
            packages/types/src/interfaces/parachains/types.ts on lines 240..244
            packages/types/src/interfaces/parachains/types.ts on lines 255..259
            packages/types/src/interfaces/parachains/types.ts on lines 641..645
            packages/types/src/interfaces/parachains/types.ts on lines 688..692
            packages/types/src/interfaces/parachains/types.ts on lines 695..699
            packages/types/src/interfaces/parachains/types.ts on lines 763..767
            packages/types/src/interfaces/parachains/types.ts on lines 806..810
            packages/types/src/interfaces/parachains/types.ts on lines 896..900
            packages/types/src/interfaces/runtime/types.ts on lines 122..126
            packages/types/src/interfaces/runtime/types.ts on lines 271..275
            packages/types/src/interfaces/system/types.ts on lines 444..448
            packages/types/src/interfaces/xcm/types.ts on lines 119..123
            packages/types/src/interfaces/xcm/types.ts on lines 478..482
            packages/types/src/interfaces/xcm/types.ts on lines 636..640

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

            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