Function innerExtend
has a Cognitive Complexity of 34 (exceeds 5 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++) {
//只处理非空参数
- 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 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 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 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 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 compaceQuote
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export var compaceQuote = (function() {
//https://github.com/bestiejs/json3/blob/master/lib/json3.js
var Escapes = {
92: "\\\\",
34: '\\"',
Avoid too many return
statements within this function. Open
return !obj.window //IE6-8 window
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return key === undefined || ohasOwn.call(obj, key)
Parsing error: 'import' and 'export' may appear only with 'sourceType: module' Open
import './lang.fix'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/