cucumber/cucumber-js

View on GitHub

Showing 232 of 232 total issues

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

        it('returns the error', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceOf(Error)
          expect(error.message).to.eql('{ error: [Circular] }')
          expect(result).to.eql(undefined)
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 24..29
src/user_code_runner_spec.js on lines 78..83
src/user_code_runner_spec.js on lines 97..102
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 184..189
src/user_code_runner_spec.js on lines 199..204
src/user_code_runner_spec.js on lines 214..221

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

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

        it('returns timeout as an error', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceof(Error)
          expect(error.message).to.eql(
            'function timed out, ensure the promise resolves within 100 milliseconds'
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 24..29
src/user_code_runner_spec.js on lines 41..46
src/user_code_runner_spec.js on lines 78..83
src/user_code_runner_spec.js on lines 97..102
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 184..189
src/user_code_runner_spec.js on lines 199..204

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

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

        it('returns a helpful error message', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceOf(Error)
          expect(error.message).to.eql('Promise rejected without a reason')
          expect(result).to.eql(undefined)
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 24..29
src/user_code_runner_spec.js on lines 41..46
src/user_code_runner_spec.js on lines 78..83
src/user_code_runner_spec.js on lines 97..102
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 184..189
src/user_code_runner_spec.js on lines 214..221

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

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('emits test-step-finished', function() {
        expect(this.onTestStepFinished).to.have.callCount(1)
        expect(this.onTestStepFinished).to.have.been.calledWith({
          index: 0,
          testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
Severity: Major
Found in src/runtime/test_case_runner_spec.js and 1 other location - About 3 hrs to fix
src/runtime/test_case_runner_spec.js on lines 419..426

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

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

        it('returns what the promise rejects as an error', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceOf(Error)
          expect(error.message).to.eql('error')
          expect(result).to.eql(undefined)
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 24..29
src/user_code_runner_spec.js on lines 41..46
src/user_code_runner_spec.js on lines 78..83
src/user_code_runner_spec.js on lines 97..102
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 199..204
src/user_code_runner_spec.js on lines 214..221

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

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

        it('returns the error', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceOf(Error)
          expect(error.message).to.eql('error')
          expect(result).to.eql(undefined)
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 41..46
src/user_code_runner_spec.js on lines 78..83
src/user_code_runner_spec.js on lines 97..102
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 184..189
src/user_code_runner_spec.js on lines 199..204
src/user_code_runner_spec.js on lines 214..221

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

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

        it('returns the error', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceOf(Error)
          expect(error.message).to.eql('error')
          expect(result).to.eql(undefined)
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 24..29
src/user_code_runner_spec.js on lines 41..46
src/user_code_runner_spec.js on lines 97..102
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 184..189
src/user_code_runner_spec.js on lines 199..204
src/user_code_runner_spec.js on lines 214..221

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

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('emits test-step-finished', function() {
        expect(this.onTestStepFinished).to.have.callCount(1)
        expect(this.onTestStepFinished).to.have.been.calledWith({
          index: 0,
          testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
Severity: Major
Found in src/runtime/test_case_runner_spec.js and 1 other location - About 3 hrs to fix
src/runtime/test_case_runner_spec.js on lines 354..361

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

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

        it('returns the error', async function() {
          const { error, result } = await UserCodeRunner.run(this.options)
          expect(error).to.be.instanceOf(Error)
          expect(error.message).to.eql('{ error: [Circular] }')
          expect(result).to.eql(undefined)
Severity: Major
Found in src/user_code_runner_spec.js and 7 other locations - About 3 hrs to fix
src/user_code_runner_spec.js on lines 24..29
src/user_code_runner_spec.js on lines 41..46
src/user_code_runner_spec.js on lines 78..83
src/user_code_runner_spec.js on lines 130..137
src/user_code_runner_spec.js on lines 184..189
src/user_code_runner_spec.js on lines 199..204
src/user_code_runner_spec.js on lines 214..221

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

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

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

      it('emits test-case-prepared', function() {
        expect(this.onTestCasePrepared).to.have.callCount(1)
        expect(this.onTestCasePrepared).to.have.been.calledWith({
          steps: [
            {
Severity: Major
Found in src/runtime/test_case_runner_spec.js and 1 other location - About 3 hrs to fix
src/runtime/test_case_runner_spec.js on lines 331..337

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

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

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

      it('emits test-case-prepared', function() {
        expect(this.onTestCasePrepared).to.have.callCount(1)
        expect(this.onTestCasePrepared).to.have.been.calledWith({
          steps: [{ sourceLocation: { line: 2, uri: 'path/to/feature' } }],
          sourceLocation: { line: 1, uri: 'path/to/feature' },
Severity: Major
Found in src/runtime/test_case_runner_spec.js and 1 other location - About 3 hrs to fix
src/runtime/test_case_runner_spec.js on lines 260..270

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

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

    describe('with a duration of 120.3 seconds', () => {
      beforeEach(function() {
        this.testRun.result.duration = 123 * 1000
        this.result = formatSummary(this.options)
      })
Severity: Major
Found in src/formatter/helpers/summary_helpers_spec.js and 1 other location - About 3 hrs to fix
src/formatter/helpers/summary_helpers_spec.js on lines 180..191

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

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

    describe('with a duration of 12.3 seconds', () => {
      beforeEach(function() {
        this.testRun.result.duration = 123 * 100
        this.result = formatSummary(this.options)
      })
Severity: Major
Found in src/formatter/helpers/summary_helpers_spec.js and 1 other location - About 3 hrs to fix
src/formatter/helpers/summary_helpers_spec.js on lines 193..204

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

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

Function parse has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static parse(argv) {
    const program = new Command(path.basename(argv[1]))

    program
      .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')
Severity: Major
Found in src/cli/argv_parser.js - About 3 hrs to fix

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

          it('emits test-case-finished', function() {
            expect(this.onTestCaseFinished).to.have.callCount(1)
            expect(this.onTestCaseFinished).to.have.been.calledWith({
              result: { duration: 0, status: Status.SKIPPED },
              sourceLocation: { line: 1, uri: 'path/to/feature' },
    Severity: Major
    Found in src/runtime/test_case_runner_spec.js and 5 other locations - About 3 hrs to fix
    src/runtime/test_case_runner_spec.js on lines 72..78
    src/runtime/test_case_runner_spec.js on lines 142..148
    src/runtime/test_case_runner_spec.js on lines 363..369
    src/runtime/test_case_runner_spec.js on lines 428..434
    src/runtime/test_case_runner_spec.js on lines 514..520

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

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

          it('emits test-case-finished', function() {
            expect(this.onTestCaseFinished).to.have.callCount(1)
            expect(this.onTestCaseFinished).to.have.been.calledWith({
              result: { duration: 0, status: Status.SKIPPED },
              sourceLocation: { line: 1, uri: 'path/to/feature' },
    Severity: Major
    Found in src/runtime/test_case_runner_spec.js and 5 other locations - About 3 hrs to fix
    src/runtime/test_case_runner_spec.js on lines 72..78
    src/runtime/test_case_runner_spec.js on lines 142..148
    src/runtime/test_case_runner_spec.js on lines 363..369
    src/runtime/test_case_runner_spec.js on lines 428..434
    src/runtime/test_case_runner_spec.js on lines 600..606

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

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

          it('emits test-case-finished', function() {
            expect(this.onTestCaseFinished).to.have.callCount(1)
            expect(this.onTestCaseFinished).to.have.been.calledWith({
              result: { duration: 1, status: Status.PASSED },
              sourceLocation: { line: 1, uri: 'path/to/feature' },
    Severity: Major
    Found in src/runtime/test_case_runner_spec.js and 5 other locations - About 3 hrs to fix
    src/runtime/test_case_runner_spec.js on lines 72..78
    src/runtime/test_case_runner_spec.js on lines 363..369
    src/runtime/test_case_runner_spec.js on lines 428..434
    src/runtime/test_case_runner_spec.js on lines 514..520
    src/runtime/test_case_runner_spec.js on lines 600..606

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

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

          it('emits test-case-finished', function() {
            expect(this.onTestCaseFinished).to.have.callCount(1)
            expect(this.onTestCaseFinished).to.have.been.calledWith({
              result: { duration: 0, status: Status.SKIPPED },
              sourceLocation: { line: 1, uri: 'path/to/feature' },
    Severity: Major
    Found in src/runtime/test_case_runner_spec.js and 5 other locations - About 3 hrs to fix
    src/runtime/test_case_runner_spec.js on lines 72..78
    src/runtime/test_case_runner_spec.js on lines 142..148
    src/runtime/test_case_runner_spec.js on lines 363..369
    src/runtime/test_case_runner_spec.js on lines 514..520
    src/runtime/test_case_runner_spec.js on lines 600..606

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

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

          it('emits test-case-finished', function() {
            expect(this.onTestCaseFinished).to.have.callCount(1)
            expect(this.onTestCaseFinished).to.have.been.calledWith({
              result: { duration: 0, status: Status.UNDEFINED },
              sourceLocation: { line: 1, uri: 'path/to/feature' },
    Severity: Major
    Found in src/runtime/test_case_runner_spec.js and 5 other locations - About 3 hrs to fix
    src/runtime/test_case_runner_spec.js on lines 72..78
    src/runtime/test_case_runner_spec.js on lines 142..148
    src/runtime/test_case_runner_spec.js on lines 428..434
    src/runtime/test_case_runner_spec.js on lines 514..520
    src/runtime/test_case_runner_spec.js on lines 600..606

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

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

          it('emits test-case-finished', function() {
            expect(this.onTestCaseFinished).to.have.callCount(1)
            expect(this.onTestCaseFinished).to.have.been.calledWith({
              result: { duration: 0, status: Status.PASSED },
              sourceLocation: { line: 1, uri: 'path/to/feature' },
    Severity: Major
    Found in src/runtime/test_case_runner_spec.js and 5 other locations - About 3 hrs to fix
    src/runtime/test_case_runner_spec.js on lines 142..148
    src/runtime/test_case_runner_spec.js on lines 363..369
    src/runtime/test_case_runner_spec.js on lines 428..434
    src/runtime/test_case_runner_spec.js on lines 514..520
    src/runtime/test_case_runner_spec.js on lines 600..606

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

    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