Showing 286 of 880 total issues
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(node, props) {
if (props.checked != null) {
syncValue(node, "checked", !!props.checked);
}
const isActive = node === node.ownerDocument.activeElement;
Function mergeStates
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mergeStates(fiber, nextProps) {
let instance = fiber.stateNode,
pendings = fiber.updateQueue.pendingStates,
n = pendings.length,
state = fiber.memoizedState || instance.state;
Function _slicedToArray
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = []; var _n = true; var _d = false; var _e = undefined; try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value); if (i && _arr.length === i) {
Function collectPaths
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function collectPaths(begin, end, unique) {
let paths = [];
let node = begin;
//先判定路径上有绑定事件没有
while (node && node.nodeType == 1) {
Function fireDuplex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fireDuplex() {
var radioMap = {};
if (duplexNodes.length) {
do {
let dom = duplexNodes.shift();
Function drawImage
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
imageResource,
dx,
dy,
dWidth,
dHeight,
Function key
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ReactWX.api[key] = function(options) {
var args = [].slice.call(arguments)
if ( ! options || Object(options) !== options ) {
return needWrapper.apply(facade, args);
}
Function setModernOffsets
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setModernOffsets(node, offsets) {
if (!window.getSelection) {
return;
}
Function onUnload
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function onUnload() {
for (let i in usingComponents) {
let a = usingComponents[i];
if (a.reactInstances) {
a.reactInstances.length = 0;
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function render(vnode, root, callback) {
let container = createContainer(root),
immediateUpdate = false;
if (!container.hostRoot) {
let fiber = new Fiber({
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
inst = this;
const {step} = this.state;
if (step === 0) {
return null;
Function disposeFiber
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function disposeFiber(fiber, force) {
let { stateNode, effectTag } = fiber;
if (!stateNode) {
return;
}
Function getSVGAttributeName
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSVGAttributeName(name) {
if (svgCache[name]) {
return svgCache[name];
}
const match = name.match(rhump);
Function setModernOffsets
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setModernOffsets(node, offsets) {
if (!window.getSelection) {
return;
}
Function getQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getQuery(wx, huaweiHack) {
var page = wx.$page;
if (page.query) { //小米快应用新规范,this.$page.query 返回页面启动时的参数数据;
return page.query;
}
- 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 downward
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function downward(fiber) {
var found;
while (fiber.lastChild) {
fiber = fiber.lastChild;
if (fiber.disposed || fiber.isPortal) {
- 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 createContainer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function createContainer(root, onlyGet, validate) {
validate = validate || validateTag;
if (!validate(root)) {
throw `container is not a element`; // eslint-disable-line
}
- 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 createInstance
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function createInstance(fiber, context) {
let updater = {
mountOrder: Renderer.mountOrder++,
enqueueSetState: returnFalse,
isMounted: isMounted
- 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 updateComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function updateComponent(fiber, state, callback, immediateUpdate) {
fiber.dirty = true;
let sn = typeNumber(state);
let isForced = state === true;
- 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 createCache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function createCache(invalidator) {
const resourceCache = new Map();
function getRecord(resourceType, key) {
let recordCache = resourceCache.get(resourceType);
- 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"