Showing 214 of 347 total issues
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(config) {
// Use ENV vars on Travis and sauce.json locally to get credentials
if (process.env.SAUCE_USERNAME) {
console.log('使用全局的sauce key')
- 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 init
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function() {
var vdom = this.node
var underline = this.name.replace('ms-on-', 'e').replace('-', '_')
var uuid = underline + '_' + this.expr.
replace(/\s/g, '').
Function filterBy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function filterBy(array, search) {
var type = avalon.type(array)
if (type !== 'array' && type !== 'object')
throw 'filterBy只能处理对象或数组'
var args = avalon.slice(arguments, 2)
Function orderBy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function orderBy(array, by, decend) {
var type = avalon.type(array)
if (type !== 'array' && type !== 'object')
throw 'orderBy只能处理对象或数组'
var criteria = typeof by == 'string' ? function(el) {
Function modelFactory
has 34 lines of code (exceeds 25 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
Function update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function (vdom, show) {
var dom = vdom.dom
if (dom && dom.nodeType === 1) {
var display = dom.style.display
var value
Function limitBy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function limitBy(input, limit, begin) {
var type = avalon.type(input)
if (type !== 'array' && type !== 'object')
throw 'limitBy只能处理对象或数组'
//必须是数值
Function updateDataHandle
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateDataHandle(event) {
var elem = this
var field = elem._ms_duplex_
if (elem.composing) {
//防止onpropertychange引发爆栈
Function parseInterpolate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function parseInterpolate(dir) {
var rlineSp = /\n\r?/g
var str = dir.nodeValue.trim().replace(rlineSp, '')
var tokens = []
do {//aaa{{@bbb}}ccc
Function touchmove
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
touchmove: function(event) {
if (pinchRecognizer.element && event.touches.length > 1) {
var position = [],
current = []
for (var i = 0; i < event.touches.length; i++) {
Function move
has 32 lines of code (exceeds 25 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) {
Function innerExtend
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function innerExtend(isDeep, array) {
var target = array[0],
copyIsArray, clone, name
for (var i = 1, length = array.length; i < length; i++) {
//只处理非空参数
Function add
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function(name, recognizer) {
function move(event) {
recognizer.touchmove(event)
}
Function createFragments
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createFragments(instance, obj) {
if (isObject(obj)) {
var array = Array.isArray(obj)
var ids = []
var fragments = [],
Function getRange
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function getRange(childNodes, node) {
var i = childNodes.indexOf(node) + 1
var deep = 1,
nodes = [],
end
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
set(newValue) {
var oldValue = this.value
if (newValue !== oldValue) {
if (avalon.isObject(newValue)) {
var hash = oldValue && oldValue.$hashcode
- 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 dateFilter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function dateFilter(date, format) {
var locate = dateFilter.locate,
text = "",
parts = [],
fn, match
- 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 Directive
has a Cognitive Complexity of 11 (exceeds 5 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')
- 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 isArrayLike
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function isArrayLike(obj) {
if (!obj)
return false
var n = obj.length
if (n === (n >>> 0)) { //检测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 parseTextDir
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseTextDir(string) {
var closeTag = config.closeTag
var openTag = config.openTag
var closeTagFirst = closeTag.charAt(0)
var closeTagLength = closeTag.length