RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function updateHostComponent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function updateHostComponent(fiber, info) {
    const { props, tag, alternate: prev } = fiber;

    if (!fiber.stateNode) {
        fiber.parent = info.containerStack[0];
Severity: Minor
Found in packages/fiber/beginWork.js - About 35 mins 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 createShortcut has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function createShortcut() {
    
    shortcut.hasInstalled({
        success: function success(ok) {
            if (ok) {
Severity: Minor
Found in packages/render/miniapp/apiForQuick/shortcut.js - About 35 mins 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 getNonChildrenInnerMarkup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getNonChildrenInnerMarkup(props) {
    const innerHTML = props.dangerouslySetInnerHTML;
    if (innerHTML != null) {
        if (innerHTML.__html != null) {
            return innerHTML.__html;
Severity: Minor
Found in packages/render/server/Renderer.js - About 35 mins 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 decodeErrorMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        const decodeErrorMessage = function(message) {
            if (!message) {
                return message;
            }
            const re = /error-decoder.html\?invariant=(\d+)([^\s]*)/;
Severity: Minor
Found in scripts/jest/setupTests.js - About 35 mins 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 registerApp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function registerApp(demo, containProvider) {
    var app = {};
    // 将App构造函数存到全局中供mobx使用
    if (containProvider) {
        demo.globalData._GlobalApp = demo.constructor;
Severity: Minor
Found in packages/render/miniapp/registerApp.quick.js - About 35 mins 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 switchTab has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    switchTab: function({url, success, fail, complete}) {
        var [path, query] = getQuery(url);
        var config = React.__app.constructor.config;
        if (config && config.tabBar && config.tabBar.list) {
            if (config.tabBar.list.length < 2 || config.tabBar.list.length > 5) {
Severity: Minor
Found in packages/render/miniapp/index.h5.js - About 35 mins 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 getModernOffsets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getModernOffsets(node) {
    var selection = window.getSelection && window.getSelection();

    if (!selection || selection.rangeCount === 0) {
        return null;
Severity: Minor
Found in scripts/build/ReactSelection.js - About 35 mins 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 mount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        mount(node, props, state) {
            if (
                props.hasOwnProperty("value") ||
                props.hasOwnProperty("defaultValue")
            ) {
Severity: Minor
Found in packages/render/dom/duplex.js - About 35 mins 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 ReactElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function ReactElement(type, tag, props, key, ref, owner) {
    var ret = {
        type,
        tag,
        props
Severity: Minor
Found in packages/core/createElement.js - About 35 mins 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 svgAttr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    svgAttr: function(dom, name, val) {
        // http://www.w3school.com.cn/xlink/xlink_reference.asp
        // https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html#notable-enh
        // a ncements xlinkActuate, xlinkArcrole, xlinkHref, xlinkRole, xlinkShow,
        // xlinkTitle, xlinkType eslint-disable-next-line
Severity: Minor
Found in packages/render/dom/props.js - About 35 mins 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 rankRoute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function rankRoute(route, index) {
    let score = route.default
        ? 0
        : segmentize(route.path).reduce((score, segment) => {
            score += SEGMENT_POINTS;
Severity: Minor
Found in packages/router/utils.js - About 35 mins 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 getLocation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getLocation(source) {
    const location = {
        getPath() {
            return modeObject.value === 'hash' ? this.hash.slice(1) : this.pathname;
        },
Severity: Minor
Found in packages/router/history.js - About 35 mins 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 getLowestCommonAncestor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getLowestCommonAncestor(instA, instB) {
    let depthA = 0;
    for (let tempA = instA; tempA; tempA = tempA.parentNode) {
        depthA++;
    }
Severity: Minor
Found in packages/render/dom/event.js - About 35 mins 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

Avoid too many return statements within this function.
Open

                return '';
Severity: Major
Found in packages/render/server/Renderer.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                            return '';
    Severity: Major
    Found in packages/render/server/Renderer.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                                  return '';
      Severity: Major
      Found in packages/render/server/Renderer.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return dom;
        Severity: Major
        Found in packages/fiber/findHostInstance.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                      return '';
          Severity: Major
          Found in packages/render/server/Renderer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                        return '';
            Severity: Major
            Found in packages/render/server/Renderer.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return null;
              Severity: Major
              Found in packages/fiber/findHostInstance.js - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language