RubyLouvre/anu

View on GitHub

Showing 286 of 880 total issues

Function patchStyle has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export function patchStyle(dom, lastStyle, nextStyle) {
    if (lastStyle === nextStyle) {
        return;
    }

Severity: Minor
Found in packages/render/dom/style.js - About 2 hrs 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 getImageInfo has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getImageInfo(options = {}) {
    const img = new Image();
    const {
        src,
        success = () => {},
Severity: Major
Found in packages/render/miniapp/apiForH5/images.js - About 2 hrs to fix

    Function combineReducers has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function combineReducers(reducers) {
      var reducerKeys = Object.keys(reducers);
      var finalReducers = {};
      for (var i = 0; i < reducerKeys.length; i++) {
        var key = reducerKeys[i];
    Severity: Major
    Found in lib/ReduxIE.js - About 2 hrs to fix

      File refs-test.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      let React = require('react');
      let ReactTestUtils = require('test-utils');
      
      
      Severity: Minor
      Found in packages/render/dom/__tests__/refs-test.js - About 2 hrs to fix

        Function createInstance has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function createInstance(fiber, context) {
            let updater = {
                mountOrder: Renderer.mountOrder++,
                enqueueSetState: returnFalse,
                isMounted: isMounted
        Severity: Minor
        Found in packages/fiber/createInstance.js - About 2 hrs to fix

          Function commitDFSImpl has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function commitDFSImpl(fiber) {
              let topFiber = fiber;
              outerLoop: while (true) {
                  //逐步向下执行所有移除与插入操作
                  if (fiber.effects && fiber.effects.length) {
          Severity: Minor
          Found in packages/fiber/commitWork.js - About 1 hr to fix

            Function more has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export var more = function(api) {
                return {
                    // 界面交互
                    showActionSheet: function _(a) {
                        var success = a.success,
            Severity: Minor
            Found in packages/render/miniapp/apiForBaidu/index.js - About 1 hr to fix

              Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  render() {
                      return (
                              <div className='actionSheet2019'>
                                  {this.props.itemList.map((item, index) => {
                                      return (
              Severity: Minor
              Found in packages/render/miniapp/apiForH5/Components/ActionSheet.js - About 1 hr to fix

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

                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 a Cognitive Complexity of 15 (exceeds 5 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

                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 onLoad has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function onLoad(PageClass, path, query, fire) {
                    var app = _getApp();
                    // 快应用拿不到全局数据,从globalData中取
                    let GlobalApp = _getGlobalApp(app);
                    app.$$pageIsReady = false; //pageIsReadyg与delayMounts是专门给快应用
                Severity: Minor
                Found in packages/render/miniapp/registerPage.all.js - About 1 hr to fix

                  Function applybeforeUpdateHooks has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function applybeforeUpdateHooks(
                      fiber,
                      instance,
                      newProps,
                      newContext,
                  Severity: Minor
                  Found in packages/fiber/beginWork.js - About 1 hr to fix

                    Function dispatchEvent has 47 lines of code (exceeds 25 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

                      Function createClass has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function createClass(spec) {
                          if (!isFn(spec.render)) {
                              throw "createClass(...): Class specification must implement a `render` method.";
                          }
                          //创建一个构造器,有四个参数
                      Severity: Minor
                      Found in packages/core/createClass.js - About 1 hr to fix

                        Function render has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                render() {
                                    let {
                                        location,
                                        navigate,
                                        basepath,
                        Severity: Minor
                        Found in packages/router/index.jsx - About 1 hr to fix

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

                            Function render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                render() {
                                    return (
                                        <div className="share2019">
                                            {shareTypes.map((share, index) => {
                                                return (
                            Severity: Minor
                            Found in packages/render/miniapp/apiForH5/Components/Share.js - About 1 hr to fix

                              Function promisefyApis has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function promisefyApis(ReactWX, facade, more) {
                                  const weApis = Object.assign({}, onAndSyncApis, noPromiseApis, otherApis, more);
                                  Object.keys(weApis).forEach(key => {
                                      var needWrapper = more[key] || facade[key] || noop;
                                      if (!onAndSyncApis[key] && !noPromiseApis[key]) {
                              Severity: Minor
                              Found in packages/render/miniapp/registerAPIs.js - About 1 hr to fix

                                Function createClass has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function createClass(spec) {
                                    if (!isFn(spec.render)) {
                                        throw "createClass(...): Class specification must implement a `render` method.";
                                    }
                                    var statics = spec.statics;
                                Severity: Minor
                                Found in lib/createClass.js - About 1 hr to fix

                                  Function mergeStates has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function mergeStates(fiber, nextProps) {
                                      let instance = fiber.stateNode,
                                          pendings = fiber.updateQueue.pendingStates,
                                          n = pendings.length,
                                          state = fiber.memoizedState || instance.state;
                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language