Showing 57 of 74 total issues
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (node) {
var object = node.callee.object
var property = node.callee.property
var insideBy = object && property && object.name === 'by'
- 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 MemberExpression
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
MemberExpression: function (node) {
if (node.property && node.object && node.property.name === 'length') {
// remember the variable name the ".length" was used on
var variableName = node.object.name
- Create a ticketCreate a ticket
Function create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (context) {
function isElementAllChained (node) {
var property = node.property
if (property && property.name === 'element') {
var parent = node.parent
- Create a ticketCreate a ticket
Function create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (context) {
return {
CallExpression: function (node) {
// element finders
if (isElementFinder(node)) {
- Create a ticketCreate a ticket
Function create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
var attributeToLocatorMap = {
'ng-model': ['by.model()'],
'ng-bind': ['by.binding()', 'by.exactBinding()'],
'ng-repeat': ['by.repeater()', 'by.exactRepeater()'],
- 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 isCallbackOfArrayMethod
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function isCallbackOfArrayMethod (node) {
while (node) {
var parent = node.parent
switch (parent.type) {
- 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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
return {
'CallExpression': function (node) {
var object = node.callee.object
- 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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
var maxDepth = context.options.length ? context.options[0] : 5
return {
'CallExpression': function (node) {
- 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 create
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (context) {
function isThenCallBack (node) {
var property = node.callee.property
var isThen = property && property.name === 'then' && node.arguments
if (isThen) {
- Create a ticketCreate a ticket
Function create
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (context) {
// keeping the processed CSS selectors to check the next one against
var selectors = []
return {
- Create a ticketCreate a ticket
Function create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (context) {
return {
'CallExpression': function (node) {
var object = node.callee.object
var property = node.callee.property
- Create a ticketCreate a ticket
Function create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (context) {
var prohibitedClasses = [
'ng-scope',
'ng-isolate-scope',
'ng-binding',
- Create a ticketCreate a ticket
Function CallExpression
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
CallExpression: function (node) {
// element finders
if (isElementFinder(node)) {
// handle element
if (isElement(node) && isArgumentLiteral(node)) {
- Create a ticketCreate a ticket
Function create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
return {
'CallExpression': function (node) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isCSSLocator(node)) {
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
var funcInfo = {
upper: null,
codePath: null,
hasReturn: false,
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
function isBareExpression (node) {
return node.parent.type === 'ExpressionStatement'
}
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
return {
'CallExpression': function (node) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isLocator(node, 'className')) {
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
create: function (context) {
return {
'CallExpression': function (node) {
if (node.arguments && node.arguments[0]) {
var result = isBrowserGet(node)
- 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 CallExpression
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
'CallExpression': function (node) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isCSSLocator(node)) {
// we don't want to report the same repeated part multiple times
var alreadyReported = []
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (node) {
var callee = node.callee
if (!callee) {
return false
}
- 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"