Passed
Push — main ( d1d508...d26c33 )
by Julia
03:28 queued 01:41
created

server/routes/v1/admin/trips.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 51
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
mnd 0
bc 0
fnc 3
dl 0
loc 51
rs 10
bpm 0
cpm 1
noi 9
c 0
b 0
f 0
1
import express from "express";
2
// import some model from some file
3
4
const router = express.Router();
5
6
/**
7
 * @description Route for trips for one user
8
 *
9
 * @param {express.Request} req Request object
10
 * @param {express.Response} res Response object
11
 * @param {express.NextFunction} next Next function
12
 *
13
 * @returns {void}
14
 */
15
router.get("/", (req, res, next) => {
0 ignored issues
show
Unused Code introduced by
The parameter res is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter next is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter req is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
16
    // code here for getting trips for one user
17
    // Båda admin och användare använder den här routen
18
    // user_id finns antingen i token eller body (admin)
19
});
20
21
/**
22
 * @description Route for trips for one user using pagination
23
 *
24
 * @param {express.Request} req Request object
25
 * @param {express.Response} res Response object
26
 * @param {express.NextFunction} next Next function
27
 *
28
 * @returns {void}
29
 */
30
router.get("/limit/:limit/offset/:offset", (req, res, next) => {
0 ignored issues
show
Unused Code introduced by
The parameter req is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter next is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter res is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
31
    // code here for getting trips for one user using pagination
32
    // Båda admin och användare använder den här routen
33
    // user_id finns antingen i token eller body (admin)
34
});
35
36
/**
37
 * @description Route for trips all trips in system
38
 *
39
 * @param {express.Request} req Request object
40
 * @param {express.Response} res Response object
41
 * @param {express.NextFunction} next Next function
42
 *
43
 * @returns {void}
44
 */
45
router.get("/all", (req, res, next) => {
0 ignored issues
show
Unused Code introduced by
The parameter req is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter next is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter res is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
46
    // code here for getting trips for one user
47
    // Båda admin och användare använder den här routen
48
    // user_id finns antingen i token eller body (admin)
49
});
50
51
export default router;
52