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

src/Administration/Resources/app/administration/src/app/mixin/context-node.mixin.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 24
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 14
mnd 0
bc 0
fnc 5
dl 0
loc 24
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
Shopware.Mixin.register('contextNodeMixin', {
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...
2
    provide() {
3
        return {
4
            registerAtParent: this.registerChild,
5
            removeFromParent: this.removeChild
6
        };
7
    },
8
9
    data() {
10
        return {
11
            childNodes: []
12
        };
13
    },
14
15
    methods: {
16
        registerChild(child) {
17
            this.childNodes.push(child);
18
            return this;
19
        },
20
        removeChild(child) {
21
            this.childNodes = this.childNodes.filter((c) => c !== child);
22
        }
23
    }
24
});
25