src/js/routes/middlewares.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 3

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 0
c 1
b 1
f 1
nc 8
dl 0
loc 13
ccs 4
cts 8
cp 0.5
crap 0
rs 10
wmc 3
mnd 1
bc 2
fnc 1
bpm 2
cpm 3
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A middlewares.js ➔ ??? 0 9 3
1
import App from "app";
2 4
import qs from "qs";
3
4
// parse querystring
5
App.service("ROUTER").addMiddleware("*", (context, next) => {
6
    let query = context.canonicalPath;
7 4
    if (query && query.length) {
8 2
        query = query.split("?")[1] || "";
9
    }
10
11 2
    context.query = qs.parse(query || location.search.slice(1));
12
    next();
13
});
14