preceptorjs/taxi

View on GitHub

Showing 286 of 286 total issues

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

BlinkDiffComparison.prototype._getApprovedImagePath = function (title, id) {
    var baseName = this._getBaseName(title, id || 1),
        folderName = this._getFolderName(),
        suffix = this._needsApprovedSuffix() ? '_approved' : '';

Severity: Major
Found in lib/comparison/blinkdiff.js and 2 other locations - About 3 hrs to fix
lib/comparison/blinkdiff.js on lines 243..249
lib/comparison/blinkdiff.js on lines 260..266

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

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

BlinkDiffComparison.prototype._getBuildImagePath = function (title, id) {
    var baseName = this._getBaseName(title, id || 1),
        folderName = this._getFolderName(),
        suffix = this._needsBuildSuffix() ? '_build' : '';

Severity: Major
Found in lib/comparison/blinkdiff.js and 2 other locations - About 3 hrs to fix
lib/comparison/blinkdiff.js on lines 226..232
lib/comparison/blinkdiff.js on lines 260..266

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

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

BlinkDiffComparison.prototype._getDiffImagePath = function (title, id) {
    var baseName = this._getBaseName(title, id || 1),
        folderName = this._getFolderName(),
        suffix = this._needsDiffSuffix() ? '_diff' : '';

Severity: Major
Found in lib/comparison/blinkdiff.js and 2 other locations - About 3 hrs to fix
lib/comparison/blinkdiff.js on lines 226..232
lib/comparison/blinkdiff.js on lines 243..249

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

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

Touch.prototype.upAtCenter = function () {
  return when(this._parent.getAbsoluteCenter(), function (center) {
    return this._driver.browser().activeWindow().touch().down(center.x, center.y);
  }.bind(this));
};
Severity: Major
Found in lib/touch.js and 1 other location - About 3 hrs to fix
lib/touch.js on lines 121..125

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

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

Touch.prototype.downAtCenter = function () {
  return when(this._parent.getAbsoluteCenter(), function (center) {
    return this._driver.browser().activeWindow().touch().down(center.x, center.y);
  }.bind(this));
};
Severity: Major
Found in lib/touch.js and 1 other location - About 3 hrs to fix
lib/touch.js on lines 148..152

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

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

File driver.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var EventEmitter = require('events').EventEmitter;
var util = require('util');
var url = require('url');
Severity: Minor
Found in lib/driver.js - About 3 hrs to fix

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

ActiveWindow.prototype.compareViewPort = function (title, options) {
    options = options || {};

    return when(this.captureViewPort(options), function (buffer) {
        return this.getDriver()._comparison.compare(title, buffer, options.compare);
Severity: Major
Found in lib/activeWindow.js and 1 other location - About 3 hrs to fix
lib/activeWindow.js on lines 301..307

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

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

ActiveWindow.prototype.compareDocument = function (title, options) {
    options = options || {};

    return when(this.captureDocument(options), function (buffer) {
        return this.getDriver()._comparison.compare(title, buffer, options.compare);
Severity: Major
Found in lib/activeWindow.js and 1 other location - About 3 hrs to fix
lib/activeWindow.js on lines 325..331

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language