RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function commitEffects has 65 lines of code (exceeds 25 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: Major
Found in packages/fiber/commitWork.js - About 2 hrs to fix

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

      render() {
        return (
            <div className='modal2019'>
              <div className="top">
                {this.props.title}
    Severity: Major
    Found in packages/render/miniapp/apiForH5/Components/Modal.js - About 2 hrs to fix

      Function compile has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function compile(content, contentFilename) {
        let output = null;
        const compilerHost = {
          getSourceFile(filename, languageVersion) {
            let source;
      Severity: Major
      Found in scripts/jest/typescript/preprocessor.js - About 2 hrs to fix

        Function createClass has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function createClass(spec) {
            if (!isFn(spec.render)) {
                throw "createClass(...): Class specification must implement a `render` method.";
            }
            //创建一个构造器,有四个参数
        Severity: Minor
        Found in packages/core/createClass.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 pick has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        function pick(routes, uri) {
            let match;
            let default_;
        
            let uriPathname = uri.split("?").shift();
        Severity: Minor
        Found in packages/router/utils.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 registerPage has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function registerPage(PageClass, path, testObject) {
            PageClass.container = {
                type: "page",
                props: {},
                children: [],
        Severity: Major
        Found in packages/render/miniapp/registerPage.wx.js - About 2 hrs to fix

          Function pick has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function pick(routes, uri) {
              let match;
              let default_;
          
              let uriPathname = uri.split("?").shift();
          Severity: Major
          Found in packages/router/utils.js - About 2 hrs to fix

            Function str has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function str(key, holder) {
                    var i,
                        v,
                        len,
                        partial,
            Severity: Major
            Found in lib/polyfill.js - About 2 hrs to fix

              Function updateAttribute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  updateAttribute(fiber) {
                      let { props, lastProps } = fiber;
                      let beaconId = props['data-beacon-uid'];
                      let instance = fiber._owner; //clazz[instanceId];
                      if (instance && beaconId) {
              Severity: Minor
              Found in packages/render/miniapp/render.all.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

              File polyfill.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              (function (global) {
                  var oProto = Object.prototype;
                  var toString = oProto.toString;
                  var hasOwnProperty = oProto.hasOwnProperty;
                  function needFix(fn) {
              Severity: Minor
              Found in lib/polyfill.js - About 2 hrs to fix

                File createElement.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                    typeNumber,
                    toWarnDev,
                    hasSymbol,
                    REACT_ELEMENT_TYPE,
                Severity: Minor
                Found in packages/core/createElement.js - About 2 hrs to fix

                  Function reconcileDFS has 57 lines of code (exceeds 25 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: Major
                  Found in packages/fiber/beginWork.js - About 2 hrs to fix

                    Function findHostInstance has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function findHostInstance(fiber) {
                        if (!fiber) {
                            return null;
                        } else if (fiber.nodeType) {
                            return fiber;
                    Severity: Minor
                    Found in packages/fiber/findHostInstance.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 compile has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function compile(content, contentFilename) {
                      let output = null;
                      const compilerHost = {
                        getSourceFile(filename, languageVersion) {
                          let source;
                    Severity: Minor
                    Found in scripts/jest/typescript/preprocessor.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 registerPage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function registerPage(PageClass, path) {
                        PageClass.reactInstances = []
                        PageClass.container = {
                            type: "page",
                            props: {},
                    Severity: Minor
                    Found in packages/render/miniapp/registerPage.quick.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

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

                    'use strict';
                    
                    const React = require('react');
                    const PropTypes = require('prop-types');
                    const ReactDOM = require('react-dom');
                    Severity: Minor
                    Found in packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js - About 2 hrs to fix

                      Function findCatchComponent has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function findCatchComponent(fiber, names, hook) {
                          let instance,
                              name,
                              topFiber = fiber,
                              retry,
                      Severity: Major
                      Found in packages/fiber/ErrorBoundary.js - About 2 hrs to fix

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

                        export function createElement(vnode) {
                            let p = vnode.return;
                            let { type, props, ns } = vnode;
                            switch (type) {
                                case '#text':
                        Severity: Major
                        Found in packages/render/dom/DOMRenderer.js - About 2 hrs to fix

                          Function createHistory has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createHistory(source) {
                              let listeners = [];
                          
                              let transitioning = false;
                              let resolveTransition = () => {};
                          Severity: Major
                          Found in packages/router/history.js - About 2 hrs to fix

                            Function registerPageHook has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function registerPageHook(appHooks, pageHook, app, instance, args  ){
                                for(let i = 0; i < 2; i ++){
                                    let method = i ? appHooks[pageHook]: pageHook;
                                    let host = i ?  app: instance;
                                    if( host && host[method] && isFn(host[method])){
                            Severity: Minor
                            Found in packages/render/miniapp/registerPageHook.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

                            Severity
                            Category
                            Status
                            Source
                            Language