Showing 556 of 650 total issues
Function updateProps
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateProps(instance, rawProps, rawPrevProps, optimized) {
const { props, attrs, vnode: { patchFlag } } = instance;
const rawCurrentProps = toRaw(props);
const [options] = instance.propsOptions;
let hasAttrsChanged = false;
Function normalizePropsOptions
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function normalizePropsOptions(comp, appContext, asMixin = false) {
const cache = appContext.propsCache;
const cached = cache.get(comp);
if (cached) {
return cached;
Function emit
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function emit(instance, event, ...rawArgs) {
const props = instance.vnode.props || EMPTY_OBJ;
{
const { emitsOptions, propsOptions: [propsOptions] } = instance;
if (emitsOptions) {
Function traverseNode
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function traverseNode(node, context) {
context.currentNode = node;
// apply transform plugins
const { nodeTransforms } = context;
const exitFns = [];
- 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 getTransitionInfo
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function getTransitionInfo(el, expectedType) {
const styles = window.getComputedStyle(el);
// JSDOM may return undefined for transition properties
const getStyleProperties = (key) => (styles[key] || '').split(', ');
const transitionDelays = getStyleProperties(TRANSITION + 'Delay');
- 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 getGeneratedPropsConstantType
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function getGeneratedPropsConstantType(node, context) {
let returnType = 3 /* CAN_STRINGIFY */;
const props = getNodeProps(node);
if (props && props.type === 15 /* JS_OBJECT_EXPRESSION */) {
const { properties } = props;
- 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 transformSlotOutlet
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const transformSlotOutlet = (node, context) => {
if (isSlotOutlet(node)) {
const { children, loc } = node;
const { slotName, slotProps } = processSlotOutlet(node, context);
const slotArgs = [
- 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 injectProp
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function injectProp(node, prop, context) {
let propsWithInjection;
const props = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
if (props == null || isString(props)) {
propsWithInjection = createObjectExpression([prop]);
- 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 setRef
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setRef = (rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) => {
if (isArray(rawRef)) {
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
return;
}
Function useHistoryListeners
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useHistoryListeners(base, historyState, currentLocation, replace) {
let listeners = [];
let teardowns = [];
// TODO: should it be a stack? a Dict. Check if the popstate listener
// can trigger twice
Function createMemoryHistory
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createMemoryHistory(base = "") {
let listeners = [];
let queue = [START];
let position = 0;
function setLocation(location) {
Function createComponentInstance
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createComponentInstance(vnode, parent, suspense) {
const type = vnode.type;
// inherit parent app context - or - if root, adopt from root vnode
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
const instance = {
Function setup
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup() {
const instance = currentInstance;
// already resolved
if (resolvedComp) {
return () => createInnerComp(resolvedComp, instance);
Function parseTag
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseTag(context, type, parent) {
// Tag open.
const start = getCursor(context);
const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
const tag = match[1];
Function a9e3
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var DESCRIPTORS = __webpack_require__("83ab");
Function processIf
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processIf(node, dir, context, processCodegen) {
if (dir.name !== 'else' &&
(!dir.exp || !dir.exp.content.trim())) {
const loc = dir.exp ? dir.exp.loc : node.loc;
context.onError(createCompilerError(27 /* X_V_IF_NO_EXPRESSION */, dir.loc));
Function patchElement
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
const el = (n2.el = n1.el);
let { patchFlag, dynamicChildren, dirs } = n2;
// #1426 take the old vnode's patch flag into account since user may clone a
// compiler-generated vnode, which de-opts to FULL_PROPS
Function a434
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
Function 9263
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpFlags = __webpack_require__("ad6d");
Function transformModel$1
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const transformModel$1 = (dir, node, context) => {
const baseResult = transformModel(dir, node, context);
// base transform has errors OR component v-model (only need props)
if (!baseResult.props.length || node.tagType === 1 /* COMPONENT */) {
return baseResult;