polkadot-js/api

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

Summary

Maintainability
D
1 day
Test Coverage

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

export interface BenchmarkParameter extends Enum {
  readonly isA: boolean;
  readonly isB: boolean;
  readonly isC: boolean;
  readonly isD: boolean;
Severity: Major
Found in packages/types/src/interfaces/benchmark/types.ts and 1 other location - About 1 day to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 7589..7617

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

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 BenchmarkConfig extends Struct {
  readonly pallet: Bytes;
  readonly benchmark: Bytes;
  readonly selectedComponents: Vec<ITuple<[BenchmarkParameter, u32]>>;
  readonly verify: bool;
Severity: Major
Found in packages/types/src/interfaces/benchmark/types.ts and 1 other location - About 1 hr to fix
packages/types-augment/src/lookup/types-substrate.ts on lines 4777..4783

Duplicated Code

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

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

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

Tuning

This issue has a mass of 65.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status