RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

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

        render() {
            let {
                location,
                navigate,
                basepath,
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 createElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function createElement(type, config, ...children) {
    let props = {},
        tag = 5,
        key = null,
        ref = null,
Severity: Minor
Found in packages/core/createElement.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 traverseCallback has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function traverseCallback(bookKeeping, child, childKey) {
    const { result, keyPrefix, func, context } = bookKeeping;

    let mappedChild = func.call(context, child, bookKeeping.count++);
    if (!result) {
Severity: Minor
Found in packages/core/Children.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 resolve has 27 lines of code (exceeds 25 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 1 hr to fix

    Function applyMiddleware has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function applyMiddleware() {
      for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
        middlewares[_key] = arguments[_key];
      }
    
    
    Severity: Minor
    Found in lib/ReduxIE.js - About 1 hr to fix

      Function consoleSpy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            const consoleSpy = message => {
              const normalizedMessage = normalizeCodeLocInfo(message);
      
              for (let index = 0; index < expectedMessages.length; index++) {
                const expectedMessage = expectedMessages[index];
      Severity: Minor
      Found in scripts/jest/matchers/toWarnDev.js - About 1 hr to fix

        Function ReactElement has 26 lines of code (exceeds 25 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 1 hr to fix

          Function flattenHooks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function flattenHooks(key, hooks) {
              var hookType = __type.call(hooks[0]).slice(8, -1);
              if (hookType === "Object") {
                  var ret = {};
                  for (var i = 0; i < hooks.length; i++) {
          Severity: Minor
          Found in lib/createClass.js - About 1 hr to fix

            Function navigate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    navigate(to, { state, replace = false } = {}) {
                        state = {
                            ...state,
                            key: Date.now() + ''
                        };
            Severity: Minor
            Found in packages/router/history.js - About 1 hr to fix

              Function touchtap has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  eventPropHooks.touchtap = function(event) {
                      var type = event.nativeEvent.type;
                      if (!isStartish(type) && !isEndish(type)) {
                          return false;
                      }
              Severity: Minor
              Found in lib/injectTapEventPlugin.js - About 1 hr to fix

                Function flattenHooks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function flattenHooks(key, hooks) {
                    let hookType = __type.call(hooks[0]).slice(8, -1);
                    if (hookType === "Object") {
                        // Merge objects
                        let ret = {};
                Severity: Minor
                Found in packages/core/createClass.js - About 1 hr to fix

                  Function combination has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    return function combination() {
                      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
                      var action = arguments[1];
                  
                      if (shapeAssertionError) {
                  Severity: Minor
                  Found in lib/ReduxIE.js - About 1 hr to fix

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

                    export function dispatchEvent(e) {
                        const instance = this.reactInstance;
                        if (!instance || !instance.$$eventCached) {
                            return;
                        }
                    Severity: Minor
                    Found in packages/render/miniapp/eventSystem.quick.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

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

                        renderDOM(element, context, parentNamespace) {
                            const tag = element.type.toLowerCase();
                    
                            let namespace = parentNamespace;
                            if (parentNamespace === Namespaces.html) {
                    Severity: Minor
                    Found in packages/render/server/Renderer.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

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

                    function getMaskedContext(instance, contextTypes, unmaskedContext) {
                        var noContext = !contextTypes;
                        if (instance){
                            if (noContext){
                                return instance.context;
                    Severity: Minor
                    Found in packages/fiber/beginWork.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

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

                    function safeInvokeHooks(upateQueue, create, destory) {
                        var uneffects = upateQueue[destory],
                            effects = upateQueue[create], fn;
                        if (!uneffects){
                            return;
                    Severity: Minor
                    Found in packages/fiber/commitWork.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

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

                        property: function(dom, name, val) {
                            // 尝试直接赋值,部分情况下会失败,如给 input 元素的 size 属性赋值 0 或字符串
                            // 这时如果用 setAttribute 则会静默失败
                            try {
                                if (!val && val !== 0) {
                    Severity: Minor
                    Found in packages/render/dom/props.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

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

                    function collectVDOM(vdom, array) {
                        if (vdom.tag == 5) {
                            var children = [];
                            var element = {
                                type: vdom.type,
                    Severity: Minor
                    Found in lib/createReactNoop.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

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

                    eventPropHooks.wheel = function(event) {
                        event.deltaX =
                            'deltaX' in event
                                ? event.deltaX
                                : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
                    Severity: Minor
                    Found in packages/render/dom/event.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

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

                    function getPropAction(dom, name, isSVG) {
                        if (isSVG && name === "className") {
                            return "svgClass";
                        }
                        if (isSpecialAttr[name]) {
                    Severity: Minor
                    Found in packages/render/dom/props.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

                    Severity
                    Category
                    Status
                    Source
                    Language