preceptorjs/taxi

View on GitHub

Showing 53 of 286 total issues

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

Screenshot.prototype.areaScreenshot = function (x, y, width, height, options) {
Severity: Minor
Found in lib/helpers/screenshot.js - About 35 mins to fix

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

Screenshot.prototype._gatherSections = function (area, padding, initData, maxImageResolution, needsStitching) {
Severity: Minor
Found in lib/helpers/screenshot.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

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

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

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

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

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

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

Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Cookie.prototype.validate = function (completed) {

  if (completed) {
    if (!this._values.name) {
      throw new Error('A cookie "name" is required.');
Severity: Minor
Found in lib/cookie.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function logMethods has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function logMethods (obj) {
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      if (key[0] !== '_' && !(key in EventEmitter.prototype) && typeof obj[key] === 'function' && !obj.logging) {
        obj[key] = logMethod(key, obj[key]);
Severity: Minor
Found in lib/log.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Avoid too many return statements within this function.
Open

  if (val === undefined) return 'undefined';
Severity: Major
Found in lib/type.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  return t[0].toUpperCase() + t.substring(1);
Severity: Major
Found in lib/type.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  if (val !== val) return 'NaN';
Severity: Major
Found in lib/type.js - About 30 mins to fix

Function sauceJobUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

Driver.prototype.sauceJobUpdate = function (body) {
  var remote = this._connection._remote;
  var request = this._connection._request_internal.bind(this);

  function makeRequest (session) {
Severity: Minor
Found in lib/driver.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function waitUntil has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

Utils.prototype.waitUntil = function (fn, timeOut, wait, message, timeOutFn) {

    var internalWaitUntil = function (timeOut) {

        timeOut -= wait;
Severity: Minor
Found in lib/utils.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

Severity
Category
Status
Source
Language