Showing 286 of 880 total issues
Function update
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(NextComponent) {
if (typeof NextComponent !== "function") {
throw new Error("Expected a constructor.");
}
if (NextComponent === CurrentComponent) {
Function createRouter
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createRouter(name) {
return function (obj, inner) {
var uri = "", params = {}, delta = 0;
if (name === 'back') {
delta = Object(obj).delta
Function createCache
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createCache(invalidator) {
const resourceCache = new Map();
function getRecord(resourceType, key) {
let recordCache = resourceCache.get(resourceType);
Function render
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div>
{
React.appType === 'h5'?
File ReactDOMTextarea-test.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
const emptyFunction = function(){}
describe('ReactDOMTextarea', () => {
let React;
Function commitEffects
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function commitEffects(fiber) {
let instance = fiber.stateNode || emptyObject;
let amount = fiber.effectTag;
let updater = instance.updater || fakeObject;
for (let i = 0; i < effectLength; 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 fireDuplex
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function fireDuplex() {
var radioMap = {};
if (duplexNodes.length) {
do {
let dom = duplexNodes.shift();
- 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 createSubscription
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createSubscription(config) {
const { getCurrentValue, subscribe } = config;
notFn(getCurrentValue, 'Subscription must specify a getCurrentValue function')
notFn(subscribe, 'Subscription must specify a subscribe function')
Function exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(initModules) {
let ReactDOM;
let ReactDOMServer;
function resetModules() {
- 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 createHistory
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function createHistory(source) {
let listeners = [];
let transitioning = false;
let resolveTransition = () => {};
- 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 matcher
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcher(callback, expectedMessages) {
if (__DEV__) {
// Warn about incorrect usage of matcher.
if (typeof expectedMessages === 'string') {
expectedMessages = [expectedMessages];
Function traverseAllChildren
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function traverseAllChildren(
children,
nameSoFar,
callback,
bookKeeping
Function createContext
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createContext(defaultValue, calculateChangedBits) {
if (calculateChangedBits == void 0) {
calculateChangedBits = null;
}
var instance = {
Function createOpenTagMarkup
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function createOpenTagMarkup(
tagVerbatim,
tagLowercase,
props,
namespace,
- 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 createContext
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function createContext(defaultValue, calculateChangedBits) {
if (calculateChangedBits == void 0) {
calculateChangedBits = null;
}
var instance = {
- 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 diffProps
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function diffProps(dom, lastProps, nextProps, fiber) {
let isSVG = fiber.namespaceURI === NAMESPACE.svg;
let tag = fiber.type;
let continueProps = skipProps;
if (!isSVG && rform.test(fiber.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 diffChildren
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function diffChildren(parentFiber, children) {
let oldFibers = parentFiber.children; // 旧的
if (oldFibers) {
parentFiber.oldChildren = oldFibers;
} else {
File canvas.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
const CanvasContext = function(canvasId) {
const canvasDom = document.getElementById(canvasId);
if (!canvasDom || !canvasDom.getContext) {
console.error('canvasId错误,或浏览器不支持canvas');
} else {
File scheduleWork.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { reconcileDFS } from './beginWork';
import { commitDFS } from './commitWork';
import { Renderer } from 'react-core/createRenderer';
import {
effects,
File props.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NAMESPACE } from "./browser";
import { patchStyle } from "./style";
import { eventAction, rform } from "./event";
import { typeNumber, emptyObject, noop } from "react-core/util";
//import { duplexAction } from './duplex';