webdriverio/wdio-cucumber-framework

View on GitHub

Showing 110 of 110 total issues

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

    afterFeature: (...args) => {
        global.__wdio.afterFeature.start = new Date().getTime()
        browser.pause(500)
        global.__wdio.afterFeature.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 28..32
test/fixtures/hooks.using.wdio.commands.js on lines 33..37
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 43..47
test/fixtures/hooks.using.wdio.commands.js on lines 48..52
test/fixtures/hooks.using.wdio.commands.js on lines 53..57
test/fixtures/hooks.using.wdio.commands.js on lines 58..62
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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()
        browser.pause(500)
        global.__wdio.afterCommand.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 28..32
test/fixtures/hooks.using.wdio.commands.js on lines 33..37
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 43..47
test/fixtures/hooks.using.wdio.commands.js on lines 48..52
test/fixtures/hooks.using.wdio.commands.js on lines 58..62
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 68..72
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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()
        browser.pause(500)
        global.__wdio.afterStep.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 28..32
test/fixtures/hooks.using.wdio.commands.js on lines 33..37
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 43..47
test/fixtures/hooks.using.wdio.commands.js on lines 48..52
test/fixtures/hooks.using.wdio.commands.js on lines 53..57
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 68..72
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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.start = new Date().getTime()
        browser.pause(500)
        global.__wdio.beforeFeature.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 28..32
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 43..47
test/fixtures/hooks.using.wdio.commands.js on lines 48..52
test/fixtures/hooks.using.wdio.commands.js on lines 53..57
test/fixtures/hooks.using.wdio.commands.js on lines 58..62
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 68..72
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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()
        browser.pause(500)
        global.__wdio.beforeStep.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 28..32
test/fixtures/hooks.using.wdio.commands.js on lines 33..37
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 48..52
test/fixtures/hooks.using.wdio.commands.js on lines 53..57
test/fixtures/hooks.using.wdio.commands.js on lines 58..62
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 68..72
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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()
        browser.pause(500)
        global.__wdio.before.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 33..37
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 43..47
test/fixtures/hooks.using.wdio.commands.js on lines 48..52
test/fixtures/hooks.using.wdio.commands.js on lines 53..57
test/fixtures/hooks.using.wdio.commands.js on lines 58..62
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 68..72
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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()
        browser.pause(500)
        global.__wdio.beforeCommand.end = new Date().getTime()
    },
Severity: Major
Found in test/fixtures/hooks.using.wdio.commands.js and 9 other locations - About 2 hrs to fix
test/fixtures/hooks.using.wdio.commands.js on lines 28..32
test/fixtures/hooks.using.wdio.commands.js on lines 33..37
test/fixtures/hooks.using.wdio.commands.js on lines 38..42
test/fixtures/hooks.using.wdio.commands.js on lines 43..47
test/fixtures/hooks.using.wdio.commands.js on lines 53..57
test/fixtures/hooks.using.wdio.commands.js on lines 58..62
test/fixtures/hooks.using.wdio.commands.js on lines 63..67
test/fixtures/hooks.using.wdio.commands.js on lines 68..72
test/fixtures/hooks.using.wdio.commands.js on lines 73..77

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

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

        beforeEach(() => {
            eventBroadcaster = new EventEmitter()
            reporter = new CucumberReporter(eventBroadcaster, { failAmbiguousDefinitions: true }, '0-1', ['/foobar.js'])
            send = reporter.send = sinon.stub()
            send.returns(true)
Severity: Major
Found in test/reporter.spec.js and 1 other location - About 2 hrs to fix
test/reporter.spec.js on lines 499..506

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

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

        before(() => {
            eventBroadcaster = new EventEmitter()
            reporter = new CucumberReporter(eventBroadcaster, {
                tagsInTitle: true
            }, '0-1', ['/foobar.js'])
Severity: Major
Found in test/reporter.spec.js and 1 other location - About 2 hrs to fix
test/reporter.spec.js on lines 137..142

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

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

            eventBroadcaster.emit('test-step-finished', {
                index: 2,
                result: {
                    duration: 10,
                    status: 'failed',
Severity: Major
Found in test/reporter.spec.js and 1 other location - About 1 hr to fix
test/reporter.spec.js on lines 438..448

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

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

            eventBroadcaster.emit('test-step-finished', {
                index: 2,
                result: {
                    duration: 10,
                    status: 'failed',
Severity: Major
Found in test/reporter.spec.js and 1 other location - About 1 hr to fix
test/reporter.spec.js on lines 254..264

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

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('should defer execution until custom wdio command completes', () => {
        let duration = global.____wdio.customWdio.end - global.____wdio.customWdio.start
        duration.should.be.greaterThan(990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 599..602
test/hooks.spec.js on lines 604..607

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

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('should defer execution until custom q promise command resolves', () => {
        let duration = global.____wdio.customQPromise.end - global.____wdio.customQPromise.start
        duration.should.be.greaterThan(990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 599..602
test/hooks.spec.js on lines 604..607

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

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('should defer execution until custom command wrapping custom wdio command resolves', () => {
        let duration = global.____wdio.customWrapWdio.end - global.____wdio.customWrapWdio.start
        duration.should.be.greaterThan(990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 599..602
test/hooks.spec.js on lines 604..607

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

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('should defer execution until custom command wrapping wdio comamnd treated as promise resolves', () => {
        let duration = global.____wdio.customHandleWdioAsPromise.end - global.____wdio.customHandleWdioAsPromise.start
        duration.should.be.greaterThan(1990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 599..602

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

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('should defer execution until custom command wrapping two native promise commands resolves', () => {
        let duration = global.____wdio.customWrapTwoPromises.end - global.____wdio.customWrapTwoPromises.start
        duration.should.be.greaterThan(1990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 604..607

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

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('should defer execution until custom wdio promise command resolves', () => {
        let duration = global.____wdio.customWdioPromise.end - global.____wdio.customWdioPromise.start
        duration.should.be.greaterThan(990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 599..602
test/hooks.spec.js on lines 604..607

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

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('should defer execution until custom native promise command resolves', () => {
        let duration = global.____wdio.customNativePromise.end - global.____wdio.customNativePromise.start
        duration.should.be.greaterThan(990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 594..597
test/hooks.spec.js on lines 599..602
test/hooks.spec.js on lines 604..607

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

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('should defer execution until custom command wrapping custom wdio promise command resolves', () => {
        let duration = global.____wdio.customWrapWdioPromise.end - global.____wdio.customWrapWdioPromise.start
        duration.should.be.greaterThan(990)
    })
Severity: Major
Found in test/hooks.spec.js and 7 other locations - About 1 hr to fix
test/hooks.spec.js on lines 569..572
test/hooks.spec.js on lines 574..577
test/hooks.spec.js on lines 579..582
test/hooks.spec.js on lines 584..587
test/hooks.spec.js on lines 589..592
test/hooks.spec.js on lines 599..602
test/hooks.spec.js on lines 604..607

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

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 handleAfterStep has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    handleAfterStep (uri, feature, scenario, step, result, sourceLocation) {
        let e = 'undefined'
        switch (result.status) {
        case Status.FAILED:
        case Status.UNDEFINED:
Severity: Minor
Found in lib/reporter.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language