src/directives/for.js
File for.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { avalon, createFragment, platform, isObject, ap } from '../seed/core'
import { VFragment } from '../vdom/VFragment'
import { $$skipArray } from '../vmodel/reserved'
Function diffList
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function diffList(instance) {
var cache = instance.cache
var newCache = {}
var fuzzy = []
var list = instance.preFragments
Function createFragments
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createFragments(instance, obj) {
if (isObject(obj)) {
var array = Array.isArray(obj)
var ids = []
var fragments = [],
Function updateList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateList(instance) {
var before = instance.begin.dom
var parent = before.parentNode
var list = instance.fragments
var end = instance.end.dom
Function FragmentDecorator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FragmentDecorator(fragment, instance, index) {
var data = {}
data[instance.keyName] = instance.isArray ? index : fragment.key
data[instance.valName] = fragment.val
if (instance.asName) {
Function updateList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
function updateList(instance) {
var before = instance.begin.dom
var parent = before.parentNode
var list = instance.fragments
var end = instance.end.dom
- 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
Function isInCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function isInCache(cache, id) {
var c = cache[id]
if (c) {
var arr = c.arr
/* istanbul ignore if*/
- 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
Parsing error: 'import' and 'export' may appear only with 'sourceType: module' Open
Open
import { avalon, createFragment, platform, isObject, ap } from '../seed/core'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/