Showing 128 of 341 total issues
File fragments.spec.js
has 1884 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import { Component, createElement, render, Fragment } from '../src/index'
import { rerender } from '../src/render-queue'
import { span, div, ul, ol, li, section } from './util/dom'
import { normalizeHTML } from './util'
File lifecycle.spec.js
has 1664 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import { Component, createElement, render, findDOMNode } from '../src'
import { rerender } from '../src/render-queue'
import sinon from 'sinon'
import { EMPTY_CHILDREN, normalizeHTML } from './util'
File component.spec.js
has 1121 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import {
Component,
createElement,
render,
Function patchKeyedChildren
has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring. Open
function patchKeyedChildren (
a: VNode[],
b: VNode[],
dom: Element,
context,
- 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 renderVNodeToString
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
function renderVNodeToString (vnode, parent, context, isSvg?: boolean) {
if (isInvalid(vnode)) {
return ''
}
const { type, props, children } = vnode
- 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 componentDidCatch.spec.js
has 759 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
/* eslint-disable */
import {
Component,
Function ENV
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
(function() {
var first = true
var counter = 0
var data
var _base
- 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 hooks.spec.js
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import {
createElement,
useEffect,
useState,
File patch.ts
has 612 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* tslint:disable: no-empty*/
import {
isString,
isAttrAnEvent,
isNumber,
File polyfill.js
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable */
/*!
Copyright (C) 2013-2015 by WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
Function patchProp
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
export function patchProp (
domNode: Element,
prop: string,
lastValue,
nextValue,
- 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 ENV
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function() {
var first = true
var counter = 0
var data
var _base
File createContext.spec.js
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import { Component, createElement, render, createContext } from '../src/index'
import { rerender } from '../src/render-queue'
import { uid } from '../src/create-context'
import sinon from 'sinon'
File refs.spec.js
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import { Component, createElement, render, findDOMNode, createRef, forwardRef, memo } from '../src'
import sinon from 'sinon'
const spy = (name, ...args) => {
File render.spec.js
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsx createElement */
import { Component, createElement, render, findDOMNode } from '../src'
import { rerender } from '../src/render-queue'
import { getAttributes, normalizeHTML, delay } from './util'
Function patchKeyedChildren
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
function patchKeyedChildren (
a: VNode[],
b: VNode[],
dom: Element,
context,
Function patch
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function patch (
lastVnode,
nextVnode,
parentNode: Element,
context: object,
- 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 renderVNodeToString
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderVNodeToString (vnode, parent, context, isSvg?: boolean) {
if (isInvalid(vnode)) {
return ''
}
const { type, props, children } = vnode
Function initDevTools
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initDevTools () {
const hook = (window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__
if (hook == null) {
return
}
File lifecycle.ts
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
// import { extend, isFunction, isNumber, isString } from 'nerv-utils'
import { extend, isFunction, isNumber, isString, clone, isUndefined, isArray } from 'nerv-utils'
import CurrentOwner from './current-owner'
import createElement from './vdom/create-element'
import createVText from './vdom/create-vtext'