Passed
Push — master ( 967bc6...fd5993 )
by Vinicius
02:44
created

router.js ➔ ???   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 2
nop 2
dl 0
loc 1
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
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