alecxe/eslint-plugin-protractor

View on GitHub

Showing 74 of 74 total issues

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

module.exports = function (cssSelector) {
try {
var result = parser.parse(cssSelector)
} catch (err) {
// ignore parsing errors - we don't want it to fail miserably on a target machine during a ESLint run
Severity: Major
Found in lib/extract-class-names.js and 1 other location - About 1 day to fix
lib/extract-attributes.js on lines 20..51

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

module.exports = function (cssSelector) {
try {
var result = parser.parse(cssSelector)
} catch (err) {
// ignore parsing errors - we don't want it to fail miserably on a target machine during a ESLint run
Severity: Major
Found in lib/extract-attributes.js and 1 other location - About 1 day to fix
lib/extract-class-names.js on lines 28..58

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

return {
'CallExpression': function (node) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isCSSLocator(node)) {
var extractedClassNames = extractClassNames(node.arguments[0].value)
Severity: Major
Found in lib/rules/no-bootstrap-classes.js and 1 other location - About 7 hrs to fix
lib/rules/no-angular-classes.js on lines 28..45

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

return {
'CallExpression': function (node) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isCSSLocator(node)) {
var extractedClassNames = extractClassNames(node.arguments[0].value)
Severity: Major
Found in lib/rules/no-angular-classes.js and 1 other location - About 7 hrs to fix
lib/rules/no-bootstrap-classes.js on lines 17..34

Function create has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
return {
MemberExpression: function (node) {
if (node.property && node.object && node.property.name === 'length') {
// remember the variable name the ".length" was used on
Severity: Minor
Found in lib/rules/use-count-method.js - About 5 hrs to fix

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

module.exports = {
meta: {
schema: []
},
 
 
Severity: Major
Found in lib/rules/no-browser-sleep.js and 3 other locations - About 5 hrs to fix
lib/rules/no-browser-pause.js on lines 8..28
lib/rules/no-by-xpath.js on lines 8..28
lib/rules/no-get-location-abs-url.js on lines 8..28

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

module.exports = {
meta: {
schema: []
},
 
 
Severity: Major
Found in lib/rules/no-get-location-abs-url.js and 3 other locations - About 5 hrs to fix
lib/rules/no-browser-pause.js on lines 8..28
lib/rules/no-browser-sleep.js on lines 8..28
lib/rules/no-by-xpath.js on lines 8..28

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

module.exports = {
meta: {
schema: []
},
 
 
Severity: Major
Found in lib/rules/no-by-xpath.js and 3 other locations - About 5 hrs to fix
lib/rules/no-browser-pause.js on lines 8..28
lib/rules/no-browser-sleep.js on lines 8..28
lib/rules/no-get-location-abs-url.js on lines 8..28

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

module.exports = {
meta: {
schema: []
},
 
 
Severity: Major
Found in lib/rules/no-browser-pause.js and 3 other locations - About 5 hrs to fix
lib/rules/no-browser-sleep.js on lines 8..28
lib/rules/no-by-xpath.js on lines 8..28
lib/rules/no-get-location-abs-url.js on lines 8..28

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

if (isElementArrayFinder(node)) {
// handle element.all
if (isElementAll(node) && isArgumentLiteral(node)) {
context.report({
node: node.arguments[0],
Severity: Major
Found in lib/rules/valid-locator-type.js and 1 other location - About 3 hrs to fix
lib/rules/valid-locator-type.js on lines 89..105

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

if (isElementFinder(node)) {
// handle element
if (isElement(node) && isArgumentLiteral(node)) {
context.report({
node: node.arguments[0],
Severity: Major
Found in lib/rules/valid-locator-type.js and 1 other location - About 3 hrs to fix
lib/rules/valid-locator-type.js on lines 108..124

Function create has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
return {
'CallExpression': function (node) {
if (node.arguments && node.arguments[0] && node.arguments[0].hasOwnProperty('value')) {
var object = node.callee.object
Severity: Minor
Found in lib/rules/use-simple-repeaters.js - About 2 hrs to fix

Function isElementArrayFinder has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function isElementArrayFinder (node) {
var callee = node.callee
 
if (callee) {
// handling $$ shortcut
Severity: Minor
Found in lib/is-element-array-finder.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
return {
'CallExpression': function (node) {
var object = node.callee.object
var property = node.callee.property
Severity: Minor
Found in lib/rules/empty-script.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
function getFirstArgumentValue (methodArguments) {
var firstArgument = methodArguments[0]
 
if (firstArgument) {
Severity: Minor
Found in lib/rules/use-first-last.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
return {
'MemberExpression': function (node) {
var object = node.object
var property = node.property
Severity: Minor
Found in lib/rules/missing-perform.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
// locators collects locators grouped by type, e.g.: {css: [".test", "div:first-of-type"], id: ["myid1", "myid2"]}
var locators = {}
 
function arrayEquals (a, b) {
Severity: Minor
Found in lib/rules/no-repetitive-locators.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 18 (exceeds 5 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) {
Severity: Minor
Found in lib/rules/use-promise-all.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
// --------------------------------------------------------------------------
// Helpers
// --------------------------------------------------------------------------
 
 
Severity: Minor
Found in lib/rules/no-promise-in-if.js - About 2 hrs to fix

Function create has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

create: function (context) {
return {
CallExpression: function (node) {
// element finders
if (isElementFinder(node)) {
Severity: Minor
Found in lib/rules/valid-locator-type.js - About 2 hrs to fix
Severity
Category
Status
Source
Language