Showing 286 of 880 total issues
Function blurFocus
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function blurFocus(e) {
let dom = getTarget(e);
let type = focusMap[e.type];
if (Renderer.inserting) {
if (type === 'blur') {
- 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 getSVGAttributeName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getSVGAttributeName(name) {
if (svgCache[name]) {
return svgCache[name];
}
const match = name.match(rhump);
- 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 35 lines of code (exceeds 25 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
}
Function option
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
option(props, inst) {
let selected = null;
const selectValue = inst.currentSelectValue;
const optionChildren = flattenOptionChildren(props.children);
if (selectValue != null) {
Function createMemorySource
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createMemorySource(initialPathname = '/') {
let index = 0;
let states = [];
let stack = [
{
Function deepForceUpdate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deepForceUpdate(
instance,
shouldUpdate,
onUpdate
) {
Function createOpenTagMarkup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createOpenTagMarkup(
tagVerbatim,
tagLowercase,
props,
namespace,
Function createRoute
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
let createRoute = basepath => element => {
invariant(
element.props.path || element.props.default || element.type === Redirect,
`<Router>: Children of <Router> must have a "path" or "default" prop, or be a "<Redirect>".
None found on element type "${element.type}"`
Function browserShare
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
browserShare({ title, path, imageUrl, type = "default", desc }) {
var nativeShare = new NativeShare();
nativeShare.setShareData({
icon: imageUrl,
link: path,
Function read
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
read(bytes) {
if (this.exhausted) {
return null;
}
Function pushChildQueue
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pushChildQueue(fiber, queue) {
//判定当前节点是否包含已进队的节点
let maps = {};
for (let i = queue.length, el; (el = queue[--i]); ) {
//移除列队中比它小的组件
Function pushChildQueue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function pushChildQueue(fiber, queue) {
//判定当前节点是否包含已进队的节点
let maps = {};
for (let i = queue.length, el; (el = queue[--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 forward
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function forward(fiber) {
var found;
while (fiber.forward) {
fiber = fiber.forward;
//如果这已经被销毁或者是传送门
- 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 onBeforeRender
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
onBeforeRender(fiber) {
let type = fiber.type;
let instance = fiber.stateNode;
let app = _getApp();
if (type.reactInstances) {
- 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 collectMixins
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function collectMixins(mixins) {
let keyed = {};
for (let i = 0; i < mixins.length; i++) {
let mixin = mixins[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 createRoute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
let createRoute = basepath => element => {
invariant(
element.props.path || element.props.default || element.type === Redirect,
`<Router>: Children of <Router> must have a "path" or "default" prop, or be a "<Redirect>".
None found on element type "${element.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 pushError
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function pushError(fiber, hook, error) {
let names = [];
let boundary = findCatchComponent(fiber, names, hook);
let stack = describeError(names, hook);
if (boundary) {
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor({
url = '',
method = 'get',
data = {},
header = {},
Function registerComponent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function registerComponent(type, name) {
type.isMPComponent = true;
registeredComponents[name] = type;
type.reactInstances = [];
let config = {
Function registerComponent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function registerComponent (type, name) {
type.isMPComponent = true;
registeredComponents[name] = type;
let reactInstances = type.reactInstances = [];
let hasInit = false;