Showing 347 of 347 total issues
Function addScope
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addScope(expr, type) {
var cacheKey = expr + ':' + type
var cache = exprCache.get(cacheKey)
if (cache) {
return cache.slice(0)
Function updateDataEvents
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateDataEvents(dom, data) {
var events = {}
//添加需要监听的事件
switch (data.dtype) {
case 'radio':
Function diffList
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function diffList(instance) {
var cache = instance.cache
var newCache = {}
var fuzzy = []
var list = instance.preFragments
Function resetDeps
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resetDeps(action) {
var prev = action.observers,
curr = [],
checked = {},
ids = []
Function duplexInit
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function duplexInit() {
var expr = this.expr
var node = this.node
var etype = node.props.type
this.parseValue = parseValue
Function toDOM
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
toDOM() {
if (this.dom)
return this.dom
var dom, tagName = this.nodeName
if (avalon.modern && svgTags[tagName]) {
Function mix
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
avalon.mix = avalon.fn.mix = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
Function move
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
move: function(event, callback) {
for (var i = 0; i < event.changedTouches.length; i++) {
var touch = event.changedTouches[i]
var pointer = Recognizer.pointers[touch.identifier]
if (!pointer) {
- 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 insertTbody
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function insertTbody(nodes) {
var tbody = false
for (var i = 0, n = nodes.length; i < n; i++) {
var node = nodes[i]
if (rtbody.test(node.nodeName)) {
- 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 modelFactory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
platform.modelFactory = function modelFactory(definition, dd) {
var $computed = definition.$computed || {}
delete definition.$computed
var core = new IProxy(definition, dd)
var $accessors = core.$accessors
- 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 makeTbody
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function makeTbody(nodes) {
var tbody = false
for (var i = 0, n = nodes.length; i < n; i++) {
var node = nodes[i]
if (rtbody.test(node.nodeName)) {
- 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 bind
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
avalon.bind = function(elem, type, fn) {
if (elem.nodeType === 1) {
var value = elem.getAttribute('avalon-events') || ''
//如果是使用ms-on-*绑定的回调,其uuid格式为e12122324,
//如果是使用bind方法绑定的回调,其uuid格式为_12
Function updateAttrs
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateAttrs(node, attrs) {
for (var attrName in attrs) {
try {
var val = attrs[attrName]
// 处理路径属性
Function touchend
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
touchend: function(event) {
var targetElement = tapRecognizer.element
var now = Date.now()
//如果是touchstart与touchend相隔太久,可以认为是长按,那么就直接返回
//或者是在touchstart, touchmove阶段,判定其不该触发点击事件,也直接返回
Function shimHack
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function shimHack() {
if (msie < 10) {
avalon.cloneNode = fixClone
}
if (!document.contains) {
Function modelFactory
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
platform.modelFactory = function modelFactory(definition, dd) {
var clone = {}
for (let i in definition) {
clone[i] = definition[i]
delete definition[i]
Function from
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function from(node) {
var type = node.nodeName.toLowerCase()
switch (type) {
case '#text':
case '#comment':
Function touchend
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
touchend: function(event) {
var targetElement = tapRecognizer.element
var now = Date.now()
//如果是touchstart与touchend相隔太久,可以认为是长按,那么就直接返回
//或者是在touchstart, touchmove阶段,判定其不该触发点击事件,也直接返回
- 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 yieldDirectives
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
yieldDirectives() {
var tuple
while (tuple = this.bindings.shift()) {
var vdom = tuple[0],
scope = tuple[1],
- 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 update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
update: function (vdom, value) {
var dom = vdom.dom
if (dom && dom.nodeType == 1) {
var dirType = this.type
- 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"