polkadot-js/common

View on GitHub
packages/util-crypto/src/key/extractSuri.spec.ts

Summary

Maintainability
F
1 wk
Test Coverage

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

  it('derives on "hello world//DOT/1', (): void => {
    const test = keyExtractSuri('hello world//DOT/1');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 1 other location - About 1 day to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 64..74

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

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

  it('derives on "hello world//1/DOT', (): void => {
    const test = keyExtractSuri('hello world//1/DOT');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 1 other location - About 1 day to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 76..86

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

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

  it('derives on "hello world/1//DOT///password"', (): void => {
    const test = keyExtractSuri('hello world/1//DOT///password');

    expect(test.password).toEqual('password');
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 1 other location - About 1 day to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 96..106

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

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

  it('derives on "hello world//1/DOT///password"', (): void => {
    const test = keyExtractSuri('hello world//1/DOT///password');

    expect(test.password).toEqual('password');
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 1 other location - About 1 day to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 108..118

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

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

  it('derives on "hello world/1', (): void => {
    const test = keyExtractSuri('hello world/1');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 4 other locations - About 7 hrs to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 34..42
packages/util-crypto/src/key/extractSuri.spec.ts on lines 44..52
packages/util-crypto/src/key/extractSuri.spec.ts on lines 54..62
packages/util-crypto/src/key/extractSuri.spec.ts on lines 120..128

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

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

  it('derives on actual Alice', (): void => {
    const test = keyExtractSuri('bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('bottom drive obey lake curtain smoke basket hold race lonely fit walk');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 4 other locations - About 7 hrs to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 24..32
packages/util-crypto/src/key/extractSuri.spec.ts on lines 34..42
packages/util-crypto/src/key/extractSuri.spec.ts on lines 44..52
packages/util-crypto/src/key/extractSuri.spec.ts on lines 54..62

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

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

  it('derives on "hello world//DOT', (): void => {
    const test = keyExtractSuri('hello world//DOT');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 4 other locations - About 7 hrs to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 24..32
packages/util-crypto/src/key/extractSuri.spec.ts on lines 34..42
packages/util-crypto/src/key/extractSuri.spec.ts on lines 44..52
packages/util-crypto/src/key/extractSuri.spec.ts on lines 120..128

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

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

  it('derives on "hello world/DOT', (): void => {
    const test = keyExtractSuri('hello world/DOT');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 4 other locations - About 7 hrs to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 24..32
packages/util-crypto/src/key/extractSuri.spec.ts on lines 44..52
packages/util-crypto/src/key/extractSuri.spec.ts on lines 54..62
packages/util-crypto/src/key/extractSuri.spec.ts on lines 120..128

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

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

  it('derives on "hello world//1', (): void => {
    const test = keyExtractSuri('hello world//1');

    expect(test.password).not.toBeDefined();
    expect(test.phrase).toEqual('hello world');
Severity: Major
Found in packages/util-crypto/src/key/extractSuri.spec.ts and 4 other locations - About 7 hrs to fix
packages/util-crypto/src/key/extractSuri.spec.ts on lines 24..32
packages/util-crypto/src/key/extractSuri.spec.ts on lines 34..42
packages/util-crypto/src/key/extractSuri.spec.ts on lines 54..62
packages/util-crypto/src/key/extractSuri.spec.ts on lines 120..128

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

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