RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function reconcileDFS has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

export function reconcileDFS(fiber, info, deadline, ENOUGH_TIME) {
    var topWork = fiber;
    outerLoop: while (fiber) {
        if (fiber.disposed || deadline.timeRemaining() <= ENOUGH_TIME) {
            break;
Severity: Minor
Found in packages/fiber/beginWork.js - About 6 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 more has 163 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export var more = function(api) {
    return {
        // 交互
        showModal: function _(a) {
            a.cancelButtonText = a.cancelText;
Severity: Major
Found in packages/render/miniapp/apiForAlipay/index.js - About 6 hrs to fix

    File beginWork.js has 424 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { extend, typeNumber, isFn, gDSFP, gSBU } from 'react-core/util';
    import { fiberizeChildren } from 'react-core/createElement';
    import { AnuPortal } from 'react-core/createPortal';
    
    import { Renderer } from 'react-core/createRenderer';
    Severity: Minor
    Found in packages/fiber/beginWork.js - About 6 hrs to fix

      Function proxyClass has 143 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function proxyClass(InitialComponent) {
              var existingProxy = findProxy(InitialComponent);
              if (existingProxy) {
                  return existingProxy;
              }
      Severity: Major
      Found in lib/ReactProxy.js - About 5 hrs to fix

        Function render has 141 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            render(child, context, parentNamespace) {
                var t  = typeNumber(child)
                if (t === 3 || t === 4) {
                    const text = '' + child;
                    if (text === '') {
        Severity: Major
        Found in packages/render/server/Renderer.js - About 5 hrs to fix

          File ReactElement-test.js has 399 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * Copyright (c) 2013-present, Facebook, Inc.
           *
           * This source code is licensed under the MIT license found in the
           * LICENSE file in the root directory of this source tree.
          Severity: Minor
          Found in packages/core/__tests__/ReactElement-test.js - About 5 hrs to fix

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

            const createMatcherFor = consoleMethod =>
              function matcher(callback, expectedMessages) {
                if (__DEV__) {
                  // Warn about incorrect usage of matcher.
                  if (typeof expectedMessages === 'string') {
            Severity: Minor
            Found in scripts/jest/matchers/toWarnDev.js - 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 commitDFSImpl has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            function commitDFSImpl(fiber) {
                let topFiber = fiber;
                outerLoop: while (true) {
                    //逐步向下执行所有移除与插入操作
                    if (fiber.effects && fiber.effects.length) {
            Severity: Minor
            Found in packages/fiber/commitWork.js - 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 diffChildren has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            function diffChildren(parentFiber, children) {
                let oldFibers = parentFiber.children; // 旧的
                if (oldFibers) {
                    parentFiber.oldChildren = oldFibers;
                } else {
            Severity: Minor
            Found in packages/fiber/beginWork.js - 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 createDevToolsBridge has 122 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function createDevToolsBridge() {
                    console.log("createDevToolsBridge.....");
                    var ComponentTree = {
                        getNodeFromInstance: function getNodeFromInstance(instance) {
                            //createReactDOMComponent生成的实例有vnode对象
            Severity: Major
            Found in lib/devtools.js - About 4 hrs to fix

              File ReactDOMEventListener-test.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              describe('ReactDOMEventListener', () => {
              
                let React = require('react');
              Severity: Minor
              Found in packages/render/dom/__tests__/ReactDOMEventListener-test.js - About 4 hrs to fix

                File ReactTestUtils-test.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                
                let createRenderer;
                let React;
                let ReactDOM;
                Severity: Minor
                Found in packages/render/dom/__tests__/ReactTestUtils-test.js - About 4 hrs to fix

                  Function createPrototypeProxy has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function createPrototypeProxy() {
                          var proxy = {};
                          var current = null;
                          var mountedInstances = [];
                          function proxyToString(name) {
                  Severity: Major
                  Found in lib/ReactProxy.js - About 4 hrs to fix

                    File ReduxIE.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    (function (global, factory) {
                        typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
                        typeof define === 'function' && define.amd ? define(['exports'], factory) :
                        (factory((global.Redux = {})));
                    }(this, (function (exports) { 'use strict';
                    Severity: Minor
                    Found in lib/ReduxIE.js - About 4 hrs to fix

                      File ReactElementValidator-test.internal.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      
                      let PropTypes;
                      let ReactFeatureFlags;
                      let React;
                      let ReactDOM;
                      Severity: Minor
                      Found in packages/core/__tests__/ReactElementValidator-test.internal.js - About 4 hrs to fix

                        File event.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { document, modern, contains } from './browser';
                        import { isFn, noop, toLowerCase } from 'react-core/util';
                        import { Renderer } from 'react-core/createRenderer';
                        import { enqueueDuplex } from './duplex';
                        export let rform = /textarea|input|select|option/i;
                        Severity: Minor
                        Found in packages/render/dom/event.js - About 4 hrs to fix

                          InnerAudioContext has 35 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class InnerAudioContext {
                              constructor(id, opts) {
                                  this.audioEl = this.init(id, opts);
                                  this._isPaused = false;
                              }
                          Severity: Minor
                          Found in packages/render/miniapp/apiForH5/audio.js - About 4 hrs to fix

                            Function createStore has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function createStore(reducer, preloadedState, enhancer) {
                              var _ref2;
                            
                              if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
                                enhancer = preloadedState;
                            Severity: Major
                            Found in lib/ReduxIE.js - About 4 hrs to fix

                              Function collectPaths has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function collectPaths(begin, end, unique) {
                                  let paths = [];
                                  let node = begin;
                                  //先判定路径上有绑定事件没有
                                  while (node && node.nodeType == 1) {
                              Severity: Minor
                              Found in packages/render/dom/event.js - About 4 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 resolve has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function resolve(child, context) {
                                  while (isValidElement(child)) {
                                      // Safe because we just checked it's an element.
                                      let element = child;
                                      let Component = element.type;
                              Severity: Major
                              Found in packages/render/server/Renderer.js - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language