lib/index.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 60
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

4 Functions

Rating   Name   Duplication   Size   Complexity  
A module.exports.execute 0 3 1
A module.exports.run 0 3 1
A module.exports.prepare 0 3 1
A module.exports.barricade 0 3 1
1
var API = require('./API')
2
var Schema = require('./Schema')
3
4
module.exports = {
5
  API: API,
6
  Schema: Schema,
7
  TriggerType: Schema.TriggerType,
8
  Framework: API.Framework,
9
  Utility: require('./Utility'),
10
  /**
11
   * Runs provided scenario
12
   *
13
   * @param {TScenarioInput} scenario
14
   * @param {TFrameworkOptions} options
15
   *
16
   * @return {Thenable.<TRunResult>}
17
   */
18
  run: function (scenario, options) {
19
    return (new API.Framework(options)).run(scenario)
20
  },
21
  /**
22
   * Prepares run, but doesn't execute it
23
   *
24
   * @param {TScenarioInput} scenario
25
   * @param {TFrameworkOptions} options
26
   * @return {Run}
27
   */
28
  prepare: function (scenario, options) {
29
    return (new API.Framework(options)).prepare(scenario)
30
  },
31
  /**
32
   * Executes prepared Run
33
   *
34
   * @param {Run} run
35
   * @param {TFrameworkOptions} options
36
   *
37
   * @return {TRunResult}
38
   */
39
  execute: function (run, options) {
40
    return (new API.Framework(options)).execute(run)
41
  },
42
  /**
43
   * Validates provided scenario
44
   *
45
   * @return {ViolationSet}
46
   */
47
  validate: Schema.Validator.scenario,
48
  /**
49
   * Normalizes provided scenario or throws an error, if scenario is
50
   * non-normalizable.
51
   *
52
   * @param {TScenarioInput} scenario
53
   * @param {TBarricadeOptions} options
54
   *
55
   * @return {TScenario}
56
   */
57
  barricade: function (scenario, options) {
58
    return (new API.Barricade(options)).scenario(scenario)
59
  }
60
}
61