src/library/mkdir.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 3

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A mkdir.js ➔ mkdirSync 0 9 3
1
import fs from 'fs'
2
3
const mkdirSync = function mkdirSync(path) {
0 ignored issues
show
Comprehensibility Naming Best Practice introduced by
The variable mkdirSync already seems to be declared on line 3. Consider using another variable name or omitting the var keyword.

This check looks for variables that are declared in multiple lines. There may be several reasons for this.

In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.

If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.

Loading history...
4
  try {
5
    fs.mkdirSync(path)
6
  } catch (e) {
7
    if (e.code !== 'EEXIST') {
8
      throw e
9
    }
10
  }
11
}
12
13
export default mkdirSync