RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function resolve has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function resolve(to, base) {
    // /foo/bar, /baz/qux => /foo/bar
    if (startsWith(to, "/")) {
        return to;
    }
Severity: Minor
Found in packages/router/utils.js - About 55 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 deeply nested control flow statements.
Open

                        if (partialState != null) {
                            if (dontMutate) {
                                dontMutate = false;
                                nextState = Object.assign({}, nextState, partialState);
                            } else {
Severity: Major
Found in packages/render/server/Renderer.js - About 45 mins to fix

    Function boundingClientRect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    SelectorQuery.prototype.boundingClientRect = function() {
      if (!this.__consumed) {
        if (!this.__node) {
          this.__missions.push(null);
        } else {
    Severity: Minor
    Found in packages/render/miniapp/apiForH5/selectorQuery.js - About 45 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 scrollOffset has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    SelectorQuery.prototype.scrollOffset = function() {
      if (!this.__consumed) {
        if (!this.__node) {
          this.__missions.push(null);
        } else {
    Severity: Minor
    Found in packages/render/miniapp/apiForH5/selectorQuery.js - About 45 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 setModernOffsets has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function setModernOffsets(node, offsets) {
        if (!window.getSelection) {
            return;
        }
    
    
    Severity: Minor
    Found in scripts/build/ReactSelection.js - About 45 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 deeply nested control flow statements.
    Open

                        if (boundary.return.child == boundary) {
                            boundary.return.child = f;
                        }
    Severity: Major
    Found in packages/fiber/ErrorBoundary.js - About 45 mins to fix

      Function batchedUpdates has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      Renderer.batchedUpdates = function(callback, event) {
          let keepbook = isBatching;
          isBatching = true;
          try {
              event && Renderer.fireMiddlewares(true);
      Severity: Minor
      Found in packages/fiber/scheduleWork.js - About 45 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 arc has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          x,
          y,
          r,
          sAngle,
          eAngle,
      Severity: Minor
      Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

        Function workLoop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function workLoop(deadline) {
            let fiber = macrotasks.shift(),
                info;
            if (fiber) {
                if (fiber.type === Unbatch) {
        Severity: Minor
        Found in packages/fiber/scheduleWork.js - About 45 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 createEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function createEvent(e, target, type) {
            var event = {};
            for (var i in e) {
                if (i.indexOf('_') !== 0) {
                    event[i] = e[i];
        Severity: Minor
        Found in packages/render/miniapp/eventSystem.quick.js - About 45 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 insertElement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            insertElement(fiber) {
                let dom = fiber.stateNode,
                    parentNode = fiber.parent,
                    forwardFiber = fiber.forwardFiber,
                    before = forwardFiber ? forwardFiber.stateNode : null,
        Severity: Minor
        Found in packages/render/noop/NoopRenderer.js - About 45 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 bezierCurveTo has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        CanvasContext.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
        Severity: Minor
        Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

          Function setTransform has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              scaleX,
              skewX,
              skewY,
              scaleY,
              translateX,
          Severity: Minor
          Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

            Function textarea has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                textarea(props, inst) {
                    let initialValue = props.value;
                    if (initialValue == null) {
                        let defaultValue = props.defaultValue;
                        // TODO (yungsters): Remove support for children content in <textarea>.
            Severity: Minor
            Found in packages/render/server/duplex.js - About 45 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 deeply nested control flow statements.
            Open

                                if (
                                    hook == "componentWillUnmount" ||
                                    hook == "componentDidUpdate"
                                ) {
                                    boundary.effectTag = CAPTURE;
            Severity: Major
            Found in packages/fiber/ErrorBoundary.js - About 45 mins to fix

              Function useCallbackImpl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              export function useCallbackImpl(create, deps, isMemo, isEffect) {//ok
                  let fiber = getCurrentFiber();
                  let key = getCurrentKey();
                  let updateQueue = fiber.updateQueue;
              
              
              Severity: Minor
              Found in packages/fiber/dispatcher.js - About 45 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 createOpenTagMarkup has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  tagVerbatim,
                  tagLowercase,
                  props,
                  namespace,
                  makeStaticMarkup,
              Severity: Minor
              Found in packages/render/server/html.js - About 45 mins to fix

                Function initStorageSync has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                export function initStorageSync (storageCache) {
                    if (typeof ReactQuick !== 'object') {
                        return;
                    }
                  var apis = ReactQuick.api; // eslint-disable-line
                Severity: Minor
                Found in packages/render/miniapp/apiForQuick/storage.js - About 45 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 coolieMethod has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function coolieMethod(input, success, fail, complete, method, msg) {
                Severity: Minor
                Found in packages/render/miniapp/apiForH5/clipboard.js - About 45 mins to fix

                  Function transform has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      scaleX,
                      skewX,
                      skewY,
                      scaleY,
                      translateX,
                  Severity: Minor
                  Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language