src/controllers/express/custom.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 13
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
mnd 0
bc 0
fnc 2
dl 0
loc 13
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

2 Functions

Rating   Name   Duplication   Size   Complexity  
A custom.js ➔ router 0 7 1
A custom.js ➔ health 0 3 1
1
const httpSuccessCode = 200;
2
3
export function health(req, res) {
4
    res.sendStatus(httpSuccessCode);
5
}
6
7
export function router(routeTable, express, req, res) {
8
    const requestType = req._context.aws;
9
    const service = routeTable[requestType];
10
    const runner = express.makeServiceRunner(service);
11
12
    return runner(req, res);
13
}
14