alecxe/eslint-plugin-protractor

View on GitHub

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'
Severity: Minor
Found in lib/get-locator.js - About 1 hr 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 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

Severity: Minor
Found in lib/rules/use-count-method.js - About 1 hr to fix

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
Severity: Minor
Found in lib/rules/correct-chaining.js - About 1 hr to fix

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)) {
Severity: Minor
Found in lib/rules/valid-locator-type.js - About 1 hr to fix

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()'],
Severity: Minor
Found in lib/rules/use-angular-locators.js - About 1 hr 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 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) {
Severity: Minor
Found in lib/rules/array-callback-return.js - About 1 hr 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 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

Severity: Minor
Found in lib/rules/no-describe-selectors.js - About 1 hr 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 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) {
Severity: Minor
Found in lib/rules/limit-selector-depth.js - About 1 hr 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 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) {
Severity: Minor
Found in lib/rules/use-promise-all.js - About 1 hr to fix

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 {
Severity: Minor
Found in lib/rules/no-repetitive-selectors.js - About 1 hr to fix

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
Severity: Minor
Found in lib/rules/empty-script.js - About 1 hr to fix

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',
Severity: Minor
Found in lib/rules/no-angular-classes.js - About 1 hr to fix

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)) {
Severity: Minor
Found in lib/rules/valid-locator-type.js - About 1 hr to fix

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)) {
Severity: Minor
Found in lib/rules/no-invalid-selectors.js - About 1 hr 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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  create: function (context) {
    var funcInfo = {
      upper: null,
      codePath: null,
      hasReturn: false,
Severity: Minor
Found in lib/rules/array-callback-return.js - About 1 hr 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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  create: function (context) {
    function isBareExpression (node) {
      return node.parent.type === 'ExpressionStatement'
    }

Severity: Minor
Found in lib/rules/bare-element-finders.js - About 1 hr 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 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')) {
Severity: Minor
Found in lib/rules/no-compound-classes.js - About 1 hr 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 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)
Severity: Minor
Found in lib/rules/no-absolute-url.js - About 1 hr 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 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 = []
Severity: Minor
Found in lib/rules/no-repetitive-selectors.js - About 1 hr to fix

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
  }
Severity: Minor
Found in lib/is-element-finder.js - About 55 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