| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 17 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | import Cookies from 'cookies' |
||
| 2 | |||
| 3 | import { |
||
| 4 | config |
||
| 5 | } from '../../../../cli' |
||
| 6 | |||
| 7 | var route = function route(req, res) { |
||
|
|
|||
| 8 | var cookies = new Cookies( req, res, { |
||
| 9 | secure: config.cookie.secure |
||
| 10 | }) |
||
| 11 | cookies.set( 'x-access-token', null ) |
||
| 12 | |||
| 13 | req.logout() |
||
| 14 | res.redirect('/abe/users/login') |
||
| 15 | } |
||
| 16 | |||
| 17 | export default route |
This check looks for variables that are declared in multiple lines. There may be several reasons for this.
In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.
If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.