Showing 286 of 880 total issues
Function commitEffects
has 65 lines of code (exceeds 25 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++) {
Function compile
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compile(content, contentFilename) {
let output = null;
const compilerHost = {
getSourceFile(filename, languageVersion) {
let source;
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className='modal2019'>
<div className="top">
{this.props.title}
Function pick
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function pick(routes, uri) {
let match;
let default_;
let uriPathname = uri.split("?").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 createClass
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function createClass(spec) {
if (!isFn(spec.render)) {
throw "createClass(...): Class specification must implement a `render` method.";
}
//创建一个构造器,有四个参数
- 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 registerPage
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function registerPage(PageClass, path, testObject) {
PageClass.container = {
type: "page",
props: {},
children: [],
Function pick
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pick(routes, uri) {
let match;
let default_;
let uriPathname = uri.split("?").shift();
Function str
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function str(key, holder) {
var i,
v,
len,
partial,
Function updateAttribute
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
updateAttribute(fiber) {
let { props, lastProps } = fiber;
let beaconId = props['data-beacon-uid'];
let instance = fiber._owner; //clazz[instanceId];
if (instance && beaconId) {
- 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
File polyfill.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function (global) {
var oProto = Object.prototype;
var toString = oProto.toString;
var hasOwnProperty = oProto.hasOwnProperty;
function needFix(fn) {
File createElement.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
typeNumber,
toWarnDev,
hasSymbol,
REACT_ELEMENT_TYPE,
Function reconcileDFS
has 57 lines of code (exceeds 25 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;
Function compile
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function compile(content, contentFilename) {
let output = null;
const compilerHost = {
getSourceFile(filename, languageVersion) {
let source;
- 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 registerPage
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function registerPage(PageClass, path) {
PageClass.reactInstances = []
PageClass.container = {
type: "page",
props: {},
- 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 findHostInstance
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function findHostInstance(fiber) {
if (!fiber) {
return null;
} else if (fiber.nodeType) {
return fiber;
- 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
File renderSubtreeIntoContainer-test.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const React = require('react');
const PropTypes = require('prop-types');
const ReactDOM = require('react-dom');
Function findCatchComponent
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findCatchComponent(fiber, names, hook) {
let instance,
name,
topFiber = fiber,
retry,
Function createElement
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createElement(vnode) {
let p = vnode.return;
let { type, props, ns } = vnode;
switch (type) {
case '#text':
Function createHistory
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createHistory(source) {
let listeners = [];
let transitioning = false;
let resolveTransition = () => {};
Function registerPageHook
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function registerPageHook(appHooks, pageHook, app, instance, args ){
for(let i = 0; i < 2; i ++){
let method = i ? appHooks[pageHook]: pageHook;
let host = i ? app: instance;
if( host && host[method] && isFn(host[method])){
- 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"