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

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 29
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ $ 0 22 1
1
import axios from 'axios';
2
import DriverConfigsComponent from './driver_configs';
3
import Vue from 'vue';
4
5
// register global utilities
6
require('assets/js/boot');
7
8
$(function() {
9
    // find the element we're going to mount our component to
10
    const el = document.querySelector('[data-component=driver-configs]');
11
12
    // parse our props from data attributes
13
    const drivers = JSON.parse(el.dataset.drivers);
14
    const lang = JSON.parse(el.dataset.lang);
15
16
    // configure axios with our csrf token
17
    axios.defaults.headers.common['X-CSRF-TOKEN'] = el.dataset.token;
18
19
    // instantiate our component and mount it to the dom
20
    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...
21
        el,
22
        render: h => h(DriverConfigsComponent, {
23
            props: {
24
                drivers,
25
                lang,
26
            },
27
        }),
28
    });
29
});
30