Passed
Pull Request — master (#2)
by
unknown
03:05
created

src/mixin.js   A

Complexity

Total Complexity 7
Complexity/F 7

Size

Lines of Code 30
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
cc 0
eloc 17
nc 1
dl 0
loc 30
ccs 7
cts 9
cp 0.7778
crap 0
rs 10
c 0
b 0
f 0
wmc 7
mnd 2
bc 4
fnc 1
bpm 4
cpm 7
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B pageTitleMixin.created 0 24 7
1 2
import { isFunction } from './utils'
2
3 2
const pageTitleMixin = {
4
  created () {
5 10
    const { title, titlePrefix, titleSuffix } = this.$options
6
7 10
    if (title !== undefined) {
8
      // allow use dynamic title system
9 5
      this.$title = isFunction(title)
10
        ? title.call(this, this)
11
        : title
12
    }
13
14 10
    if (titlePrefix !== undefined) {
15
      // allow use dynamic titlePrefix system
16
      this.$titlePrefix = isFunction(titlePrefix)
17
        ? titlePrefix.call(this, this)
18
        : titlePrefix
19
    }
20
21 10
    if (titleSuffix !== undefined) {
22
      // allow use dynamic titleSuffix system
23
      this.$titleSuffix = isFunction(titleSuffix)
24
        ? titleSuffix.call(this, this)
25
        : titleSuffix
26
    }
27
  }
28
}
29
30
export default pageTitleMixin
31