Showing 214 of 347 total issues
Function update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function (vdom, value) {
var dom = vdom.dom
if (dom && dom.nodeType == 1) {
var dirType = this.type
Function set
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
set(target, name, value) {
if (name === '$model' || name === '$track') {
return true
}
if (name in $$skipArray) {
Function insertTbody
has 30 lines of code (exceeds 25 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)) {
Function makeTbody
has 30 lines of code (exceeds 25 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)) {
Function rotate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
rotate: function(event, status) {
var finger = rotateRecognizer.finger
var endAngel = rotateRecognizer.getAngle180(rotateRecognizer.center, finger.lastTouch)
var diff = rotateRecognizer.startAngel - endAngel
var direction = (diff > 0 ? 'right' : 'left')
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(vdom, value) {
//this.oldValue = value //★★防止递归
switch (this.readyState) {
case 0:
Function groupTree
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function groupTree(parent, children) {
children && children.forEach(function (vdom) {
if (!vdom)
return
var vlength = vdom.children && getChildren(vdom.children)
Function collectDeps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function collectDeps(action, getter) {
if (!action.observers)
return
var preAction = avalon.trackingAction
if (preAction) {
Function dispatch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dispatch(event) {
event = new avEvent(event)
var type = event.type
var elem = event.target
var handlers = []
Function Directive
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Directive(vm, binding, vdom, render) {
var type = binding.type
var decorator = avalon.directives[type]
if (inBrowser) {
var dom = avalon.vdom(vdom, 'toDOM')
Function fixElement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fixElement(dest, src) {
if (dest.nodeType !== 1) {
return
}
var nodeName = dest.nodeName.toLowerCase()
Function updateList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateList(instance) {
var before = instance.begin.dom
var parent = before.parentNode
var list = instance.fragments
var end = instance.end.dom
Function val
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
avalon.fn.val = function (value) {
var node = this[0]
if (node && node.nodeType === 1) {
var get = arguments.length === 0
var access = get ? ':get' : ':set'
- 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 val
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
avalon.fn.val = function (value) {
var node = this[0]
if (node && node.nodeType === 1) {
var get = arguments.length === 0
var access = get ? ':get' : ':set'
- 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 removeAll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
removeAll: function(all) { //移除N个元素
var size = this.length
var eliminate = Array.isArray(all) ?
function(el) {
return all.indexOf(el) !== -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 rotate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
rotate: function(event, status) {
var finger = rotateRecognizer.finger
var endAngel = rotateRecognizer.getAngle180(rotateRecognizer.center, finger.lastTouch)
var diff = rotateRecognizer.startAngel - endAngel
var direction = (diff > 0 ? 'right' : 'left')
- 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 collectTemplate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function collectTemplate(vdoms, obj) {
for (var i = 0, el; el = vdoms[i++]; ) {
var props = el.props
if (props) {
var id = props['ms-controller'] ||
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
update: function (vdom, change, opts) {
var dom = vdom.dom
if (dom && dom.nodeType === 1) {
//要求配置对象必须指定is属性,action必须是布尔或enter,leave,move
var option = change || opts
- 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 isPlainObjectCompact
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function isPlainObjectCompact(obj, key) {
if (!obj || avalon.type(obj) !== 'object' || obj.nodeType || avalon.isWindow(obj)) {
return false
}
try { //IE内置对象没有constructor
- 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 bootstrap
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function bootstrap() {
function doScrollCheck() {
try { //IE下通过doScrollCheck检测DOM树是否建完
root.doScroll('left')
fireReady()
- 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"