RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

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

'use strict';

let React;
let ReactDOM;

Severity: Minor
Found in packages/render/dom/__tests__/ReactCompositeComponentState-test.js - About 4 hrs to fix

    Function render has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        render(child, context, parentNamespace) {
            var t  = typeNumber(child)
            if (t === 3 || t === 4) {
                const text = '' + child;
                if (text === '') {
    Severity: Minor
    Found in packages/render/server/Renderer.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 more has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    export var more = function(api) {
        return {
            // 交互
            showModal: function _(a) {
                a.cancelButtonText = a.cancelText;
    Severity: Minor
    Found in packages/render/miniapp/apiForAlipay/index.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

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

    
    // TODO: All these warnings should become static errors using Flow instead
    // of dynamic errors when using JSX with Flow.
    let React;
    let ReactDOM;
    Severity: Minor
    Found in packages/core/__tests__/ReactJSXElementValidator-test.js - About 4 hrs to fix

      Function updateOptions has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      export function updateOptions(node, multiple, propValue, setDefaultSelected) {
          var options = node.options;
      
          if (multiple) {
              var selectedValues = propValue;
      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

      File ReactSelection.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { options, Fragment } from "../src/util";
      import { Children } from "../src/Children";
      import * as eventSystem from "../src/event";
      import { PropTypes } from "../src/PropTypes";
      import { Component } from "../src/Component";
      Severity: Minor
      Found in scripts/build/ReactSelection.js - About 3 hrs to fix

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

        // This test doesn't really have a good home yet. I'm leaving it here since this
        // behavior belongs to the old propTypes system yet is currently implemented
        // in the core ReactCompositeComponent. It should technically live in core's
        // test suite but I'll leave it here to indicate that this is an issue that
        // needs to be fixed.
        Severity: Minor
        Found in packages/core/__tests__/ReactContextValidator-test.js - About 3 hrs to fix

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

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

            Function updateClassComponent has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            export function updateClassComponent(fiber, info) {
                let { type, stateNode: instance, props } = fiber;
                let { contextStack, containerStack } = info;
                let getContext = type.contextType;
                let unmaskedContext = contextStack[0];
            Severity: Minor
            Found in packages/fiber/beginWork.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 createElement has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            export function createElement(vnode) {
                let p = vnode.return;
                let { type, props, ns } = vnode;
                switch (type) {
                    case '#text':
            Severity: Minor
            Found in packages/render/dom/DOMRenderer.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 processChild has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function processChild(element, Component) {
                    let publicContext = processContext(Component, context);
            
                    let queue = [];
                    let replace = false;
            Severity: Major
            Found in packages/render/server/Renderer.js - About 3 hrs to fix

              File devtools.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              (function(global, factory) {
                  typeof exports === "object" && typeof module !== "undefined"
                      ? (module.exports = factory())
                      : typeof define === "function" && define.amd
                          ? define(factory)
              Severity: Minor
              Found in lib/devtools.js - About 3 hrs to fix

                File ReactMultiChild-test.js has 317 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
                Severity: Minor
                Found in packages/render/dom/__tests__/ReactMultiChild-test.js - About 3 hrs to fix

                  Function createSubscription has a Cognitive Complexity of 25 (exceeds 5 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: Minor
                  Found in lib/createSubscription.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 updateClassComponent has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function updateClassComponent(fiber, info) {
                      let { type, stateNode: instance, props } = fiber;
                      let { contextStack, containerStack } = info;
                      let getContext = type.contextType;
                      let unmaskedContext = contextStack[0];
                  Severity: Major
                  Found in packages/fiber/beginWork.js - About 3 hrs to fix

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

                    'use strict';
                    
                    let PropTypes;
                    let React;
                    let ReactDOM;
                    Severity: Minor
                    Found in packages/core/__tests__/ReactElementClone-test.js - About 3 hrs to fix

                      File ReactInputSelection.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      (function umd(root, factory) {
                          if (typeof exports === "object" && typeof module === "object") {
                              module.exports = factory(require("react"));
                          } else if (typeof define === "function" && define.amd) {
                              define(["react"], factory);
                      Severity: Minor
                      Found in lib/ReactInputSelection.js - About 3 hrs to fix

                        Function registerPage has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          File duplex.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { typeNumber, emptyObject } from "react-core/util";
                          
                          function getSafeValue(value) {
                              switch (typeNumber(value)) {
                                  case 2:
                          Severity: Minor
                          Found in packages/render/dom/duplex.js - About 3 hrs to fix

                            Function previewImage has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function previewImage(options = {}) {
                                return new Promise(function(resolve, reject) {
                                    const {
                                        urls,
                                        current,
                            Severity: Major
                            Found in packages/render/miniapp/apiForH5/previewImage.js - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language