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,
Severity: Minor
Found in packages/nerv/src/vdom/patch.ts - About 1 hr to fix

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) {
Severity: Minor
Found in packages/nerv-create-class/src/index.ts - About 1 hr to fix

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
Severity: Minor
Found in packages/nerv/src/vdom/create-element.ts - About 1 hr to fix

    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?`,
    Severity: Minor
    Found in release.js - About 1 hr to fix

      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)
      Severity: Minor
      Found in packages/nerv/__tests__/lifecycle.spec.js - About 1 hr to fix

        Function componentDidMount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              componentDidMount () {
                this.setState(
                  {
                    a: true
                  },
        Severity: Minor
        Found in packages/nerv/__tests__/component.spec.js - About 1 hr to fix

          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
          Severity: Minor
          Found in packages/nerv/src/vdom/unmount.ts - About 1 hr to fix

            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)) {
            Severity: Minor
            Found in packages/nerv-devtools/src/renderer.ts - About 1 hr to fix

              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
              Severity: Minor
              Found in packages/nerv/__tests__/svg.spec.js - About 1 hr to fix

                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,
                Severity: Minor
                Found in browsers/polyfill.js - About 1 hr to fix

                  Function createElement has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function createElement (
                    vnode: VirtualNode | VirtualNode[],
                    isSvg?: boolean,
                    parentContext?,
                    parentComponent?
                  Severity: Minor
                  Found in packages/nerv/src/vdom/create-element.ts - About 1 hr to fix

                    Function patchNonKeyedChildren has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function patchNonKeyedChildren (
                      parentDom: Element,
                      lastChildren,
                      nextChildren,
                      context: object,
                    Severity: Minor
                    Found in packages/nerv/src/vdom/patch.ts - About 1 hr to fix

                      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]
                      
                      
                      Severity: Minor
                      Found in packages/nerv-create-class/src/index.ts - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in packages/nerv/src/vdom/patch.ts - About 1 hr to fix

                      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) {
                      Severity: Minor
                      Found in packages/nerv/src/event.ts - About 1 hr to fix

                        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(),
                        Severity: Minor
                        Found in browsers/polyfill.js - About 1 hr to fix

                          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) {
                          Severity: Minor
                          Found in packages/nerv-test-utils/src/index.ts - About 1 hr to fix

                            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
                              }
                            
                            
                            Severity: Minor
                            Found in packages/nerv-devtools/src/utils.ts - About 55 mins to fix

                            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)) {
                            Severity: Minor
                            Found in packages/nerv-devtools/src/renderer.ts - About 55 mins to fix

                            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)) {
                            Severity: Minor
                            Found in packages/nerv-utils/src/shallow-equal.ts - About 55 mins to fix

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language