Showing 214 of 347 total issues
Function slice
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
ap.slice = function(begin, end) {
// IE < 9 gets unhappy with an undefined end argument
end = (typeof end !== 'undefined') ? end : this.length
// For native Array objects, we use the native slice function
- 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 set
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
set(target, name, value) {
if (name === '$model' || name === '$track') {
return true
}
if (name in $$skipArray) {
- 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 exports
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
var options = {
// base path that will be used to resolve all patterns (eg. files, exclude)
Function Computed
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export var Computed = (function(_super) {
__extends(Computed, _super);
function Computed(name, options, vm) { //构造函数
_super.call(this, name, undefined, vm)
- 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 scanTag
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
scanTag(vdom, scope, parentChildren, isRoot) {
var dirs = {},
attrs = vdom.props,
hasDir, hasFor
for (var attr in attrs) {
Function bind
has a Cognitive Complexity of 23 (exceeds 5 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
- 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 dispatch
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function dispatch(event) {
event = new avEvent(event)
var type = event.type
var elem = event.target
var handlers = []
- 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
File index.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { avalon, isObject, platform } from '../seed/core'
import { cssDiff } from '../directives/css'
import { dumpTree, groupTree, getRange } from '../renders/share'
var legalTags = { wbr: 1, xmp: 1, template: 1 }
var events = 'onInit,onReady,onViewChange,onDispose,onEnter,onLeave'
File for.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { avalon, createFragment, platform, isObject, ap } from '../seed/core'
import { VFragment } from '../vdom/VFragment'
import { $$skipArray } from '../vmodel/reserved'
File domRender.js
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { avalon, config, inBrowser, delayCompileNodes, directives } from '../seed/core'
import { fromDOM } from '../vtree/fromDOM'
import { fromString } from '../vtree/fromString'
import { VFragment } from '../vdom/VFragment'
Function dateFilter
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function dateFilter(date, format) {
var locate = dateFilter.locate,
text = "",
parts = [],
fn, match
Function createAction
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createAction(action) {
var lower = action.toLowerCase()
return function (option) {
var dom = this.dom
var elem = avalon(dom)
Function each
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
avalon.each = function(obj, fn) {
if (obj) { //排除null, undefined
var i = 0
if (isArrayLike(obj)) {
for (var n = obj.length; i < n; i++) {
- 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 parseTextDir
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function parseTextDir(string) {
var closeTag = config.closeTag
var openTag = config.openTag
var closeTagFirst = closeTag.charAt(0)
var closeTagLength = closeTag.length
- 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 from
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function from(node) {
var type = node.nodeName.toLowerCase()
switch (type) {
case '#text':
case '#comment':
- 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 duplexInit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function duplexInit() {
var expr = this.expr
var node = this.node
var etype = node.props.type
this.parseValue = parseValue
- 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 Computed
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export var Computed = (function(_super) {
__extends(Computed, _super);
function Computed(name, options, vm) { //构造函数
_super.call(this, name, undefined, vm)
Function updateDataEvents
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateDataEvents(dom, data) {
var events = {}
//添加需要监听的事件
switch (data.dtype) {
case 'radio':
Function getAttrs
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAttrs(string) {
var state = 'AttrName',
attrName = '',
attrValue = '',
quote,
Function fixElement
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function fixElement(dest, src) {
if (dest.nodeType !== 1) {
return
}
var nodeName = dest.nodeName.toLowerCase()
- 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"