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;
}
- Read upRead up
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 = () => {},
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];
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');
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
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) {
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,
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 (
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) {
- Read upRead up
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) {
- Read upRead up
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是专门给快应用
Function applybeforeUpdateHooks
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applybeforeUpdateHooks(
fiber,
instance,
newProps,
newContext,
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) {
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.";
}
//创建一个构造器,有四个参数
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {
location,
navigate,
basepath,
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) {
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="share2019">
{shareTypes.map((share, index) => {
return (
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]) {
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;
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;
- Read upRead up
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"