polkadot-js/api

View on GitHub

Showing 2,427 of 2,612 total issues

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

    it('correctly decodes [u16; 4]', (): void => {
      expect(
        registry.createTypeUnsafe('[u16; 4]', ['0x0012002300450067'], { isPedantic: true }).toHex()
      ).toEqual('0x0012002300450067');
    });
Severity: Major
Found in packages/types/src/create/createType.spec.ts and 2 other locations - About 1 hr to fix
packages/types/src/create/createType.spec.ts on lines 131..135
packages/types/src/create/createType.spec.ts on lines 143..147

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

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

    it('correctly decodes Text', (): void => {
      expect(
        registry.createTypeUnsafe('Text', ['0x70726f7669646572'], { isPedantic: true }).toString()
      ).toEqual('provider');
    });
Severity: Major
Found in packages/types/src/create/createType.spec.ts and 2 other locations - About 1 hr to fix
packages/types/src/create/createType.spec.ts on lines 131..135
packages/types/src/create/createType.spec.ts on lines 155..159

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

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

    it('correctly decodes Bytes', (): void => {
      expect(
        registry.createTypeUnsafe('Bytes', ['0x12345678'], { isPedantic: true }).toHex()
      ).toEqual('0x12345678');
    });
Severity: Major
Found in packages/types/src/create/createType.spec.ts and 2 other locations - About 1 hr to fix
packages/types/src/create/createType.spec.ts on lines 143..147
packages/types/src/create/createType.spec.ts on lines 155..159

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

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

      getStorageSize: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;
Severity: Major
Found in packages/rpc-augment/src/augment/jsonrpc.ts and 1 other location - About 1 hr to fix
packages/rpc-augment/src/augment/jsonrpc.ts on lines 492..492

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

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

    readonly asCoreAssigned: {
      readonly core: u16;
      readonly when: u32;
      readonly assignment: Vec<ITuple<[PalletBrokerCoretimeInterfaceCoreAssignment, u16]>>;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 1 other location - About 1 hr to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 6307..6311

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

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

      getStorageHash: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;
Severity: Major
Found in packages/rpc-augment/src/augment/jsonrpc.ts and 1 other location - About 1 hr to fix
packages/rpc-augment/src/augment/jsonrpc.ts on lines 496..496

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

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

  PalletAssetRateCall: {
    _enum: {
      create: {
        assetKind: 'u32',
        rate: 'u128',
Severity: Major
Found in packages/types-augment/src/lookup/substrate.ts and 1 other location - About 1 hr to fix
packages/types-augment/src/lookup/substrate.ts on lines 2378..2392

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

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

    readonly asSwapCreditExecuted: {
      readonly amountIn: u128;
      readonly amountOut: u128;
      readonly path: Vec<ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, u128]>>;
    } & Struct;
Severity: Major
Found in packages/types-augment/src/lookup/types-substrate.ts and 1 other location - About 1 hr to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 6679..6683

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

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

  PalletBabeCall: {
    _enum: {
      report_equivocation: {
        equivocationProof: 'SpConsensusSlotsEquivocationProof',
        keyOwnerProof: 'SpSessionMembershipProof',
Severity: Major
Found in packages/types-augment/src/lookup/substrate.ts and 1 other location - About 1 hr to fix
packages/types-augment/src/lookup/substrate.ts on lines 3079..3093

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

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

export interface EthBlock extends Struct {
  readonly header: EthHeader;
  readonly transactions: Vec<EthTransaction>;
  readonly ommers: Vec<EthHeader>;
}
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface ContractEventSpecV2 extends Struct {
  readonly label: Text;
  readonly args: Vec<ContractEventParamSpecV2>;
  readonly docs: Vec<Text>;
}
Severity: Major
Found in packages/types/src/interfaces/contractsAbi/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface BlockV0 extends Struct {
  readonly header: EthHeader;
  readonly transactions: Vec<TransactionV0>;
  readonly ommers: Vec<EthHeader>;
}
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface BlockV1 extends Struct {
  readonly header: EthHeader;
  readonly transactions: Vec<TransactionV1>;
  readonly ommers: Vec<EthHeader>;
}
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface DefunctVoter extends Struct {
  readonly who: AccountId;
  readonly voteCount: Compact<u32>;
  readonly candidateCount: Compact<u32>;
}
Severity: Major
Found in packages/types/src/interfaces/elections/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface EventMetadataV9 extends Struct {
  readonly name: Text;
  readonly args: Vec<Type>;
  readonly docs: Vec<Text>;
}
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface ContractEventSpecV1 extends Struct {
  readonly name: Text;
  readonly args: Vec<ContractEventParamSpecV0>;
  readonly docs: Vec<Text>;
}
Severity: Major
Found in packages/types/src/interfaces/contractsAbi/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface FunctionMetadataV9 extends Struct {
  readonly name: Text;
  readonly args: Vec<FunctionArgumentMetadataV9>;
  readonly docs: Vec<Text>;
}
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface BlockV2 extends Struct {
  readonly header: EthHeader;
  readonly transactions: Vec<TransactionV2>;
  readonly ommers: Vec<EthHeader>;
}
Severity: Major
Found in packages/types/src/interfaces/eth/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169
packages/types/src/interfaces/metadata/types.ts on lines 405..409

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

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

export interface RuntimeApiMetadataV15 extends Struct {
  readonly name: Text;
  readonly methods: Vec<RuntimeApiMethodMetadataV15>;
  readonly docs: Vec<Text>;
}
Severity: Major
Found in packages/types/src/interfaces/metadata/types.ts and 11 other locations - About 1 hr to fix
packages/types/src/interfaces/attestations/types.ts on lines 10..14
packages/types/src/interfaces/contractsAbi/types.ts on lines 153..157
packages/types/src/interfaces/contractsAbi/types.ts on lines 160..164
packages/types/src/interfaces/contractsAbi/types.ts on lines 167..171
packages/types/src/interfaces/elections/types.ts on lines 12..16
packages/types/src/interfaces/eth/types.ts on lines 9..13
packages/types/src/interfaces/eth/types.ts on lines 16..20
packages/types/src/interfaces/eth/types.ts on lines 23..27
packages/types/src/interfaces/eth/types.ts on lines 84..88
packages/types/src/interfaces/metadata/types.ts on lines 74..78
packages/types/src/interfaces/metadata/types.ts on lines 165..169

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

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

  call: {
    description: 'Call contract, returning the output data.',
    params: [
      {
        name: 'request',
Severity: Major
Found in packages/types/src/interfaces/eth/rpc.ts and 6 other locations - About 1 hr to fix
packages/types/src/interfaces/eth/rpc.ts on lines 83..98
packages/types/src/interfaces/eth/rpc.ts on lines 122..137
packages/types/src/interfaces/eth/rpc.ts on lines 183..198
packages/types/src/interfaces/eth/rpc.ts on lines 305..320
packages/types/src/interfaces/state/rpc.ts on lines 233..248
packages/types/src/interfaces/state/rpc.ts on lines 333..348

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

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