Passed
Push — main ( fcca7c...55cb12 )
by Julia
43s queued 16s
created

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

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 58
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
mnd 0
bc 0
fnc 4
dl 0
loc 58
bpm 0
cpm 1
noi 12
c 0
b 0
f 0
rs 10
1
import express from "express";
2
// import some model from some file
3
4
const router = express.Router();
5
6
/**
7
 * @description Route for deactivating a bike
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("/:id/deactivate", (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 deactivating bike
17
});
18
19
/**
20
 * @description Route for changing a bike's status
21
 *
22
 * @param {express.Request} req Request object
23
 * @param {express.Response} res Response object
24
 * @param {express.NextFunction} next Next function
25
 *
26
 * @returns {void}
27
 */
28
router.get("/:id/status/:id", (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 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...
29
    // code here for changing a bike's status
30
});
31
32
/**
33
 * @description Route for changing a bike's position
34
 *
35
 * @param {express.Request} req Request object
36
 * @param {express.Response} res Response object
37
 * @param {express.NextFunction} next Next function
38
 *
39
 * @returns {void}
40
 */
41
router.get("/:id/move", (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 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...
42
    // code here for changing a bike's position
43
});
44
45
/**
46
 * @description Route for changing a bike's city
47
 *
48
 * @param {express.Request} req Request object
49
 * @param {express.Response} res Response object
50
 * @param {express.NextFunction} next Next function
51
 *
52
 * @returns {void}
53
 */
54
router.get("/:id/change/city", (req, res, next) => {
0 ignored issues
show
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...
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...
55
    // code here for changing a bike's city
56
});
57
58
export default router;
59