RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function read has a Cognitive Complexity of 14 (exceeds 5 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

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 disposeFiber has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function disposeFiber(fiber, force) {
    let { stateNode, effectTag } = fiber;
    if (!stateNode) {
        return;
    }
Severity: Minor
Found in packages/fiber/commitWork.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 setInsertPoints has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function setInsertPoints(children) {
    for (let i in children) {
        let child = children[i];
        if (child.disposed) {
            continue;
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 render has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
        <div className='loading2019'>
          <div className='icon'>
            <img style={{width: '1.5rem', height: '1.5rem'}} src='http://s.qunarzz.com/dev_test_2/loading4.gif'/>
Severity: Minor
Found in packages/render/miniapp/apiForH5/Components/Loading.js - About 1 hr to fix

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

      Function getModernOffsets has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function getModernOffsets(node) {
              var selection = window.getSelection && window.getSelection();
      
              if (!selection || selection.rangeCount === 0) {
                  return null;
      Severity: Minor
      Found in lib/ReactInputSelection.js - About 1 hr to fix

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

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

            Function applybeforeUpdateHooks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            function applybeforeUpdateHooks(
                fiber,
                instance,
                newProps,
                newContext,
            Severity: Minor
            Found in packages/fiber/beginWork.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 safeClone has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            function safeClone (originVal) {
                let temp = originVal instanceof Array ? [] : {};
                for (let item in originVal) {
                    if (hasOwnProperty.call(originVal, item)) {
                        let value = originVal[item];
            Severity: Minor
            Found in packages/render/miniapp/utils.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 traverseAllChildren has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            export function traverseAllChildren(
                children,
                nameSoFar,
                callback,
                bookKeeping
            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 update has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    update(node, props) {
                        if (props.checked != null) {
                            syncValue(node, "checked", !!props.checked);
                        }
                        const isActive = node === node.ownerDocument.activeElement;
            Severity: Minor
            Found in packages/render/dom/duplex.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 makeProps has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            function makeProps(type, config, props, children, len) {
                // Remaining properties override existing props
                let defaultProps, propName;
                for (propName in config) {
                    if (
            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 diffProps has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function diffProps(dom, lastProps, nextProps, fiber) {
                let isSVG = fiber.namespaceURI === NAMESPACE.svg;
                let tag = fiber.type;
                let continueProps = skipProps;
                if (!isSVG && rform.test(fiber.type)) {
            Severity: Minor
            Found in packages/render/dom/props.js - About 1 hr to fix

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

                  constructor({
                      url = '',
                      header = '',
                      formData = {},
                      success = () => {},
              Severity: Minor
              Found in packages/render/miniapp/apiForH5/request.js - About 1 hr to fix

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

                  Function escapeHtml has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function escapeHtml(string) {
                      var str = '' + string;
                      var match = matchHtmlRegExp.exec(str);
                  
                      if (!match) {
                  Severity: Minor
                  Found in packages/render/server/encode.js - About 1 hr to fix

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

                    export function disposeFibers(fiber) {
                        let list = [fiber.oldChildren, fiber.children];
                        for (let i = 0; i < 2; i++) {
                            let c = list[i];
                            if (c) {
                    Severity: Minor
                    Found in packages/fiber/commitWork.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 refreshComponent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function refreshComponent (instances, wx, uuid) {
                        if(wx.disposed){
                            return 
                        }
                        let pagePath = Object(_getApp()).$$pagePath;
                    Severity: Minor
                    Found in packages/render/miniapp/utils.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 dispatchEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function dispatchEvent(e) {
                        let eventType = toLowerCase(e.type);
                        if (eventType == "message") {
                            //处理支付宝web-view组件的dataset为空的BUG
                            if (webview.instance && webview.cb) {
                    Severity: Minor
                    Found in packages/render/miniapp/eventSystem.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

                    Severity
                    Category
                    Status
                    Source
                    Language