Failed Conditions
Push — master ( 1671e4...0a897b )
by Yo
01:39
created

index.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 25
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A ➔ ??? 0 1 1
1
"use strict";
2
3
if (['dev', 'prod'].indexOf(process.env.NODE_ENV)) {
4
    console.warn(`Undefined node environment "${process.env.NODE_ENV}", fallback to dev !`);
5
    process.env.NODE_ENV = 'dev';
6
}
7
8
const logger = require('./lib/logger');
9
const server = require('./lib/server');
10
const Alfred = require('./lib/Alfred');
11
const pkg = require('./package.json');
12
13
const appName = pkg.name;
14
15
const alfred = new Alfred([]);
16
17
logger.starting(appName);
18
19
server.start(alfred)
20
    .then(() => logger.started(appName))
21
    .catch(error => {
22
        logger.error(`Exit ${appName} after an error => ${error.stack || error}`);
23
24
        process.exit(1);
0 ignored issues
show
Compatibility Debugging Code Best Practice introduced by
Use of process.exit() is discouraged as it will potentially stop the complete node.js application. Consider quitting gracefully instead by throwing an Error.
Loading history...
25
    });
26