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'
Severity: Major
Found in packages/nerv/__tests__/fragments.spec.js - About 5 days to fix

    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'
    Severity: Major
    Found in packages/nerv/__tests__/lifecycle.spec.js - About 4 days to fix

      File component.spec.js has 1121 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /** @jsx createElement */
      import {
        Component,
        createElement,
        render,
      Severity: Major
      Found in packages/nerv/__tests__/component.spec.js - About 2 days to fix

        Function patchKeyedChildren has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
        Open

        function patchKeyedChildren (
          a: VNode[],
          b: VNode[],
          dom: Element,
          context,
        Severity: Minor
        Found in packages/nerv/src/vdom/patch.ts - About 2 days 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 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
        Severity: Minor
        Found in packages/nerv-server/src/index.ts - About 2 days 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

        File componentDidCatch.spec.js has 759 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /** @jsx createElement */
        /* eslint-disable */
        
        import {
          Component,
        Severity: Major
        Found in packages/nerv/__tests__/componentDidCatch.spec.js - About 1 day to fix

          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
          Severity: Minor
          Found in benchmarks/DBMonster/ENV.js - About 1 day 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

          File hooks.spec.js has 659 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /** @jsx createElement */
          import {
            createElement,
            useEffect,
            useState,
          Severity: Major
          Found in packages/nerv/__tests__/hooks.spec.js - About 1 day to fix

            File patch.ts has 612 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* tslint:disable: no-empty*/
            import {
              isString,
              isAttrAnEvent,
              isNumber,
            Severity: Major
            Found in packages/nerv/src/vdom/patch.ts - About 1 day to fix

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

                Function patchProp has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                Open

                export function patchProp (
                  domNode: Element,
                  prop: string,
                  lastValue,
                  nextValue,
                Severity: Minor
                Found in packages/nerv/src/vdom/patch.ts - About 1 day 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 ENV has 205 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  (function() {
                    var first = true
                    var counter = 0
                    var data
                    var _base
                Severity: Major
                Found in benchmarks/DBMonster/ENV.js - About 1 day to fix

                  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'
                  Severity: Minor
                  Found in packages/nerv/__tests__/createContext.spec.js - About 7 hrs to fix

                    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) => {
                    Severity: Minor
                    Found in packages/nerv/__tests__/refs.spec.js - About 7 hrs to fix

                      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'
                      
                      
                      Severity: Minor
                      Found in packages/nerv/__tests__/render.spec.js - About 6 hrs to fix

                        Function patchKeyedChildren has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function patchKeyedChildren (
                          a: VNode[],
                          b: VNode[],
                          dom: Element,
                          context,
                        Severity: Major
                        Found in packages/nerv/src/vdom/patch.ts - About 6 hrs to fix

                          Function patch has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function patch (
                            lastVnode,
                            nextVnode,
                            parentNode: Element,
                            context: object,
                          Severity: Minor
                          Found in packages/nerv/src/vdom/patch.ts - About 5 hrs 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 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
                          Severity: Major
                          Found in packages/nerv-server/src/index.ts - About 4 hrs to fix

                            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
                              }
                            Severity: Major
                            Found in packages/nerv-devtools/src/index.ts - About 4 hrs to fix

                              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'
                              Severity: Minor
                              Found in packages/nerv/src/lifecycle.ts - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language