RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function getSVGAttributeName has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function getSVGAttributeName(name) {
    if (svgCache[name]) {
        return svgCache[name];
    }
    const match = name.match(rhump);
Severity: Minor
Found in packages/render/dom/props.js - About 1 hr 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 blurFocus has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function blurFocus(e) {
    let dom = getTarget(e);
    let type = focusMap[e.type];
    if (Renderer.inserting) {
        if (type === 'blur') {
Severity: Minor
Found in packages/render/dom/event.js - About 1 hr 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 option has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    option(props, inst) {
        let selected = null;
        const selectValue = inst.currentSelectValue;
        const optionChildren = flattenOptionChildren(props.children);
        if (selectValue != null) {
Severity: Minor
Found in packages/render/server/duplex.js - About 1 hr to fix

    Function createContainer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function createContainer(root, onlyGet, validate) {
        validate = validate || validateTag;
        if (!validate(root)) {
            throw `container is not a element`; // eslint-disable-line
        }
    Severity: Minor
    Found in packages/fiber/scheduleWork.js - About 1 hr to fix

      Function deepForceUpdate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function deepForceUpdate(
              instance,
              shouldUpdate,
              onUpdate
          ) {
      Severity: Minor
      Found in lib/deepForceUpdate.js - About 1 hr to fix

        Function createMemorySource has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createMemorySource(initialPathname = '/') {
            let index = 0;
            let states = [];
            let stack = [
                {
        Severity: Minor
        Found in packages/router/history.js - About 1 hr to fix

          Function createOpenTagMarkup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function createOpenTagMarkup(
              tagVerbatim,
              tagLowercase,
              props,
              namespace,
          Severity: Minor
          Found in packages/render/server/html.js - About 1 hr to fix

            Function createRoute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            let createRoute = basepath => element => {
                invariant(
                    element.props.path || element.props.default || element.type === Redirect,
                    `<Router>: Children of <Router> must have a "path" or "default" prop, or be a "<Redirect>". 
                     None found on element type "${element.type}"`
            Severity: Minor
            Found in packages/router/index.jsx - About 1 hr to fix

              Function read has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  read(bytes) {
                      if (this.exhausted) {
                          return null;
                      }
              
              
              Severity: Minor
              Found in packages/render/server/Renderer.js - About 1 hr to fix

                Function browserShare has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    browserShare({ title, path, imageUrl, type = "default", desc }) {
                        var nativeShare = new NativeShare();
                        nativeShare.setShareData({
                            icon: imageUrl,
                            link: path,
                Severity: Minor
                Found in packages/render/miniapp/apiForH5/Components/Share.js - About 1 hr to fix

                  Function pushChildQueue has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function pushChildQueue(fiber, queue) {
                      //判定当前节点是否包含已进队的节点
                      let maps = {};
                      for (let i = queue.length, el; (el = queue[--i]); ) {
                          //移除列队中比它小的组件
                  Severity: Minor
                  Found in packages/fiber/scheduleWork.js - About 1 hr to fix

                    Function forward has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function forward(fiber) {
                        var found;
                        while (fiber.forward) {
                            fiber = fiber.forward;
                            //如果这已经被销毁或者是传送门
                    Severity: Minor
                    Found in packages/fiber/insertPoint.js - About 1 hr 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 pushChildQueue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function pushChildQueue(fiber, queue) {
                        //判定当前节点是否包含已进队的节点
                        let maps = {};
                        for (let i = queue.length, el; (el = queue[--i]); ) {
                            //移除列队中比它小的组件
                    Severity: Minor
                    Found in packages/fiber/scheduleWork.js - About 1 hr 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 onBeforeRender has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        onBeforeRender(fiber) {
                            let type = fiber.type;
                            let instance = fiber.stateNode;
                            let app = _getApp();
                            if (type.reactInstances) {
                    Severity: Minor
                    Found in packages/render/miniapp/render.all.js - About 1 hr 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 createRoute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    let createRoute = basepath => element => {
                        invariant(
                            element.props.path || element.props.default || element.type === Redirect,
                            `<Router>: Children of <Router> must have a "path" or "default" prop, or be a "<Redirect>". 
                             None found on element type "${element.type}"`
                    Severity: Minor
                    Found in packages/router/index.jsx - About 1 hr 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 collectMixins has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function collectMixins(mixins) {
                        let keyed = {};
                    
                        for (let i = 0; i < mixins.length; i++) {
                            let mixin = mixins[i];
                    Severity: Minor
                    Found in packages/core/createClass.js - About 1 hr 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 pushError has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function pushError(fiber, hook, error) {
                        let names = [];
                        let boundary = findCatchComponent(fiber, names, hook);
                        let stack = describeError(names, hook);
                        if (boundary) {
                    Severity: Minor
                    Found in packages/fiber/ErrorBoundary.js - About 1 hr to fix

                      Function registerComponent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function registerComponent(type, name) {
                          type.isMPComponent = true;
                          registeredComponents[name] = type;
                          type.reactInstances = [];
                          let config = {
                      Severity: Minor
                      Found in packages/render/miniapp/registerComponent.wx.js - About 1 hr to fix

                        Function registerComponent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function registerComponent (type, name) {
                            type.isMPComponent = true;
                            registeredComponents[name] = type;
                            let reactInstances = type.reactInstances = [];
                            let hasInit = false;
                        Severity: Minor
                        Found in packages/render/miniapp/registerComponent.ali.js - About 1 hr to fix

                          Function constructor has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              constructor({
                                  url = '',
                                  method = 'get',
                                  data = {},
                                  header = {},
                          Severity: Minor
                          Found in packages/render/miniapp/apiForH5/request.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language