formwidgets/relationships/components/index.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 25
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
dl 0
loc 25
rs 10
c 2
b 0
f 0
cc 0
nc 1
mnd 0
bc 2
fnc 3
bpm 0.6666
cpm 1
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ $ 0 19 1
1
import Vue from 'vue';
2
import RelationshipsComponent from './relationships';
3
4
// register global utilities
5
require('assets/js/boot');
6
7
$(function() {
8
    // find the element we're going to mount our component to
9
    $('[data-component=relationships]').each(function() {
10
        let el = $(this)[0];
11
12
        // parse our props from data attributes
13
        const lang = JSON.parse(el.dataset.lang);
14
        const name = el.dataset.name;
15
        const value = JSON.parse(el.dataset.value);
16
17
        // instantiate our component and mount it to the dom
18
        new Vue({
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Vue({IdentifierNode(...alse))))),false,true)}) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
19
            el,
20
            render: h => h(RelationshipsComponent, {
21
                props: {  lang, name, value },
22
            }),
23
        });
24
    });
25
});
26