resources/js/widget/router/index.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 84
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 59
nc 1
dl 0
loc 84
c 0
b 0
f 0
cc 0
rs 10
wmc 2
mnd 0
bc 1
fnc 2
bpm 0.5
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B index.js ➔ createRouter 0 68 1
1
import Vue from 'vue'
2
import Router from 'vue-router'
3
4
// Containers
5
import Full from '../containers/Full'
6
7
// Views
8
9
import MainWindow from '../views/MainWindow'
10
import DonateWindow from '../views/DonateWindow'
11
import RecurrentWindow from '../views/RecurrentWindow'
12
import RecurrentDonateWindow from '../views/RecurrentDonateWindow'
13
import StatusWindow from '../views/StatusWindow'
14
15
Vue.use(Router)
16
17
export function createRouter(base, i18n) {
18
  return new Router({
19
    mode: 'history',
20
    base: base,
21
    linkActiveClass: 'open active',
22
    scrollBehavior: () => ({ y: 0 }),
23
    routes: [
24
      {
25
        path: '/campaign/',
26
        name: 'campaign',
27
        component: Full,
28
        meta: {
29
          label: i18n.t('labels.admin.title')
30
        },
31
        children: [
32
          {
33
            path: ':id',
34
            name: 'id',
35
            component: MainWindow,
36
            meta: {
37
              label: i18n.t('labels.admin.campaigns.title')
38
            }
39
          },
40
          {
41
            path: ':id/donate',
42
            name: 'donate',
43
            component: DonateWindow,
44
            meta: {
45
              label: i18n.t('labels.admin.campaigns.title')
46
            }
47
          },
48
          {
49
            path: ':id/donate/status',
50
            name: 'donateStatus',
51
            component: StatusWindow,
52
            meta: {
53
              label: i18n.t('labels.admin.campaigns.title')
54
            }
55
          },
56
          {
57
            path: ':id/recurrent',
58
            name: 'recurrent',
59
            component: RecurrentWindow,
60
            meta: {
61
              label: i18n.t('labels.admin.campaigns.title')
62
            }
63
          },
64
          {
65
            path: ':id/recurrent/donate',
66
            name: 'recurrentDonate',
67
            component: RecurrentDonateWindow,
68
            meta: {
69
              label: i18n.t('labels.admin.campaigns.title')
70
            }
71
          },
72
          {
73
            path: ':id/recurrent/status',
74
            name: 'recurrentStatus',
75
            component: StatusWindow,
76
            meta: {
77
              label: i18n.t('labels.admin.campaigns.title')
78
            }
79
          }
80
        ]
81
      }
82
    ]
83
  })
84
}
85