Showing 286 of 880 total issues
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
let {
location,
navigate,
basepath,
- 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 createElement
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function createElement(type, config, ...children) {
let props = {},
tag = 5,
key = null,
ref = null,
- 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 traverseCallback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function traverseCallback(bookKeeping, child, childKey) {
const { result, keyPrefix, func, context } = bookKeeping;
let mappedChild = func.call(context, child, bookKeeping.count++);
if (!result) {
- 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 resolve
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolve(to, base) {
// /foo/bar, /baz/qux => /foo/bar
if (startsWith(to, "/")) {
return to;
}
Function applyMiddleware
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyMiddleware() {
for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
Function consoleSpy
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const consoleSpy = message => {
const normalizedMessage = normalizeCodeLocInfo(message);
for (let index = 0; index < expectedMessages.length; index++) {
const expectedMessage = expectedMessages[index];
Function ReactElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ReactElement(type, tag, props, key, ref, owner) {
var ret = {
type,
tag,
props
Function flattenHooks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function flattenHooks(key, hooks) {
var hookType = __type.call(hooks[0]).slice(8, -1);
if (hookType === "Object") {
var ret = {};
for (var i = 0; i < hooks.length; i++) {
Function navigate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
navigate(to, { state, replace = false } = {}) {
state = {
...state,
key: Date.now() + ''
};
Function touchtap
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
eventPropHooks.touchtap = function(event) {
var type = event.nativeEvent.type;
if (!isStartish(type) && !isEndish(type)) {
return false;
}
Function flattenHooks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function flattenHooks(key, hooks) {
let hookType = __type.call(hooks[0]).slice(8, -1);
if (hookType === "Object") {
// Merge objects
let ret = {};
Function combination
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function combination() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = arguments[1];
if (shapeAssertionError) {
Function dispatchEvent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function dispatchEvent(e) {
const instance = this.reactInstance;
if (!instance || !instance.$$eventCached) {
return;
}
- 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 renderDOM
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
renderDOM(element, context, parentNamespace) {
const tag = element.type.toLowerCase();
let namespace = parentNamespace;
if (parentNamespace === Namespaces.html) {
- 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 getMaskedContext
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getMaskedContext(instance, contextTypes, unmaskedContext) {
var noContext = !contextTypes;
if (instance){
if (noContext){
return instance.context;
- 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 safeInvokeHooks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function safeInvokeHooks(upateQueue, create, destory) {
var uneffects = upateQueue[destory],
effects = upateQueue[create], fn;
if (!uneffects){
return;
- 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 property
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
property: function(dom, name, val) {
// 尝试直接赋值,部分情况下会失败,如给 input 元素的 size 属性赋值 0 或字符串
// 这时如果用 setAttribute 则会静默失败
try {
if (!val && val !== 0) {
- 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 collectVDOM
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function collectVDOM(vdom, array) {
if (vdom.tag == 5) {
var children = [];
var element = {
type: vdom.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"
Further reading
Function wheel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
eventPropHooks.wheel = function(event) {
event.deltaX =
'deltaX' in event
? event.deltaX
: // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
- 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 getPropAction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getPropAction(dom, name, isSVG) {
if (isSVG && name === "className") {
return "svgClass";
}
if (isSpecialAttr[name]) {
- 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"