Showing 128 of 341 total issues
Function patchArrayChildren
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function patchArrayChildren (
parentDom: Element,
lastChildren,
nextChildren,
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 collateMixins
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function collateMixins (mixins: Function[] | any[], keyed = {}): any {
for (let i = 0, len = mixins.length; i < len; i++) {
const mixin = mixins[i]
if (mixin.mixins) {
- 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 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 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 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 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 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 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 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 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 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 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 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 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
update (vnode) {
const data = getData(vnode)
// Children must be updated first
if (Array.isArray(data.children)) {
- 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"