Showing 286 of 880 total issues
Function reconcileDFS
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export function reconcileDFS(fiber, info, deadline, ENOUGH_TIME) {
var topWork = fiber;
outerLoop: while (fiber) {
if (fiber.disposed || deadline.timeRemaining() <= ENOUGH_TIME) {
break;
- 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 more
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
export var more = function(api) {
return {
// 交互
showModal: function _(a) {
a.cancelButtonText = a.cancelText;
File beginWork.js
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { extend, typeNumber, isFn, gDSFP, gSBU } from 'react-core/util';
import { fiberizeChildren } from 'react-core/createElement';
import { AnuPortal } from 'react-core/createPortal';
import { Renderer } from 'react-core/createRenderer';
Function proxyClass
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
function proxyClass(InitialComponent) {
var existingProxy = findProxy(InitialComponent);
if (existingProxy) {
return existingProxy;
}
Function render
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(child, context, parentNamespace) {
var t = typeNumber(child)
if (t === 3 || t === 4) {
const text = '' + child;
if (text === '') {
File ReactElement-test.js
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function createMatcherFor
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
const createMatcherFor = consoleMethod =>
function matcher(callback, expectedMessages) {
if (__DEV__) {
// Warn about incorrect usage of matcher.
if (typeof expectedMessages === 'string') {
- 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 commitDFSImpl
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
function commitDFSImpl(fiber) {
let topFiber = fiber;
outerLoop: while (true) {
//逐步向下执行所有移除与插入操作
if (fiber.effects && fiber.effects.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 diffChildren
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
function diffChildren(parentFiber, children) {
let oldFibers = parentFiber.children; // 旧的
if (oldFibers) {
parentFiber.oldChildren = oldFibers;
} else {
- 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 createDevToolsBridge
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createDevToolsBridge() {
console.log("createDevToolsBridge.....");
var ComponentTree = {
getNodeFromInstance: function getNodeFromInstance(instance) {
//createReactDOMComponent生成的实例有vnode对象
File ReactDOMEventListener-test.js
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
describe('ReactDOMEventListener', () => {
let React = require('react');
File ReactTestUtils-test.js
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
let createRenderer;
let React;
let ReactDOM;
Function createPrototypeProxy
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createPrototypeProxy() {
var proxy = {};
var current = null;
var mountedInstances = [];
function proxyToString(name) {
File ReduxIE.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.Redux = {})));
}(this, (function (exports) { 'use strict';
File ReactElementValidator-test.internal.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
let PropTypes;
let ReactFeatureFlags;
let React;
let ReactDOM;
File event.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { document, modern, contains } from './browser';
import { isFn, noop, toLowerCase } from 'react-core/util';
import { Renderer } from 'react-core/createRenderer';
import { enqueueDuplex } from './duplex';
export let rform = /textarea|input|select|option/i;
InnerAudioContext
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class InnerAudioContext {
constructor(id, opts) {
this.audioEl = this.init(id, opts);
this._isPaused = false;
}
Function createStore
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createStore(reducer, preloadedState, enhancer) {
var _ref2;
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState;
Function collectPaths
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function collectPaths(begin, end, unique) {
let paths = [];
let node = begin;
//先判定路径上有绑定事件没有
while (node && node.nodeType == 1) {
- 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 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolve(child, context) {
while (isValidElement(child)) {
// Safe because we just checked it's an element.
let element = child;
let Component = element.type;