Showing 128 of 341 total issues
Function cloneElement
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export default function cloneElement (vnode, props?: object, ...children): any {
if (isVText(vnode)) {
return createVText(vnode.text)
}
if (isString(vnode) || isNumber(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 event.ts
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { isFunction, MapClass, doc, isiOS, isIE9, isTaro } from 'nerv-utils'
import { noop } from 'nerv-shared'
import { supportedPassiveEventMap } from './passive-event'
const ONINPUT = 'oninput'
Function exports
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '.',
Function render
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="container">
<div className="jumbotron">
<div className="row">
Function updateComponent
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function updateComponent (component, isForce = false) {
let vnode = component.vnode
let dom = vnode.dom
const props = component.props
let state = component.getState()
- 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 MemoryStats
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MemoryStats = function() {
var msMin = 100
var msMax = 0
var container = document.createElement('div')
Function updateComponent
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateComponent (component, isForce = false) {
let vnode = component.vnode
let dom = vnode.dom
const props = component.props
let state = component.getState()
Function patch
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function patch (
lastVnode,
nextVnode,
parentNode: Element,
context: object,
Function unmount
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function unmount (vnode, parentDom?) {
if (isInvalid(vnode)) {
return
}
const vtype = vnode.vtype
- 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 svg-property-config.ts
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
const NS = {
ev: 'http://www.w3.org/2001/xml-events',
xlink: 'http://www.w3.org/1999/xlink',
xml: 'http://www.w3.org/XML/1998/namespace'
}
Function Monitoring
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function() {
var stats = new MemoryStats()
stats.domElement.style.position = 'fixed'
stats.domElement.style.right = '0px'
stats.domElement.style.bottom = '0px'
Function MemoryStats
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var MemoryStats = function() {
var msMin = 100
var msMax = 0
var container = document.createElement('div')
- 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 findAllInRenderedTree
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function findAllInRenderedTree (
tree: VirtualNode,
test: (vnode: VirtualNode) => boolean
) {
if (isValidElement(tree) || isComponent(tree) || isDOMComponent) {
- 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 createContext
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createContext<T> (defaultValue: T): Context<T> {
const contextProp = '__context_' + uid++ + '__'
class Provider extends Component<ProviderProps<T>> {
static isContextProvider = true
Function patchProp
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function patchProp (
domNode: Element,
prop: string,
lastValue,
nextValue,
Function lis
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function lis (a: number[]): number[] {
const p = a.slice()
const result: number[] = []
result.push(0)
let u: number
- 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 addEventListener
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
addEventListener: valueDesc(function (type, handler, capture) {
if (typeof handler !== 'function' && typeof handler !== 'object') return;
var
self = this,
ontype = 'on' + type,
Function patchStyle
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function patchStyle (lastAttrValue: CSSStyleSheet, nextAttrValue: CSSStyleSheet, dom: HTMLElement) {
const domStyle = dom.style
let style
let value
- 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 cloneElement
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function cloneElement (vnode, props?: object, ...children): any {
if (isVText(vnode)) {
return createVText(vnode.text)
}
if (isString(vnode) || isNumber(vnode)) {
Function getComputedStyle
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
getComputedStyle: valueDesc(function(){
var // partially grabbed from jQuery and Dean's hack
notpixel = /^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,
position = /^(top|right|bottom|left)$/,