src/heroku/Heroku.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 21
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
mnd 0
bc 0
fnc 3
dl 0
loc 21
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

3 Functions

Rating   Name   Duplication   Size   Complexity  
A Heroku.test 0 3 1
A Heroku.constructor 0 4 1
A Heroku.deploy 0 8 1
1
2
import Api from './HerokuApi';
3
4
export default class Heroku {
5
    constructor(name, apiKey, logger) {
6
        this.api = new Api(name, apiKey);
7
        this.logger = logger;
8
    }
9
10
    async deploy(file, version) {
11
        const source = await this.api.createSource();
12
13
        await this.api.upload(source.put, file);
14
        const build = await this.api.createBuild(source.get, version);
15
16
        return build.id;
17
    }
18
19
    test() {
20
        return this.api.test();
21
    }
22
}
23