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) {
- Create a ticketCreate a ticket
Function _gatherSections
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Screenshot.prototype._gatherSections = function (area, padding, initData, maxImageResolution, needsStitching) {
- Create a ticketCreate a ticket
Function elementDblClickAt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Chain.prototype.elementDblClickAt = function (selector, xOffset, yOffset, button, callBack) {
- Create a ticketCreate a ticket
Function waitForElementNotPresent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Nightwatch.prototype.waitForElementNotPresent = function (selector, time, abortOnFailure, cb, message) {
- Create a ticketCreate a ticket
Function waitForElementNotVisible
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Nightwatch.prototype.waitForElementNotVisible = function (selector, time, abortOnFailure, cb, message) {
- Create a ticketCreate a ticket
Function waitForElementPresent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Nightwatch.prototype.waitForElementPresent = function (selector, time, abortOnFailure, cb, message) {
- Create a ticketCreate a ticket
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.');
- Read upRead up
- Create a ticketCreate a ticket
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]);
- Read upRead up
- Create a ticketCreate a ticket
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';
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return t[0].toUpperCase() + t.substring(1);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (val !== val) return 'NaN';
- Create a ticketCreate a ticket
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) {
- Read upRead up
- Create a ticketCreate a ticket
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;
- Read upRead up
- Create a ticketCreate a ticket
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"