Total Complexity | 6 |
Complexity/F | 1.5 |
Lines of Code | 33 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import template from './sw-meteor-navigation.html.twig'; |
||
2 | import './sw-meteor-navigation.scss'; |
||
3 | |||
4 | const { Component } = Shopware; |
||
|
|||
5 | |||
6 | Component.register('sw-meteor-navigation', { |
||
7 | template, |
||
8 | |||
9 | computed: { |
||
10 | route() { |
||
11 | return this.$route; |
||
12 | }, |
||
13 | |||
14 | hasParentRoute() { |
||
15 | return this.route.meta && this.route.meta.parentPath; |
||
16 | }, |
||
17 | |||
18 | navigationPath() { |
||
19 | if (!this.hasParentRoute) { |
||
20 | return []; |
||
21 | } |
||
22 | |||
23 | return [{ |
||
24 | name: this.route.meta.parentPath, |
||
25 | label: this.$tc('sw-extension-store.general.backBtn') |
||
26 | }].reverse(); |
||
27 | }, |
||
28 | |||
29 | parentRoute() { |
||
30 | return this.hasParentRoute ? this.navigationPath[0] : null; |
||
31 | } |
||
32 | } |
||
33 | }); |
||
34 |
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.