Passed
Push — master ( 61dd3f...482d1b )
by greg
01:51
created

src/cli/cms/editor/handlebars/folders.js   A

Complexity

Total Complexity 4
Complexity/F 4

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 4
c 1
b 0
f 0
nc 1
mnd 1
bc 3
fnc 1
dl 0
loc 13
rs 10
bpm 3
cpm 4
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A folders.js ➔ folders 0 11 4
1
import recursiveFolder from './recursiveFolder'
2
3
export default function folders(obj, index, link) {
4
  var res
5
  if(typeof link !== 'undefined' && link !== null && link !== 'null') {
6
    var links = link.replace(/^\//, '').split('/')
7
    links.pop()
8
    res = recursiveFolder(obj, 1, '', links)
9
  }else {
10
    res = recursiveFolder(obj, 1)
11
  }
12
  return res
13
}
14