preceptorjs/taxi

View on GitHub
lib/chain.js

Summary

Maintainability
F
1 mo
Test Coverage

File chain.js has 720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var logMethods = require('./log');
var type = require('./type');
var when = require('./when');
Severity: Major
Found in lib/chain.js - About 1 day to fix

Function compareArea has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

Chain.prototype.compareArea = function (title, x, y, width, height, options, callBack) {
Severity: Major
Found in lib/chain.js - About 50 mins to fix

Function captureArea has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

Chain.prototype.captureArea = function (x, y, width, height, options, callBack) {
Severity: Minor
Found in lib/chain.js - About 45 mins to fix

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

Chain.prototype.elementClickAt = function (selector, xOffset, yOffset, button, callBack) {
Severity: Minor
Found in lib/chain.js - About 35 mins to fix

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

Chain.prototype.elementDblClickAt = function (selector, xOffset, yOffset, button, callBack) {
Severity: Minor
Found in lib/chain.js - About 35 mins to fix

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

Chain.prototype.waitForElementNotDisplayed = function (selector, timeOut, abortOnFailure, callBack) {
    var activeWindow = this._driver.browser().activeWindow(),
        msg = "Element " + selector + " was displayed in the page for " + timeOut + " ms";

    return when(this._driver.utils().waitUntil(function () {
Severity: Major
Found in lib/chain.js and 1 other location - About 1 day to fix
lib/chain.js on lines 3066..3083

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

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

Chain.prototype.waitForElementDisplay = function (selector, timeOut, abortOnFailure, callBack) {
    var activeWindow = this._driver.browser().activeWindow(),
        msg = "Element " + selector + " was not displayed in the page for " + timeOut + " ms";

    return when(this._driver.utils().waitUntil(function () {
Severity: Major
Found in lib/chain.js and 1 other location - About 1 day to fix
lib/chain.js on lines 2982..2999

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

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

Chain.prototype.elementClickAt = function (selector, xOffset, yOffset, button, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.mouse().clickAt(xOffset, yOffset), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 4 hrs to fix
lib/chain.js on lines 1460..1468

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

Chain.prototype.navigateTo = function (url, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.navigator().navigateTo(url), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 4 hrs to fix
lib/chain.js on lines 2747..2755

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

Chain.prototype.activateFrame = function (id, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.frame().activate(id), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 4 hrs to fix
lib/chain.js on lines 2437..2445

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

Chain.prototype.elementDblClickAt = function (selector, xOffset, yOffset, button, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.mouse().doubleClickAt(xOffset, yOffset), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 4 hrs to fix
lib/chain.js on lines 1372..1380

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

Chain.prototype.dialogDismiss = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.alert().dismiss(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2562..2570
lib/chain.js on lines 2777..2785

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.activateParentFrame = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.frame().activateParent(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2562..2570
lib/chain.js on lines 2710..2718

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.refresh = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.navigator().refresh(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2710..2718
lib/chain.js on lines 2777..2785

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.elementHover = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.mouse().moveToCenter(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 1638..1646
lib/chain.js on lines 1672..1680

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.elementDblTap = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.touch().moveToCenter(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 1494..1502
lib/chain.js on lines 1638..1646

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.forward = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.navigator().forward(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2531..2539
lib/chain.js on lines 2674..2682

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.elementTap = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.touch().tap(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 1494..1502
lib/chain.js on lines 1672..1680

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

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

Chain.prototype.dblClick = function (x, y, button, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.mouse().doubleClickAt(x, y), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 2326..2334

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.dialogAccept = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.alert().accept(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2500..2508
lib/chain.js on lines 2531..2539

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.backward = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.navigator().backward(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2500..2508
lib/chain.js on lines 2674..2682

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

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

Chain.prototype.click = function (x, y, button, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.mouse().clickAt(x, y), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 2368..2376

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

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

Chain.prototype.compareViewPort = function (title, options, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.compareViewPort(title, options), function (isSimilar) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1953..1961

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

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

Chain.prototype.compareDocument = function (title, options, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.compareDocument(title, options), function (isSimilar) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 2001..2009

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

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

Chain.prototype.elementHoverAt = function (selector, xOffset, yOffset, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.mouse().moveTo(xOffset, yOffset), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1604..1612

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

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

Chain.prototype.elementTouchAt = function (selector, xOffset, yOffset, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.touch().moveTo(xOffset, yOffset), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1530..1538

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

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

Chain.prototype.captureViewPort = function (options, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.captureViewPort(options), function (imageBuffer) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1821..1829

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

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

Chain.prototype.elementAttribute = function (selector, attribute, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getAttribute(attribute), function (value) {
            if (callBack) {
                return this._scopeCallBack(callBack, [value, element, index]);
Severity: Major
Found in lib/chain.js and 4 other locations - About 3 hrs to fix
lib/chain.js on lines 349..357
lib/chain.js on lines 485..493
lib/chain.js on lines 597..605
lib/chain.js on lines 1182..1190

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

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

Chain.prototype.captureDocument = function (options, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.captureDocument(options), function (imageBuffer) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1861..1869

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.relocate = function (x, y, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.position(x, y), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2247..2255
lib/chain.js on lines 3143..3151

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.resize = function (width, height, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.resize(width, height), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 2247..2255
lib/chain.js on lines 3210..3218

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

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

Chain.prototype.elementHasText = function (selector, text, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.hasText(text), function (hasText) {
            if (callBack) {
                return this._scopeCallBack(callBack, [hasText, element, index]);
Severity: Major
Found in lib/chain.js and 4 other locations - About 3 hrs to fix
lib/chain.js on lines 302..310
lib/chain.js on lines 349..357
lib/chain.js on lines 597..605
lib/chain.js on lines 1182..1190

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

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

Chain.prototype.elementCapture = function (selector, options, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.capture(options), function (imageBuffer) {
            if (callBack) {
                return this._scopeCallBack(callBack, [imageBuffer, element, index]);
Severity: Major
Found in lib/chain.js and 4 other locations - About 3 hrs to fix
lib/chain.js on lines 302..310
lib/chain.js on lines 349..357
lib/chain.js on lines 485..493
lib/chain.js on lines 597..605

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

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

Chain.prototype.dialogText = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.alert().getText(), function (text) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 2469..2477

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

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

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

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

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

Refactorings

Further Reading

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

Chain.prototype.scrollTo = function (x, y, callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.scrollTo(x, y), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 2 other locations - About 3 hrs to fix
lib/chain.js on lines 3143..3151
lib/chain.js on lines 3210..3218

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

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

Chain.prototype.elementHasClass = function (selector, className, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.hasClass(className), function (hasClass) {
            if (callBack) {
                return this._scopeCallBack(callBack, [hasClass, element, index]);
Severity: Major
Found in lib/chain.js and 4 other locations - About 3 hrs to fix
lib/chain.js on lines 302..310
lib/chain.js on lines 485..493
lib/chain.js on lines 597..605
lib/chain.js on lines 1182..1190

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

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

Chain.prototype.elementCssValue = function (selector, property, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getCssValue(property), function (value) {
            if (callBack) {
                return this._scopeCallBack(callBack, [value, element, index]);
Severity: Major
Found in lib/chain.js and 4 other locations - About 3 hrs to fix
lib/chain.js on lines 302..310
lib/chain.js on lines 349..357
lib/chain.js on lines 485..493
lib/chain.js on lines 1182..1190

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

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

Chain.prototype.url = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.navigator().getUrl(), function (url) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 2601..2609

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

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

Chain.prototype.elementClick = function (selector, button, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.mouse().click(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1415..1423

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

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

Chain.prototype.elementDblClick = function (selector, button, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.mouse().doubleClick(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 1327..1335

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

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

Chain.prototype.title = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.getTitle(), function (title) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 5 other locations - About 3 hrs to fix
lib/chain.js on lines 2085..2093
lib/chain.js on lines 2180..2188
lib/chain.js on lines 2214..2222
lib/chain.js on lines 3110..3118
lib/chain.js on lines 3177..3185

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

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

Chain.prototype.size = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.getSize(), function (size) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 5 other locations - About 3 hrs to fix
lib/chain.js on lines 2085..2093
lib/chain.js on lines 2148..2156
lib/chain.js on lines 2180..2188
lib/chain.js on lines 2214..2222
lib/chain.js on lines 3177..3185

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

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

Chain.prototype.elementLocation = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getPosition(), function (location) {
            if (callBack) {
                return this._scopeCallBack(callBack, [location, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.scrollLocation = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.getScrollPosition(), function (coordinates) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 5 other locations - About 3 hrs to fix
lib/chain.js on lines 2085..2093
lib/chain.js on lines 2148..2156
lib/chain.js on lines 2180..2188
lib/chain.js on lines 3110..3118
lib/chain.js on lines 3177..3185

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

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

Chain.prototype.elementValue = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getValue(), function (value) {
            if (callBack) {
                return this._scopeCallBack(callBack, [value, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementTagName = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getTagName(), function (tagName) {
            if (callBack) {
                return this._scopeCallBack(callBack, [tagName, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementIsSelected = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.isSelected(), function (isSelected) {
            if (callBack) {
                return this._scopeCallBack(callBack, [isSelected, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementRelativeCenter = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getRelativeCenter(), function (coordinates) {
            if (callBack) {
                return this._scopeCallBack(callBack, [coordinates, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010

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

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

Chain.prototype.elementFrame = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getFrame(), function (frame) {
            if (callBack) {
                return this._scopeCallBack(callBack, [frame, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementLocationInView = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getLocationInView(), function (location) {
            if (callBack) {
                return this._scopeCallBack(callBack, [location, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementAbsoluteCenter = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getAbsoluteCenter(), function (coordinates) {
            if (callBack) {
                return this._scopeCallBack(callBack, [coordinates, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementIsEnabled = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.isEnabled(), function (isEnabled) {
            if (callBack) {
                return this._scopeCallBack(callBack, [isEnabled, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementIsDisplayed = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.isDisplayed(), function (isDisplayed) {
            if (callBack) {
                return this._scopeCallBack(callBack, [isDisplayed, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementClasses = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getClasses(), function (classes) {
            if (callBack) {
                return this._scopeCallBack(callBack, [classes, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.elementText = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getText(), function (text) {
            if (callBack) {
                return this._scopeCallBack(callBack, [text, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 852..860
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.activeElement = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.getActiveElement(), function (element) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 5 other locations - About 3 hrs to fix
lib/chain.js on lines 2148..2156
lib/chain.js on lines 2180..2188
lib/chain.js on lines 2214..2222
lib/chain.js on lines 3110..3118
lib/chain.js on lines 3177..3185

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

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

Chain.prototype.source = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.getSource(), function (source) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 5 other locations - About 3 hrs to fix
lib/chain.js on lines 2085..2093
lib/chain.js on lines 2148..2156
lib/chain.js on lines 2214..2222
lib/chain.js on lines 3110..3118
lib/chain.js on lines 3177..3185

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

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

Chain.prototype.elementSize = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.getSize(), function (size) {
            if (callBack) {
                return this._scopeCallBack(callBack, [size, element, index]);
Severity: Major
Found in lib/chain.js and 12 other locations - About 3 hrs to fix
lib/chain.js on lines 392..400
lib/chain.js on lines 435..443
lib/chain.js on lines 523..531
lib/chain.js on lines 558..566
lib/chain.js on lines 632..640
lib/chain.js on lines 670..678
lib/chain.js on lines 705..713
lib/chain.js on lines 889..897
lib/chain.js on lines 926..934
lib/chain.js on lines 965..973
lib/chain.js on lines 1002..1010
lib/chain.js on lines 1039..1047

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

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

Chain.prototype.location = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.getPosition(), function (location) {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 5 other locations - About 3 hrs to fix
lib/chain.js on lines 2085..2093
lib/chain.js on lines 2148..2156
lib/chain.js on lines 2180..2188
lib/chain.js on lines 2214..2222
lib/chain.js on lines 3110..3118

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

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

Chain.prototype.elementClear = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.clear(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 815..823

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

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

Chain.prototype.elementSubmit = function (selector, callBack) {
    return this._elementAction(selector, function (element, index) {
        return when(element.submit(), function () {
            if (callBack) {
                return this._scopeCallBack(callBack, [element, index]);
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 777..785

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

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

Chain.prototype.closeWindow = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.close(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 3241..3249

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

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

Chain.prototype.maximize = function (callBack) {
    var activeWindow = this._driver.browser().activeWindow();

    return this._driverAction(activeWindow.maximize(), function () {
        if (callBack) {
Severity: Major
Found in lib/chain.js and 1 other location - About 3 hrs to fix
lib/chain.js on lines 2116..2124

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

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

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

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

Chain.prototype._logMethodCall = function (event) {
    event.target = 'Chain';
    this._driver._logMethodCall(event);
};
Severity: Major
Found in lib/chain.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/comparison/blinkdiff.js on lines 43..46
lib/compatibility.js on lines 35..38
lib/compatibility/nightwatch.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 14 locations. Consider refactoring.
Open

Chain.prototype._requestJSON = function (method, path, body) {
    return this._driver._requestJSON(method, path, body);
};
Severity: Major
Found in lib/chain.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/comparison/blinkdiff.js on lines 60..62
lib/compatibility.js on lines 52..54
lib/compatibility/nightwatch.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

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

    return when(this._driver.utils().waitUntil(function () {
        return when(activeWindow.getElements(selector), function (elements) {
            return (elements.length != 0);
        });
    }.bind(this), timeOut, 500, msg, function () {
Severity: Minor
Found in lib/chain.js and 1 other location - About 35 mins to fix
lib/chain.js on lines 2945..2949

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

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

    return when(this._driver.utils().waitUntil(function () {
        return when(activeWindow.getElements(selector), function (elements) {
            return (elements.length == 0);
        });
    }.bind(this), timeOut || 10000, 500, msg, function () {
Severity: Minor
Found in lib/chain.js and 1 other location - About 35 mins to fix
lib/chain.js on lines 3029..3033

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

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

    return when(browser.activateWindow(id), function () {
        if (callBack) {
            return this._scopeCallBack(callBack, [browser]);
        }
    }.bind(this));
Severity: Minor
Found in lib/chain.js and 1 other location - About 30 mins to fix
lib/chain.js on lines 1784..1788

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

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(activeWindow.sendKeys(keys), function () {
        if (callBack) {
            return this._scopeCallBack(callBack, [activeWindow]);
        }
    }.bind(this));
Severity: Minor
Found in lib/chain.js and 1 other location - About 30 mins to fix
lib/chain.js on lines 2820..2824

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

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