Showing 286 of 880 total issues
Avoid deeply nested control flow statements. Open
if (node.__events && !unique[uid]) {
unique[uid] = 1;
paths.push({ node, events: node.__events });
}
Avoid deeply nested control flow statements. Open
if (node === end) {
return paths;
}
Avoid deeply nested control flow statements. Open
if (
props.type === "radio" &&
name != null &&
!radioMap[name]
) {
Function eventAction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function eventAction(dom, name, val, lastProps, fiber) {
let events = dom.__events || (dom.__events = {});
events.vnode = fiber;
let refName = toLowerCase(name.slice(2));
if (val === false) {
- 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
Avoid deeply nested control flow statements. Open
if (v) {
partial.push(quote(i) + ":" + v);
}
Function flattenCb
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function flattenCb(context, child, key, childType) {
if (child === null) {
lastText = null;
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
Avoid deeply nested control flow statements. Open
if (_result) {
return _result;
}
Function update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
update(node, props) {
// mount后这个属性没用
node._wrapperState.initialValue = void 666;
let wasMultiple = node._wrapperState.wasMultiple;
- 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
Avoid deeply nested control flow statements. Open
if (value != null) {
updateOptions(dom, !!props.multiple, value, false);
}
Avoid deeply nested control flow statements. Open
if (!node) {
break inner;
}
Avoid deeply nested control flow statements. Open
if (hasOwnProperty.call(source,nextKey)) {
output[nextKey] = source[nextKey];
}
Function ReactElement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ReactElement(type, tag, props, key, ref, owner) {
Function shallowEqual
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function shallowEqual(objA, objB) {
if (Object.is(objA, objB)) {
return true;
}
//确保objA, objB都是对象
- 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 registerPageHook
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function registerPageHook(appHooks, pageHook, app, instance, args ){
Function useEffectImpl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function useEffectImpl(create, deps, EffectTag, createList, destroyList) {//ok
Function applybeforeUpdateHooks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
fiber,
instance,
newProps,
newContext,
contextStack
Function makeProps
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function makeProps(type, config, props, children, len) {
Function mapChildren
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function mapChildren(children, prefix, func, result, context) {
Function eventAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function eventAction(dom, name, val, lastProps, fiber) {
Function decodeErrorMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const decodeErrorMessage = function(message) {
if (!message) {
return message;
}
const re = /error-decoder.html\?invariant=(\d+)([^\s]*)/;
- 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"