alecxe/eslint-plugin-protractor

View on GitHub
lib/rules/no-get-inner-outer-html.js

Summary

Maintainability
A
2 hrs
Test Coverage
'use strict'
 
/**
* @fileoverview Warn about using `getInnerHtml()` and `getOuterHtml()` methods
* @author Alexander Afanasyev
*/
 
var isElementFinder = require('../is-element-finder')
 
module.exports = {
meta: {
schema: []
},
 
Function `create` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
create: function (context) {
return {
MemberExpression: function (node) {
var property = node.property
 
Similar blocks of code found in 2 locations. Consider refactoring.
if (property && (property.name === 'getInnerHtml' || property.name === 'getOuterHtml')) {
if (node.object && isElementFinder(node.object)) {
context.report({
node: property,
message: 'Unexpected "' + property.name + '()"'
})
}
}
}
}
}
}