RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function update has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function update(NextComponent) {
            if (typeof NextComponent !== "function") {
                throw new Error("Expected a constructor.");
            }
            if (NextComponent === CurrentComponent) {
Severity: Major
Found in lib/ReactProxy.js - About 3 hrs to fix

    Function createRouter has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createRouter(name) {
        return function (obj, inner) {
            var uri = "", params = {}, delta = 0;
            if (name === 'back') {
                delta = Object(obj).delta
    Severity: Major
    Found in packages/render/miniapp/apiForQuick/router.js - About 3 hrs to fix

      Function createCache has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function createCache(invalidator) {
          const resourceCache = new Map();
      
          function getRecord(resourceType, key) {
              let recordCache = resourceCache.get(resourceType);
      Severity: Major
      Found in lib/createResource.js - About 3 hrs to fix

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

          render() {
            return (
                <div>
                  {
                    React.appType === 'h5'?
        Severity: Major
        Found in packages/render/miniapp/apiForH5/Components/Toast.js - About 3 hrs to fix

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

          
          const emptyFunction = function(){}
          
          describe('ReactDOMTextarea', () => {
            let React;
          Severity: Minor
          Found in packages/render/dom/__tests__/ReactDOMTextarea-test.js - About 3 hrs to fix

            Function commitEffects has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

            export function commitEffects(fiber) {
                let instance = fiber.stateNode || emptyObject;
                let amount = fiber.effectTag;
                let updater = instance.updater || fakeObject;
                for (let i = 0; i < effectLength; i++) {
            Severity: Minor
            Found in packages/fiber/commitWork.js - About 3 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 fireDuplex has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

            export function fireDuplex() {
                var radioMap = {};
                if (duplexNodes.length) {
                    do {
                        let dom = duplexNodes.shift();
            Severity: Minor
            Found in packages/render/dom/duplex.js - About 3 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 createSubscription has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function createSubscription(config) {
                const { getCurrentValue, subscribe } = config;
                notFn(getCurrentValue, 'Subscription must specify a getCurrentValue function')
                notFn(subscribe, 'Subscription must specify a subscribe function')
            
            
            Severity: Major
            Found in lib/createSubscription.js - About 2 hrs to fix

              Function exports has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function(initModules) {
                let ReactDOM;
                let ReactDOMServer;
              
                function resetModules() {

              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 createHistory has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              function createHistory(source) {
                  let listeners = [];
              
                  let transitioning = false;
                  let resolveTransition = () => {};
              Severity: Minor
              Found in packages/router/history.js - About 2 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 matcher has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function matcher(callback, expectedMessages) {
                  if (__DEV__) {
                    // Warn about incorrect usage of matcher.
                    if (typeof expectedMessages === 'string') {
                      expectedMessages = [expectedMessages];
              Severity: Major
              Found in scripts/jest/matchers/toWarnDev.js - About 2 hrs to fix

                Function traverseAllChildren has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function traverseAllChildren(
                    children,
                    nameSoFar,
                    callback,
                    bookKeeping
                Severity: Major
                Found in packages/core/createElement.js - About 2 hrs to fix

                  Function createContext has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function createContext(defaultValue, calculateChangedBits) {
                      if (calculateChangedBits == void 0) {
                          calculateChangedBits = null;
                      }
                      var instance = {
                  Severity: Major
                  Found in packages/core/createContext.js - About 2 hrs to fix

                    Function createOpenTagMarkup has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function createOpenTagMarkup(
                        tagVerbatim,
                        tagLowercase,
                        props,
                        namespace,
                    Severity: Minor
                    Found in packages/render/server/html.js - About 2 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 diffProps has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function diffProps(dom, lastProps, nextProps, fiber) {
                        let isSVG = fiber.namespaceURI === NAMESPACE.svg;
                        let tag = fiber.type;
                        let continueProps = skipProps;
                        if (!isSVG && rform.test(fiber.type)) {
                    Severity: Minor
                    Found in packages/render/dom/props.js - About 2 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 createContext has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function createContext(defaultValue, calculateChangedBits) {
                        if (calculateChangedBits == void 0) {
                            calculateChangedBits = null;
                        }
                        var instance = {
                    Severity: Minor
                    Found in packages/core/createContext.js - About 2 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 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function diffChildren(parentFiber, children) {
                        let oldFibers = parentFiber.children; // 旧的
                        if (oldFibers) {
                            parentFiber.oldChildren = oldFibers;
                        } else {
                    Severity: Major
                    Found in packages/fiber/beginWork.js - About 2 hrs to fix

                      File scheduleWork.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { reconcileDFS } from './beginWork';
                      import { commitDFS } from './commitWork';
                      import { Renderer } from 'react-core/createRenderer';
                      import {
                          effects,
                      Severity: Minor
                      Found in packages/fiber/scheduleWork.js - About 2 hrs to fix

                        File canvas.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        const CanvasContext = function(canvasId) {
                            const canvasDom = document.getElementById(canvasId);
                            if (!canvasDom || !canvasDom.getContext) {
                                console.error('canvasId错误,或浏览器不支持canvas');
                            } else {
                        Severity: Minor
                        Found in packages/render/miniapp/apiForH5/canvas.js - About 2 hrs to fix

                          File props.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { NAMESPACE } from "./browser";
                          import { patchStyle } from "./style";
                          import { eventAction, rform } from "./event";
                          import { typeNumber, emptyObject, noop } from "react-core/util";
                          //import { duplexAction } from './duplex';
                          Severity: Minor
                          Found in packages/render/dom/props.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language