Passed
Push — master ( f13264...618485 )
by Christian
13:29 queued 10s
created

src/Administration/Resources/app/administration/src/app/component/meteor/sw-meteor-page-context-menu/index.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 29
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 17
mnd 0
bc 0
fnc 3
dl 0
loc 29
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
import template from './sw-meteor-page-context-menu.html.twig';
2
import './sw-meteor-page-context-menu.scss';
3
4
const { Component } = Shopware;
0 ignored issues
show
Bug introduced by
The variable Shopware seems to be never declared. If this is a global, consider adding a /** global: Shopware */ 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...
5
6
Component.register('sw-meteor-page-context-menu', {
7
    template,
8
9
    props: {
10
        menuEntry: {
11
            type: Object,
12
            required: true
13
        }
14
    },
15
16
    computed: {
17
        parentNode() {
18
            return this.menuEntry.parentNode;
19
        },
20
21
        isRootMenu() {
22
            return this.menuEntry.depth === 1 ||
23
                (this.menuEntry.depth === 2 && !this.menuEntry.collapsed);
24
        },
25
        subMenuItems() {
26
            return this.menuEntry.collapsedChildren;
27
        }
28
    }
29
});
30