| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 39 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 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) => { |
||
| 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) => { |
||
| 36 | // code here for getting one city through citiesModel |
||
| 37 | }); |
||
| 38 | |||
| 39 | export default router; |
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.