Showing 128 of 341 total issues
Function errorHandler
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function errorHandler (component: Component<any, any>, error) {
// if(!component) { throw error ; return }
let boundary
while (true) {
const { getDerivedStateFromError } = (component as any).constructor
- 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 mountVNode
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function mountVNode (vnode: VNode, isSvg?: boolean, parentContext?, parentComponent?) {
if (vnode.isSvg) {
isSvg = true
} else if (vnode.type === 'svg') {
isSvg = true
- 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 f
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function f () {
const response = await prompts({
type: 'select',
name: 'version',
message: `What's the release version?`,
Function verifyLifycycleMethods
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const verifyLifycycleMethods = TestComponent => {
const proto = TestComponent.prototype
const protoSpy = {}
spies.forEach(s => {
protoSpy[s] = sinon.spy(proto, s)
Function componentDidMount
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount () {
this.setState(
{
a: true
},
Function mountVNode
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function mountVNode (vnode: VNode, isSvg?: boolean, parentContext?, parentComponent?) {
if (vnode.isSvg) {
isSvg = true
} else if (vnode.type === 'svg') {
isSvg = true
Function unmount
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function unmount (vnode, parentDom?) {
if (isInvalid(vnode)) {
return
}
const vtype = vnode.vtype
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
inst = this
const { step } = this.state
if (step === 0) {
return null
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
update (vnode) {
const data = getData(vnode)
// Children must be updated first
if (Array.isArray(data.children)) {
Function getPropertyValue
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ComputedStyle.prototype.getPropertyValue = function (name) {
var
el = this._,
style = el.style,
currentStyle = el.currentStyle,
Function createElement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createElement (
vnode: VirtualNode | VirtualNode[],
isSvg?: boolean,
parentContext?,
parentComponent?
Function patchNonKeyedChildren
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function patchNonKeyedChildren (
parentDom: Element,
lastChildren,
nextChildren,
context: object,
Function patchProps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function patchProps (
domNode: Element,
nextProps: Props,
previousProps: Props,
lastVnode: 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
Function applyMixins
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function applyMixins (Cl: any, mixins: Function[] | any[]) {
for (const key in mixins) {
if (mixins.hasOwnProperty(key)) {
const mixin = mixins[key]
- 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 attachEventToDocument
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function attachEventToDocument (d, eventName, delegatedRoots) {
const eventHandler = (event) => {
const items = delegatedRoots.items
const count = items.size
if (count > 0) {
Function findAllInRenderedTree
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findAllInRenderedTree (
tree: VirtualNode,
test: (vnode: VirtualNode) => boolean
) {
if (isValidElement(tree) || isComponent(tree) || isDOMComponent) {
Function commonEventLoop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function commonEventLoop(currentTarget, e, $handlers, synthetic) {
for(var
handler,
continuePropagation,
handlers = $handlers.slice(),
Function Monitoring
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
(function() {
var stats = new MemoryStats()
stats.domElement.style.position = 'fixed'
stats.domElement.style.right = '0px'
stats.domElement.style.bottom = '0px'
- 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 shallowEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function shallowEqual (a, b, isProps?) {
if (a == null || b == null) {
return false
}
- 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 shallowEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function shallowEqual (obj1, obj2) {
if (obj1 === null || obj2 === null) {
return false
}
if (Object.is(obj1, obj2)) {
- 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"