Passed
Push — master ( fd5993...4f9324 )
by Vinicius
03:57 queued 01:54
created

src/router.js   A

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 12
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 0
nc 1
dl 0
loc 12
ccs 5
cts 5
cp 1
crap 0
rs 10
c 2
b 0
f 1
wmc 4
mnd 1
bc 3
fnc 2
bpm 1.5
cpm 2
noi 2
1
/**
2
 * @method setup
3
 * @param  {Function}   setTitle    setTitle callback
4
 * @param  {Object}     options     { router: RouterInstance }
0 ignored issues
show
Documentation introduced by
The parameter options does not exist. Did you maybe forget to remove this comment?
Loading history...
5
 * @return {void}
6
 */
7 2
const setup = (setTitle, { router }) => {
8 1
  router.afterEach((to, from) => {
0 ignored issues
show
Unused Code introduced by
The parameter from is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
9 2
    const { meta } = to
10
11
    // if has meta and title
12 4
    if (meta && meta.title) {
13 1
      setTitle(meta.title)
14
    }
15
  })
16
}
17
18
export { setup }
19