Showing 650 of 650 total issues
Function isSameKey
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function isSameKey(a, b) {
if (!a || a.type !== b.type) {
return false;
}
if (a.type === 6 /* ATTRIBUTE */) {
- 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 createForLoopParams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function createForLoopParams({ value, key, index }) {
const params = [];
if (value) {
params.push(value);
}
- 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 stringify
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function stringify(params) {
let path = "";
// for optional parameters to allow to be empty
let avoidDuplicatedSlash = false;
for (const segment of segments) {
Function createReactiveEffect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createReactiveEffect(fn, options) {
const effect = function reactiveEffect() {
if (!effect.active) {
return fn();
}
Function baseCompile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function baseCompile(template, options = {}) {
const onError = options.onError || defaultOnError;
const isModuleMode = options.mode === 'module';
/* istanbul ignore if */
{
Function resolveAsset
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
const instance = currentRenderingInstance || currentInstance;
if (instance) {
const Component = instance.type;
// explicit self name has highest priority
Function patchProp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
switch (key) {
// special
case 'class':
patchClass(el, nextValue, isSVG);
Function mergeProps
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mergeProps(...args) {
const ret = extend({}, args[0]);
for (let i = 1; i < args.length; i++) {
const toMerge = args[i];
for (const key in toMerge) {
Function transformSlotOutlet
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const transformSlotOutlet = (node, context) => {
if (isSlotOutlet(node)) {
const { children, loc } = node;
const { slotName, slotProps } = processSlotOutlet(node, context);
const slotArgs = [
Function parseComment
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseComment(context) {
const start = getCursor(context);
let content;
// Regular comment.
const match = /--(\!)?>/.exec(context.source);
Function processFor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function processFor(node, dir, context, processCodegen) {
if (!dir.exp) {
context.onError(createCompilerError(30 /* X_V_FOR_NO_EXPRESSION */, dir.loc));
return;
}
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
Function data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data: function data() {
return {
timeValue: {},
hours: [],
minutes: [],
Function from
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
Function normalizeSuspenseSlot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function normalizeSuspenseSlot(s) {
let block;
if (isFunction(s)) {
const isCompiledSlot = s._c;
if (isCompiledSlot) {
Function warnDeprecation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function warnDeprecation(key, instance, ...args) {
instance = instance || getCurrentInstance();
// check user config
const config = getCompatConfigForKey(key, instance);
if (config === 'suppress-warning') {
Function resolveRelativePath
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolveRelativePath(to, from) {
if (to.startsWith("/")) return to;
if (!from.startsWith("/")) {
warn(
`Cannot resolve a relative location without an absolute path. Trying to resolve "${to}" from "${from}". It should look like "/${from}".`
Function formatValue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formatValue: function formatValue(token, i) {
if (!this.isNumber(i)) {
return '';
}
Consider simplifying this complex logical expression. Open
Open
if ((vnodeHook = props && props.onVnodeMounted) ||
needCallTransitionHooks ||
dirs) {
queuePostRenderEffect(() => {
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
Function hydrateTeleport
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector } }, hydrateChildren) {