q-XQKYwqyp.js ➔ __vite__mapDeps   F
last analyzed

Complexity

Conditions 14

Size

Total Lines 1
Code Lines 1

Duplication

Lines 1
Ratio 100 %

Importance

Changes 0
Metric Value
eloc 1
dl 1
loc 1
rs 3.6
c 0
b 0
f 0
cc 14

How to fix   Complexity   

Complexity

Complex classes like q-XQKYwqyp.js ➔ __vite__mapDeps often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
import{l as u,j as l,K as n,b as i,k as h,C as p,c as _,W as d,y as m,_ as f,h as v}from"./q-grzRItSl.js";import{H as C}from"./q-DTQGOYfe.js";import{P as g}from"./q-4cd3cGAD.js";import{b as y}from"./q-mmDR2EFA.js";import{useRecipesDetails as D,useDuplicate as W}from"./q-K7SEXFaB.js";import{a as b}from"./q-5LSN8IXO.js";const P=({cleanup:e})=>{const[a,s,r,o]=u();o.header=l(C,{get recipe(){return r.value.recipe},onDuplicate:a,shareURL:s,[n]:{onDuplicate:n,recipe:i(t=>t.value.recipe,[r])}},3,"Ch_1"),e(()=>o.header=null)},U=()=>{h();const e=D();if(!e.value)return p("div",null,null,"pages.shared.notfound",1,"Ch_0");const a=_(y),s=b(),r=new URL(`shared/${e.value.sharedToken}`,s.url.origin),o=e.value.recipe,t=W();return d(m(()=>f(()=>Promise.resolve().then(()=>j),void 0),"s_KWfHhWD0JGo",[t,r,e,a])),l(g,{recipe:o,shareURL:r,get sharedBy(){return e.value.sharedBy},[n]:{sharedBy:i(c=>c.value.sharedBy,[e])}},3,"Ch_2")},j=Object.freeze(Object.defineProperty({__proto__:null,_hW:v,s_BWz0EYUbbMA:U,s_KWfHhWD0JGo:P},Symbol.toStringTag,{value:"Module"}));export{v as _hW,U as s_BWz0EYUbbMA,P as s_KWfHhWD0JGo};function __vite__mapDeps(indexes){if(!__vite__mapDeps.viteFileDeps){__vite__mapDeps.viteFileDeps=[]}return indexes.map(i=>__vite__mapDeps.viteFileDeps[i])}
0 ignored issues
show
Bug introduced by
The variable URL seems to be never declared. If this is a global, consider adding a /** global: URL */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Unused Code introduced by
The parameter cleanup is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Bug introduced by
The variable s_KWfHhWD0JGo seems to be never declared. If this is a global, consider adding a /** global: s_KWfHhWD0JGo */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
Bug introduced by
The variable _hW seems to be never declared. If this is a global, consider adding a /** global: _hW */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
Unused Code introduced by
The constant j seems to be never used. Consider removing it.
Loading history...
Bug introduced by
The local (let) variable j is used before it is defined. This will cause a reference error.
Loading history...
Bug introduced by
The variable s_BWz0EYUbbMA seems to be never declared. If this is a global, consider adding a /** global: s_BWz0EYUbbMA */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...