Showing 286 of 880 total issues
File ReactCompositeComponentState-test.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
let React;
let ReactDOM;
Function render
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
render(child, context, parentNamespace) {
var t = typeNumber(child)
if (t === 3 || t === 4) {
const text = '' + child;
if (text === '') {
- 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 a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export var more = function(api) {
return {
// 交互
showModal: function _(a) {
a.cancelButtonText = a.cancelText;
- 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 ReactJSXElementValidator-test.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
// TODO: All these warnings should become static errors using Flow instead
// of dynamic errors when using JSX with Flow.
let React;
let ReactDOM;
Function updateOptions
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function updateOptions(node, multiple, propValue, setDefaultSelected) {
var options = node.options;
if (multiple) {
var selectedValues = propValue;
- 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 ReactSelection.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { options, Fragment } from "../src/util";
import { Children } from "../src/Children";
import * as eventSystem from "../src/event";
import { PropTypes } from "../src/PropTypes";
import { Component } from "../src/Component";
File ReactContextValidator-test.js
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
// This test doesn't really have a good home yet. I'm leaving it here since this
// behavior belongs to the old propTypes system yet is currently implemented
// in the core ReactCompositeComponent. It should technically live in core's
// test suite but I'll leave it here to indicate that this is an issue that
// needs to be fixed.
File ReactStatelessComponent-test.js
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
let PropTypes;
let React;
let ReactDOM;
Function updateClassComponent
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export function updateClassComponent(fiber, info) {
let { type, stateNode: instance, props } = fiber;
let { contextStack, containerStack } = info;
let getContext = type.contextType;
let unmaskedContext = contextStack[0];
- 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 createElement
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export function createElement(vnode) {
let p = vnode.return;
let { type, props, ns } = vnode;
switch (type) {
case '#text':
- 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 processChild
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processChild(element, Component) {
let publicContext = processContext(Component, context);
let queue = [];
let replace = false;
File devtools.js
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined"
? (module.exports = factory())
: typeof define === "function" && define.amd
? define(factory)
File ReactMultiChild-test.js
has 317 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
Function createSubscription
has a Cognitive Complexity of 25 (exceeds 5 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')
- 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 updateClassComponent
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateClassComponent(fiber, info) {
let { type, stateNode: instance, props } = fiber;
let { contextStack, containerStack } = info;
let getContext = type.contextType;
let unmaskedContext = contextStack[0];
File ReactElementClone-test.js
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
let PropTypes;
let React;
let ReactDOM;
File ReactInputSelection.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function umd(root, factory) {
if (typeof exports === "object" && typeof module === "object") {
module.exports = factory(require("react"));
} else if (typeof define === "function" && define.amd) {
define(["react"], factory);
Function registerPage
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function registerPage(PageClass, path) {
PageClass.reactInstances = []
PageClass.container = {
type: "page",
props: {},
File duplex.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { typeNumber, emptyObject } from "react-core/util";
function getSafeValue(value) {
switch (typeNumber(value)) {
case 2:
Function previewImage
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function previewImage(options = {}) {
return new Promise(function(resolve, reject) {
const {
urls,
current,