webdriverio/wdio-cucumber-framework

View on GitHub

Showing 110 of 110 total issues

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

    describe('beforeScenario', () => {
        let beforeScenarioHook

        before(() => {
            beforeScenarioHook = global._wdio.beforeScenario
Severity: Major
Found in test/hooks.spec.js and 1 other location - About 7 hrs to fix
test/hooks.spec.js on lines 200..220

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

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('Test matching Tag found at Scenario Outline Example', () => {
        before(async () => {
            global.browser = new WebdriverIO()
            const adapter = new CucumberAdapter(0, soMatchConf, specs, {})
            global.browser.getPrototype = () => WebdriverIO.prototype
Severity: Major
Found in test/tags.spec.js and 1 other location - About 7 hrs to fix
test/tags.spec.js on lines 50..64

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

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('Test matching Tag found at Scenario', () => {
        before(async () => {
            global.browser = new WebdriverIO()
            const adapter = new CucumberAdapter(0, scenarioMatchConf, specs, {})
            global.browser.getPrototype = () => WebdriverIO.prototype
Severity: Major
Found in test/tags.spec.js and 1 other location - About 7 hrs to fix
test/tags.spec.js on lines 34..48

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

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

WebdriverIO.prototype = {
    /**
     * task of this command is to add 1 so we can have a simple demo test like
     * browser.command(1).should.be.equal(2)
     */
Severity: Major
Found in test/tags.spec.js and 1 other location - About 5 hrs to fix
test/tests.spec.js on lines 11..28

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

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

WebdriverIO.prototype = {
    /**
     * task of this command is to add 1 so we can have a simple demo test like
     * browser.command(1).should.be.equal(2)
     */
Severity: Major
Found in test/tests.spec.js and 1 other location - About 5 hrs to fix
test/tags.spec.js on lines 11..28

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

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

        new CucumberEventListener(eventBroadcaster)
            .on('before-feature', this.handleBeforeFeature.bind(this))
            .on('before-scenario', this.handleBeforeScenario.bind(this))
            .on('before-step', this.handleBeforeStep.bind(this))
            .on('after-step', this.handleAfterStep.bind(this))
Severity: Major
Found in lib/reporter.js and 1 other location - About 4 hrs to fix
lib/hookRunner.js on lines 10..16

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

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

        new CucumberEventListener(eventBroadcaster)
            .on('before-feature', this.handleBeforeFeature.bind(this))
            .on('before-scenario', this.handleBeforeScenario.bind(this))
            .on('before-step', this.handleBeforeStep.bind(this))
            .on('after-step', this.handleAfterStep.bind(this))
Severity: Major
Found in lib/hookRunner.js and 1 other location - About 4 hrs to fix
lib/reporter.js on lines 22..28

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

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

    beforeScenario: (...args) => {
        global.___wdio.beforeScenario.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.beforeScenario.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    beforeCommand: (...args) => {
        global.___wdio.beforeCommand.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.beforeCommand.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    afterFeature: (...args) => {
        global.___wdio.afterFeature.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.afterFeature.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    afterScenario: (...args) => {
        global._wdio.afterScenario = {
            wasExecuted: true,
            start: new Date().getTime(),
            args
Severity: Major
Found in test/fixtures/hooks.using.native.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.native.promises.js on lines 15..28
test/fixtures/hooks.using.native.promises.js on lines 29..42
test/fixtures/hooks.using.native.promises.js on lines 43..56
test/fixtures/hooks.using.native.promises.js on lines 57..70
test/fixtures/hooks.using.native.promises.js on lines 71..84
test/fixtures/hooks.using.native.promises.js on lines 85..98
test/fixtures/hooks.using.native.promises.js on lines 99..112
test/fixtures/hooks.using.native.promises.js on lines 127..140
test/fixtures/hooks.using.native.promises.js on lines 141..154

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

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

    afterCommand: (...args) => {
        global.___wdio.afterCommand.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.afterCommand.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    afterStep: (...args) => {
        global.___wdio.afterStep.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.afterStep.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    afterScenario: (...args) => {
        global.___wdio.afterScenario.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.afterScenario.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    beforeStep: (...args) => {
        global._wdio.beforeStep = {
            wasExecuted: true,
            start: new Date().getTime(),
            args
Severity: Major
Found in test/fixtures/hooks.using.native.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.native.promises.js on lines 15..28
test/fixtures/hooks.using.native.promises.js on lines 29..42
test/fixtures/hooks.using.native.promises.js on lines 43..56
test/fixtures/hooks.using.native.promises.js on lines 71..84
test/fixtures/hooks.using.native.promises.js on lines 85..98
test/fixtures/hooks.using.native.promises.js on lines 99..112
test/fixtures/hooks.using.native.promises.js on lines 113..126
test/fixtures/hooks.using.native.promises.js on lines 127..140
test/fixtures/hooks.using.native.promises.js on lines 141..154

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

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

    beforeCommand: (...args) => {
        global._wdio.beforeCommand = {
            wasExecuted: true,
            start: new Date().getTime(),
            args
Severity: Major
Found in test/fixtures/hooks.using.native.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.native.promises.js on lines 15..28
test/fixtures/hooks.using.native.promises.js on lines 29..42
test/fixtures/hooks.using.native.promises.js on lines 43..56
test/fixtures/hooks.using.native.promises.js on lines 57..70
test/fixtures/hooks.using.native.promises.js on lines 85..98
test/fixtures/hooks.using.native.promises.js on lines 99..112
test/fixtures/hooks.using.native.promises.js on lines 113..126
test/fixtures/hooks.using.native.promises.js on lines 127..140
test/fixtures/hooks.using.native.promises.js on lines 141..154

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

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

    beforeStep: (...args) => {
        global.___wdio.beforeStep.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.beforeStep.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 29..37
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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

    before: (...args) => {
        global._wdio.before = {
            wasExecuted: true,
            start: new Date().getTime(),
            args
Severity: Major
Found in test/fixtures/hooks.using.native.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.native.promises.js on lines 29..42
test/fixtures/hooks.using.native.promises.js on lines 43..56
test/fixtures/hooks.using.native.promises.js on lines 57..70
test/fixtures/hooks.using.native.promises.js on lines 71..84
test/fixtures/hooks.using.native.promises.js on lines 85..98
test/fixtures/hooks.using.native.promises.js on lines 99..112
test/fixtures/hooks.using.native.promises.js on lines 113..126
test/fixtures/hooks.using.native.promises.js on lines 127..140
test/fixtures/hooks.using.native.promises.js on lines 141..154

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

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

    beforeFeature: (...args) => {
        global._wdio.beforeFeature = {
            wasExecuted: true,
            start: new Date().getTime(),
            args
Severity: Major
Found in test/fixtures/hooks.using.native.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.native.promises.js on lines 15..28
test/fixtures/hooks.using.native.promises.js on lines 43..56
test/fixtures/hooks.using.native.promises.js on lines 57..70
test/fixtures/hooks.using.native.promises.js on lines 71..84
test/fixtures/hooks.using.native.promises.js on lines 85..98
test/fixtures/hooks.using.native.promises.js on lines 99..112
test/fixtures/hooks.using.native.promises.js on lines 113..126
test/fixtures/hooks.using.native.promises.js on lines 127..140
test/fixtures/hooks.using.native.promises.js on lines 141..154

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

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

    before: (...args) => {
        global.___wdio.before.start = new Date().getTime()
        const defer = q.defer()
        setTimeout(() => {
            global.___wdio.before.end = new Date().getTime()
Severity: Major
Found in test/fixtures/hooks.using.q.promises.js and 9 other locations - About 4 hrs to fix
test/fixtures/hooks.using.q.promises.js on lines 38..46
test/fixtures/hooks.using.q.promises.js on lines 47..55
test/fixtures/hooks.using.q.promises.js on lines 56..64
test/fixtures/hooks.using.q.promises.js on lines 65..73
test/fixtures/hooks.using.q.promises.js on lines 74..82
test/fixtures/hooks.using.q.promises.js on lines 83..91
test/fixtures/hooks.using.q.promises.js on lines 92..100
test/fixtures/hooks.using.q.promises.js on lines 101..109
test/fixtures/hooks.using.q.promises.js on lines 110..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 115.

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