Showing 7 of 7 total issues
Function createPatch
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createPatch(items, scope, parentScope, binding) {
const {
condition,
template,
childrenMap,
Function attributeExpression
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function attributeExpression(
node,
{ name, isBoolean },
value,
oldValue,
- Read upRead up
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 deeply nested control flow statements. Open
if (!map) {
map = new Map()
let i = bStart
while (i < bEnd) map.set(b[i], i++)
}
Function mount
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
mount(el, scope, parentScope, meta = {}) {
if (!el) panic('Please provide DOM node to mount properly your template')
if (this.el) this.unmount(scope)
- Read upRead up
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 deeply nested control flow statements. Open
if (!map || !map.has(a[aStart])) removeChild(get(a[aStart], -1))
Avoid deeply nested control flow statements. Open
if (map.has(a[aStart])) {
// grab the index of such node, 'cause it might have been processed
const index = map.get(a[aStart])
// if it's not already processed, look on demand for the next LCS
if (bStart < index && index < bEnd) {
Function create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function create(root, binding, templateTagOffset) {
const { selector, type, redundantAttribute, expressions } = binding
// find the node to apply the bindings
const node = selector ? root.querySelector(selector) : root
- Read upRead up
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"