preceptorjs/taxi

View on GitHub
lib/compatibility/nightwatch.js

Summary

Maintainability
F
1 wk
Test Coverage

File nightwatch.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var logMethods = require('../log');
var type = require('../type');
var when = require('../when');
Severity: Minor
Found in lib/compatibility/nightwatch.js - About 2 hrs to fix

Function waitForElementVisible has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

Nightwatch.prototype.waitForElementVisible = function (selector, time, abortOnFailure, cb, message) {
Severity: Minor
Found in lib/compatibility/nightwatch.js - About 35 mins to fix

Function waitForElementNotPresent has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

Nightwatch.prototype.waitForElementNotPresent = function (selector, time, abortOnFailure, cb, message) {
Severity: Minor
Found in lib/compatibility/nightwatch.js - About 35 mins to fix

Function waitForElementNotVisible has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

Nightwatch.prototype.waitForElementNotVisible = function (selector, time, abortOnFailure, cb, message) {
Severity: Minor
Found in lib/compatibility/nightwatch.js - About 35 mins to fix

Function waitForElementPresent has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

Nightwatch.prototype.waitForElementPresent = function (selector, time, abortOnFailure, cb, message) {
Severity: Minor
Found in lib/compatibility/nightwatch.js - About 35 mins to fix

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

Nightwatch.prototype.waitForElementVisible = function (selector, time, abortOnFailure, cb, message) {
    var msg = (message || "Element " + selector + " was not visible in the page for " + time + " ms").replace('%s', selector).replace('%d', time);
    return when(this._driver.utils().waitUntil(function () {
        return when(this._driver.browser().activeWindow().getElements(selector), function (elements) {
            if (elements.length > 0) {
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 day to fix
lib/compatibility/nightwatch.js on lines 316..329

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

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

Nightwatch.prototype.waitForElementNotVisible = function (selector, time, abortOnFailure, cb, message) {
    var msg = (message || "Element " + selector + " was visible in the page for " + time + " ms").replace('%s', selector).replace('%d', time);
    return when(this._driver.utils().waitUntil(function () {
        return when(this._driver.browser().activeWindow().getElements(selector), function (elements) {
            if (elements.length > 0) {
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 day to fix
lib/compatibility/nightwatch.js on lines 344..357

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

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

Nightwatch.prototype.waitForElementPresent = function (selector, time, abortOnFailure, cb, message) {
    var msg = (message || "Element " + selector + " was not in the page for " + time + " ms").replace('%s', selector).replace('%d', time);
    return when(this._driver.utils().waitUntil(function () {
        return when(this._driver.browser().activeWindow().getElements(selector), function (elements) {
            return (elements.length != 0);
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 day to fix
lib/compatibility/nightwatch.js on lines 303..314

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

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

Nightwatch.prototype.waitForElementNotPresent = function (selector, time, abortOnFailure, cb, message) {
    var msg = (message || "Element " + selector + " was in the page for " + time + " ms").replace('%s', selector).replace('%d', time);
    return when(this._driver.utils().waitUntil(function () {
        return when(this._driver.browser().activeWindow().getElements(selector), function (elements) {
            return (elements.length == 0);
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 day to fix
lib/compatibility/nightwatch.js on lines 331..342

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

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

Nightwatch.prototype.getAttribute = function (selector, attribute, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getAttribute(attribute), function (value) {
            return this._scopeCallBack(cb, [value, attribute, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 3 hrs to fix
lib/compatibility/nightwatch.js on lines 149..155

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

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

Nightwatch.prototype.getCssProperty = function (selector, property, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getCssValue(property), function (value) {
            return this._scopeCallBack(cb, [value, property, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 3 hrs to fix
lib/compatibility/nightwatch.js on lines 129..135

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

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

Nightwatch.prototype.getTagName = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getTagName(), function (name) {
            return this._scopeCallBack(cb, [name, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 5 other locations - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 157..163
lib/compatibility/nightwatch.js on lines 165..171
lib/compatibility/nightwatch.js on lines 173..179
lib/compatibility/nightwatch.js on lines 201..207
lib/compatibility/nightwatch.js on lines 215..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 92.

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

Nightwatch.prototype.getValue = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getValue(), function (value) {
            return this._scopeCallBack(cb, [value, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 5 other locations - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 157..163
lib/compatibility/nightwatch.js on lines 165..171
lib/compatibility/nightwatch.js on lines 173..179
lib/compatibility/nightwatch.js on lines 193..199
lib/compatibility/nightwatch.js on lines 201..207

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

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

Nightwatch.prototype.getLocationInView = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getPositionInView(), function (position) {
            return this._scopeCallBack(cb, [position, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 5 other locations - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 157..163
lib/compatibility/nightwatch.js on lines 165..171
lib/compatibility/nightwatch.js on lines 193..199
lib/compatibility/nightwatch.js on lines 201..207
lib/compatibility/nightwatch.js on lines 215..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 92.

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

Nightwatch.prototype.getLocation = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getPosition(), function (position) {
            return this._scopeCallBack(cb, [position, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 5 other locations - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 157..163
lib/compatibility/nightwatch.js on lines 173..179
lib/compatibility/nightwatch.js on lines 193..199
lib/compatibility/nightwatch.js on lines 201..207
lib/compatibility/nightwatch.js on lines 215..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 92.

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

Nightwatch.prototype.getText = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getText(), function (text) {
            return this._scopeCallBack(cb, [text, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 5 other locations - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 157..163
lib/compatibility/nightwatch.js on lines 165..171
lib/compatibility/nightwatch.js on lines 173..179
lib/compatibility/nightwatch.js on lines 193..199
lib/compatibility/nightwatch.js on lines 215..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 92.

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

Nightwatch.prototype.getElementSize = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.getSize(), function (size) {
            return this._scopeCallBack(cb, [size, element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 5 other locations - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 165..171
lib/compatibility/nightwatch.js on lines 173..179
lib/compatibility/nightwatch.js on lines 193..199
lib/compatibility/nightwatch.js on lines 201..207
lib/compatibility/nightwatch.js on lines 215..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 92.

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

Nightwatch.prototype.clearValue = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.clear(), function () {
            return this._scopeCallBack(cb, [element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 284..290

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

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

Nightwatch.prototype.submitForm = function (selector, cb) {
    return this._elementAction(selector, function (element) {
        return when(element.submit(), function () {
            return this._scopeCallBack(cb, [element]);
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 95..101

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

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

Nightwatch.prototype.deleteCookies = function (cb) {
    return this._driverAction(this._driver.browser().cookieStorage().clear(), function () {
        return this._scopeCallBack(cb, []);
    }.bind(this));
};
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 111..115

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

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

Nightwatch.prototype.closeWindow = function (cb) {
    return this._driverAction(this._driver.browser().activeWindow().close(), function () {
        return this._scopeCallBack(cb, []);
    }.bind(this));
};
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 123..127

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

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

Nightwatch.prototype.getTitle = function (cb) {
    return when(this._driver.browser().activeWindow().getTitle(), function (title) {
        return this._scopeCallBack(cb, [title]);
    }.bind(this));
};
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 143..147

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

Nightwatch.prototype.getCookies = function (cb) {
    return when(this._driver.browser().cookieStorage().getCookies(), function (cookies) {
        return this._scopeCallBack(cb, [cookies]);
    }.bind(this));
};
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 2 hrs to fix
lib/compatibility/nightwatch.js on lines 209..213

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

Nightwatch.prototype._driverAction = function (value, fn) {
    return when(value, function (result) {
        return when(fn(result), function () {
            return this;
        }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 hr to fix
lib/chain.js on lines 160..166

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

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

    return when(this._driver.browser().activeWindow().saveScreenshot(path), function () {
        return this._scopeCallBack(cb, []);
    }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 hr to fix
lib/compatibility/nightwatch.js on lines 118..120

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

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

    return this._driverAction(this._driver.browser().cookieStorage().removeCookie(name), function () {
        return this._scopeCallBack(cb, []);
    }.bind(this));
Severity: Major
Found in lib/compatibility/nightwatch.js and 1 other location - About 1 hr to fix
lib/compatibility/nightwatch.js on lines 265..267

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

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

Nightwatch.prototype._logMethodCall = function (event) {
    event.target = 'Nightwatch';
    this._driver._logMethodCall(event);
};
Severity: Major
Found in lib/compatibility/nightwatch.js and 22 other locations - About 55 mins to fix
lib/alert.js on lines 35..38
lib/browser.js on lines 40..43
lib/chain.js on lines 74..77
lib/comparison/blinkdiff.js on lines 43..46
lib/compatibility.js on lines 35..38
lib/cookieStorage.js on lines 39..42
lib/frame.js on lines 34..37
lib/globalMouse.js on lines 36..39
lib/globalTouch.js on lines 33..36
lib/helpers/comparison.js on lines 40..43
lib/helpers/devicePixelRatio.js on lines 38..41
lib/helpers/screenshot.js on lines 39..42
lib/helpers/stitching.js on lines 38..41
lib/ime.js on lines 33..36
lib/localStorage.js on lines 33..36
lib/mouse.js on lines 68..71
lib/navigator.js on lines 34..37
lib/sessionStorage.js on lines 33..36
lib/timeOut.js on lines 80..83
lib/touch.js on lines 36..39
lib/utils.js on lines 36..39
lib/window.js on lines 36..39

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

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

    return when(this._driver.browser().activateWindow(handleOrName), function () {
        return this._scopeCallBack(cb, []);
    }.bind(this));
Severity: Minor
Found in lib/compatibility/nightwatch.js and 1 other location - About 50 mins to fix
lib/compatibility/nightwatch.js on lines 252..254

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

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

    return when(this._driver.utils().sleep(ms), function () {
        return this._scopeCallBack(cb, []);
    }.bind(this));
Severity: Minor
Found in lib/compatibility/nightwatch.js and 1 other location - About 50 mins to fix
lib/compatibility/nightwatch.js on lines 293..295

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

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

Nightwatch.prototype._requestJSON = function (method, path, body) {
    return this._driver._requestJSON(method, path, body);
};
Severity: Major
Found in lib/compatibility/nightwatch.js and 13 other locations - About 35 mins to fix
lib/alert.js on lines 52..54
lib/browser.js on lines 56..58
lib/chain.js on lines 91..93
lib/comparison/blinkdiff.js on lines 60..62
lib/compatibility.js on lines 52..54
lib/globalMouse.js on lines 53..55
lib/helpers/comparison.js on lines 57..59
lib/helpers/devicePixelRatio.js on lines 55..57
lib/helpers/screenshot.js on lines 56..58
lib/helpers/stitching.js on lines 55..57
lib/mouse.js on lines 85..87
lib/navigator.js on lines 51..53
lib/utils.js on lines 53..55

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status