Passed
Pull Request — main (#3)
by Martin
01:53
created

src/routes/v1/cities.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 39
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
mnd 0
bc 0
fnc 2
dl 0
loc 39
bpm 0
cpm 1
noi 6
c 0
b 0
f 0
rs 10
1
import express from "express";
2
// import citiesModel from "../../models/cities.js";
3
4
const router = express.Router();
5
6
/**
7
 * Note to self:
8
 * Wrappa hämtningarna i en try catch där catch pekar
9
 * mot felhanterings-middleware med hjälp av next
10
 * Tänk på payload/token
11
 */
12
13
/**
14
 * @description Route for getting all cities
15
 *
16
 * @param {express.Request} req Request object
17
 * @param {express.Response} res Response object
18
 * @param {express.NextFunction} next Next function
19
 *
20
 * @returns {void}
21
 */
22
router.get("/", (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 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...
23
    // code here for getting all cities through citiesModel
24
});
25
26
/**
27
 * @description Route for getting one city
28
 *
29
 * @param {express.Request} req Request object
30
 * @param {express.Response} res Response object
31
 * @param {express.NextFunction} next Next function
32
 *
33
 * @returns {void}
34
 */
35
router.get("/:id", (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...
36
    // code here for getting one city through citiesModel
37
});
38
39
export default router;