pipeletteio/debug

View on GitHub
__test__/specs/debug.spec.ts

Summary

Maintainability
A
0 mins
Test Coverage

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

  test('should debug mode is enabled when env PIPELETTEIO_DEBUG = "1"', () => {
    process.env.PIPELETTEIO_DEBUG = '1';
    const d = new Debug();
    expect(d.isDebug).toBe(true);
    expect(d.done).not.toBe(nop);
Severity: Major
Found in __test__/specs/debug.spec.ts and 2 other locations - About 2 hrs to fix
__test__/specs/debug.spec.ts on lines 139..144
__test__/specs/debug.spec.ts on lines 153..158

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

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

  test('should debug mode is enabled when env PIPELETTEIO_DEBUG = "true"', () => {
    process.env.PIPELETTEIO_DEBUG = 'true';
    const d = new Debug();
    expect(d.isDebug).toBe(true);
    expect(d.valid).not.toBe(nop);
Severity: Major
Found in __test__/specs/debug.spec.ts and 2 other locations - About 2 hrs to fix
__test__/specs/debug.spec.ts on lines 146..151
__test__/specs/debug.spec.ts on lines 153..158

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

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

  test('should debug mode is enabled when env DEBUG = "*"', () => {
    process.env.DEBUG = '*';
    const d = new Debug();
    expect(d.isDebug).toBe(true);
    expect(d.done).not.toBe(nop);
Severity: Major
Found in __test__/specs/debug.spec.ts and 2 other locations - About 2 hrs to fix
__test__/specs/debug.spec.ts on lines 139..144
__test__/specs/debug.spec.ts on lines 146..151

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

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

  test('should stderr works fine', () => {
    const stderr = getOutput('stderr');
    debug.error('error');
    debug.warn('warn');
    expect(stderr).toEqual(['error\n', 'warn\n']);
Severity: Major
Found in __test__/specs/debug.spec.ts and 1 other location - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 36..41

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

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

  test('should stdout works fine', () => {
    const stdout = getOutput('stdout');
    debug.log('log');
    debug.info('info');
    expect(stdout).toEqual(['log\n', 'info\n']);
Severity: Major
Found in __test__/specs/debug.spec.ts and 1 other location - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 29..34

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

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

  test('should valid works', () => {
    const stdout = getOutput('stdout');
    debug.valid('valid');
    expect(stdout.shift()).toMatch(/^✔ valid \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 45..49
__test__/specs/debug.spec.ts on lines 51..55
__test__/specs/debug.spec.ts on lines 57..61
__test__/specs/debug.spec.ts on lines 63..67
__test__/specs/debug.spec.ts on lines 75..79
__test__/specs/debug.spec.ts on lines 81..85

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

  test('should invalid works', () => {
    const stderr = getOutput('stderr');
    debug.invalid('invalid');
    expect(stderr.shift()).toMatch(/^✗ invalid \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 45..49
__test__/specs/debug.spec.ts on lines 51..55
__test__/specs/debug.spec.ts on lines 57..61
__test__/specs/debug.spec.ts on lines 69..73
__test__/specs/debug.spec.ts on lines 75..79
__test__/specs/debug.spec.ts on lines 81..85

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

  test('should question works', () => {
    const stdout = getOutput('stdout');
    debug.question('question');
    expect(stdout.shift()).toMatch(/^\? question \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 45..49
__test__/specs/debug.spec.ts on lines 51..55
__test__/specs/debug.spec.ts on lines 57..61
__test__/specs/debug.spec.ts on lines 63..67
__test__/specs/debug.spec.ts on lines 69..73
__test__/specs/debug.spec.ts on lines 81..85

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

  test('should done works', () => {
    const stdout = getOutput('stdout');
    debug.done('done');
    expect(stdout.shift()).toMatch(/^done \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 45..49
__test__/specs/debug.spec.ts on lines 57..61
__test__/specs/debug.spec.ts on lines 63..67
__test__/specs/debug.spec.ts on lines 69..73
__test__/specs/debug.spec.ts on lines 75..79
__test__/specs/debug.spec.ts on lines 81..85

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

  test('should title works', () => {
    const stdout = getOutput('stdout');
    debug.title('title');
    expect(stdout.shift()).toMatch(/^❱ title \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 45..49
__test__/specs/debug.spec.ts on lines 51..55
__test__/specs/debug.spec.ts on lines 57..61
__test__/specs/debug.spec.ts on lines 63..67
__test__/specs/debug.spec.ts on lines 69..73
__test__/specs/debug.spec.ts on lines 75..79

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

  test('should fail works', () => {
    const stderr = getOutput('stderr');
    debug.fail('fail');
    expect(stderr.shift()).toMatch(/^fail \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 51..55
__test__/specs/debug.spec.ts on lines 57..61
__test__/specs/debug.spec.ts on lines 63..67
__test__/specs/debug.spec.ts on lines 69..73
__test__/specs/debug.spec.ts on lines 75..79
__test__/specs/debug.spec.ts on lines 81..85

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

  test('should note works', () => {
    const stdout = getOutput('stdout');
    debug.note('note');
    expect(stdout.shift()).toMatch(/^note \+\d{1,3}ms\n/);
  });
Severity: Major
Found in __test__/specs/debug.spec.ts and 6 other locations - About 1 hr to fix
__test__/specs/debug.spec.ts on lines 45..49
__test__/specs/debug.spec.ts on lines 51..55
__test__/specs/debug.spec.ts on lines 63..67
__test__/specs/debug.spec.ts on lines 69..73
__test__/specs/debug.spec.ts on lines 75..79
__test__/specs/debug.spec.ts on lines 81..85

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

There are no issues that match your filters.

Category
Status