Completed
Pull Request — master (#21)
by
unknown
02:20
created

src/cli/cms/data/reference.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 31
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
nc 1
dl 0
loc 31
rs 10
noi 3
c 1
b 0
f 0
cc 0
wmc 2
mnd 0
bc 2
fnc 2
bpm 1
cpm 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A reference.js ➔ getFiles 0 20 1
1
import path from 'path'
2
import mkdirp from 'mkdirp'
3
import fse from 'fs-extra'
4
5
import {
6
  abeExtend,
0 ignored issues
show
Unused Code introduced by
The variable abeExtend seems to be never used. Consider removing it.
Loading history...
7
  coreUtils,
0 ignored issues
show
Unused Code introduced by
The variable coreUtils seems to be never used. Consider removing it.
Loading history...
8
  cmsData,
9
  config
10
} from '../../'
11
12
export function getFiles() {
13
  var arr = []
0 ignored issues
show
Unused Code introduced by
The assignment to variable arr seems to be never used. Consider removing it.
Loading history...
14
  var res = []
15
  arr = cmsData.file.read(
16
    path.join(config.root, config.reference.url),
17
    path.join(config.root, config.reference.url),
18
    'files',
19
    true,
20
    /(.json*?)/
21
  )
22
23
  arr.forEach(function (el) {
24
    res.push({
25
      name: el.name,
26
      data: cmsData.file.get(el.path)
27
    })
28
  })
29
30
  return res
31
}
32