src/rules/head/index.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 5

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 5
c 1
b 0
f 0
nc 2
mnd 1
bc 4
fnc 1
dl 0
loc 13
rs 10
bpm 4
cpm 5
noi 0
1
module.exports = $ => {
2
  const result = []
3
  if ($('head title').length === 0) {
4
    result.push('header that doesn’t have <title> tag')
5
  }
6
  if ($('head meta[name="descriptions"]').length === 0) {
7
    result.push('header that doesn’t have descriptions <meta> tag')
8
  }
9
  if ($('head meta[name="keywords"]').length === 0) {
10
    result.push('header that doesn’t have keywords <meta> tag')
11
  }
12
  return result.length ? result.join('\r\n') : null
13
}
14