lib/Schema/OperationStatus.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 23
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
nc 1
mnd 1
bc 1
fnc 1
dl 0
loc 23
rs 10
bpm 1
cpm 2
noi 0
c 1
b 0
f 0
1
var factory = function (id, successful) {
2
  var terminal = typeof successful === 'boolean'
3
  return {
4
    id: id,
5
    terminal: terminal,
6
    successful: terminal ? successful : null
7
  }
8
}
9
10
module.exports = {
11
  /**
12
   * @enum {TOperationStatus}
13
   * @readonly
14
   */
15
  OperationStatus: {
16
    None: factory('None'),
17
    Running: factory('Running'),
18
    Aborted: factory('Aborted', true),
19
    Finished: factory('Finished', true),
20
    Failed: factory('Failed', false),
21
    Tripped: factory('Tripped', false)
22
  }
23
}
24